| Top |
GConfClientGConfClient —
|
enum GConfClientPreloadType; enum GConfClientErrorHandlingMode;void (*GConfClientNotifyFunc) (GConfClient *client,guint cnxn_id, GConfEntry *entry,gpointer user_data);void (*GConfClientErrorHandlerFunc) (GConfClient *client,GError *error); #define GCONF_CLIENT (obj)GConfClient * gconf_client_get_default (void);GConfClient * gconf_client_get_for_engine (GConfEngine *engine);void gconf_client_add_dir (GConfClient *client, constgchar *dir, GConfClientPreloadType preload,GError **err);void gconf_client_remove_dir (GConfClient *client, constgchar *dir,GError **err);guint gconf_client_notify_add (GConfClient *client, constgchar *namespace_section, GConfClientNotifyFunc func,gpointer user_data,GFreeFunc destroy_notify,GError **err);void gconf_client_notify_remove (GConfClient *client,guint cnxn);void gconf_client_notify (GConfClient *client, constchar *key);void gconf_client_set_error_handling (GConfClient *client, GConfClientErrorHandlingMode mode);void gconf_client_set_global_default_error_handler (GConfClientErrorHandlerFunc func);void gconf_client_clear_cache (GConfClient *client);void gconf_client_preload (GConfClient *client, constgchar *dirname, GConfClientPreloadType type,GError **err);void gconf_client_set (GConfClient *client, constgchar *key, const GConfValue *val,GError **err); GConfValue* gconf_client_get (GConfClient *client, constgchar *key,GError **err); GConfValue* gconf_client_get_without_default (GConfClient *client, constgchar *key,GError **err); GConfEntry* gconf_client_get_entry (GConfClient *client, constgchar *key, constgchar *locale,gboolean use_schema_default,GError **err); GConfValue* gconf_client_get_default_from_schema (GConfClient *client, constgchar *key,GError **err);gboolean gconf_client_unset (GConfClient *client, constgchar *key,GError **err);gboolean gconf_client_recursive_unset (GConfClient *client, constchar *key,GConfUnsetFlags flags,GError **err);GSList * gconf_client_all_entries (GConfClient *client, constgchar *dir,GError **err);GSList * gconf_client_all_dirs (GConfClient *client, constgchar *dir,GError **err);void gconf_client_suggest_sync (GConfClient *client,GError **err);gboolean gconf_client_dir_exists (GConfClient *client, constgchar *dir,GError **err);gboolean gconf_client_key_is_writable (GConfClient *client, constgchar *key,GError **err);gdouble gconf_client_get_float (GConfClient *client, constgchar *key,GError **err);gint gconf_client_get_int (GConfClient *client, constgchar *key,GError **err);gchar * gconf_client_get_string (GConfClient *client, constgchar *key,GError **err);gboolean gconf_client_get_bool (GConfClient *client, constgchar *key,GError **err); GConfSchema* gconf_client_get_schema (GConfClient *client, constgchar *key,GError **err);GSList * gconf_client_get_list (GConfClient *client, constgchar *key, GConfValueType list_type,GError **err);gboolean gconf_client_get_pair (GConfClient *client, constgchar *key, GConfValueType car_type, GConfValueType cdr_type,gpointer car_retloc,gpointer cdr_retloc,GError **err);gboolean gconf_client_set_float (GConfClient *client, constgchar *key,gdouble val,GError **err);gboolean gconf_client_set_int (GConfClient *client, constgchar *key,gint val,GError **err);gboolean gconf_client_set_string (GConfClient *client, constgchar *key, constgchar *val,GError **err);gboolean gconf_client_set_bool (GConfClient *client, constgchar *key,gboolean val,GError **err);gboolean gconf_client_set_schema (GConfClient *client, constgchar *key, const GConfSchema *val,GError **err);gboolean gconf_client_set_list (GConfClient *client, constgchar *key, GConfValueType list_type,GSList *list,GError **err);gboolean gconf_client_set_pair (GConfClient *client, constgchar *key, GConfValueType car_type, GConfValueType cdr_type,gconstpointer address_of_car,gconstpointer address_of_cdr,GError **err);void gconf_client_error (GConfClient *client,GError *error);void gconf_client_unreturned_error (GConfClient *client,GError *error);void gconf_client_value_changed (GConfClient *client, constgchar *key, GConfValue *value);gboolean gconf_client_commit_change_set (GConfClient *client, GConfChangeSet *cs,gboolean remove_committed,GError **err); GConfChangeSet* gconf_client_reverse_change_set (GConfClient *client, GConfChangeSet *cs,GError **err); GConfChangeSet* gconf_client_change_set_from_currentv (GConfClient *client, constgchar **keys,GError **err); GConfChangeSet* gconf_client_change_set_from_current (GConfClient *client,GError **err, constgchar *first_key, ...);
A client-side cache for a specified list of directories you're interested in. You can "preload" entire directories into the cache, speeding things up even more.
Some automatic error handling, if you request it.
Signals when a value changes or an error occurs.
If you use gconf_client_get_engine()gconf_client_get_default(), there is no (legitimate) way to obtain a pointer to the
underlying GConfEngine. If you create a
A
There are two error-related signals in
The "value_changed" signal is emitted whenever the server notifies your client
program that a value has changed in the GConf database. There's one problem with
this signal: the signal handler has to use strcmp()strcmp()gconf_client_notify_add() is a superior
interface in most cases for this reason. Note that calling gconf_client_set()
and its relatives will cause "value_changed" to be emitted, but "value_changed"
is also emitted if another process changes the value.
Most of the gconf_engine_get() and gconf_client_get(), for example). These should
all work just like the GConfEngine versions, except that they use the cache
from
As always with GConf, applications based on
gconf_client_set(client, key, value); application_update_to_reflect_setting();
This breaks if a setting is changed outside your application—or even from a different part of your application. The correct way (in pseudo-code) is:
/* At application startup */ gconf_client_notify_add(client, key, application_update_to_reflect_setting, data); /* From preferences dialog */ gconf_client_set(client, key, value);
See the example programs that come with GConf for more details.
typedef enum { /*< prefix=GCONF_CLIENT >*/
GCONF_CLIENT_PRELOAD_NONE, /* don't preload anything */
GCONF_CLIENT_PRELOAD_ONELEVEL, /* load entries directly under the directory. */
GCONF_CLIENT_PRELOAD_RECURSIVE /* recurse the directory tree; possibly quite expensive! */
} GConfClientPreloadType;
The GConfClientPreloadType is used to tell GCONF_CLIENT_PRELOAD_NONE specifies that no preload occurs,
GCONF_CLIENT_PRELOAD_ONELEVEL loads the immediate children of the directory,
GCONF_CLIENT_PRELOAD_RECURSIVE loads all children of the
directory and its subdirectories, recursively.
typedef enum { /*< prefix=GCONF_CLIENT >*/
GCONF_CLIENT_HANDLE_NONE,
GCONF_CLIENT_HANDLE_UNRETURNED,
GCONF_CLIENT_HANDLE_ALL
} GConfClientErrorHandlingMode;
GConfClientErrorHandlingMode is used to control g_signal_stop_emission_by_name()
void (*GConfClientNotifyFunc) (GConfClient *client,guint cnxn_id, GConfEntry *entry,gpointer user_data);
This is the signature of a user function added with gconf_client_notify_add().
The notify function is invoked when the value of a key changes. The value
argument is the new value, or NULL if the key was unset. The
value argument should not be modified, and should be copied if you want to keep
it around (the
|
the |
|
connection ID from gconf_client_notify_add().
|
|
a GConfEntry. |
|
user data from gconf_client_notify_add().
|
void (*GConfClientErrorHandlerFunc) (GConfClient *client,GError *error);
This is the signature of a user function which needs to be called for error handling.
|
a |
|
the return location for an allocated |
#define GCONF_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_CLIENT, GConfClient))
Casts a pointer to a
|
a |
GConfClient * gconf_client_get_default (void);
Creates a new
It's important to call g_type_init()
Returns : |
a new g_object_unref() |
GConfClient * gconf_client_get_for_engine (GConfEngine *engine);
Creates a new g_object_unref()
|
the GConfEngine to use. |
Returns : |
a new |
void gconf_client_add_dir (GConfClient *client, constgchar *dir, GConfClientPreloadType preload,GError **err);
Add a directory to the list of directories the
Added directories may not overlap. That is, if you add "/foo", you may not add
"/foo/bar". However you can add "/foo" and "/bar". You can also add "/foo"
multiple times; if you add a directory multiple times, it will not be removed
until you call gconf_client_remove_dir() an equal number of times.
|
a |
|
directory to add to the list. |
|
degree of preload. |
|
the return location for an allocated |
void gconf_client_remove_dir (GConfClient *client, constgchar *dir,GError **err);
Remove a directory from the list created with gconf_client_add_dir(). If any
notifications have been added below this directory with
gconf_client_notify_add(), those notifications will be disabled until you re-add
the removed directory. Note that if a directory has been added multiple times,
you must remove it the same number of times before the remove takes effect.
|
a |
|
directory to remove. |
|
the return location for an allocated |
guint gconf_client_notify_add (GConfClient *client, constgchar *namespace_section, GConfClientNotifyFunc func,gpointer user_data,GFreeFunc destroy_notify,GError **err);
Request notification of changes to namespace_section. This includes the key
namespace_section itself, and any keys below it (the behavior is identical to
gconf_engine_notify_add(), but while gconf_engine_notify_add() places a notification request
on the server for every notify function, gconf_client_add_dir() and keeps the
list of GConfClientNotifyFunc on the client side).
For the notification to happen, namespace_section must be equal to or below one
of the directories added with gconf_client_add_dir(). You can still call
gconf_client_notify_add() for other directories, but no notification will be
received until you add a directory above or equal to namespace_section. One
implication of this is that gconf_client_remove_dir() temporarily disables
notifications that were below the removed directory.
The function returns a connection ID you can use to call
gconf_client_notify_remove().
See the description of GConfClientNotifyFunc for details on how the notification function is called.
|
a |
|
where to listen for changes. |
|
function to call when changes occur. |
|
user data to pass to func.
|
|
function to call on user_data when the notify is removed or the |
|
the return location for an allocated |
Returns : |
a connection ID for removing the notification. |
void gconf_client_notify_remove (GConfClient *client,guint cnxn);
Remove a notification using the ID returned from
gconf_client_notify_add(). Invokes the destroy notify function on the
notification's user data, if appropriate.
|
a |
|
connection ID. |
void gconf_client_notify (GConfClient *client, constchar *key);
Emits the "value-changed" signal and notifies listeners as if key had been
changed
|
a |
|
the key that has changed. |
Since 2.4.
void gconf_client_set_error_handling (GConfClient *client, GConfClientErrorHandlingMode mode);
Controls the default error handling for
|
a |
|
error handling mode. |
void gconf_client_set_global_default_error_handler (GConfClientErrorHandlerFunc func);
Set func as the default error handler for the
|
pointer to the function to be called for error handling. |
void gconf_client_clear_cache (GConfClient *client);
Dumps everything out of the
|
a |
void gconf_client_preload (GConfClient *client, constgchar *dirname, GConfClientPreloadType type,GError **err);
Preloads a directory. Normally you do this when you call gconf_client_add_dir(),
but if you've called gconf_client_clear_cache() there may be a reason to do it
again.
|
a |
|
directory to preload. |
|
degree of preload. |
|
the return location for an allocated |
void gconf_client_set (GConfClient *client, constgchar *key, const GConfValue *val,GError **err);
Sets the value of a configuration key. Just like gconf_engine_set(), but uses
val argument will not be
modified.
|
a |
|
key to set. |
|
new value. |
|
the return location for an allocated |
GConfValue* gconf_client_get (GConfClient *client, constgchar *key,GError **err);
Gets the value of a configuration key. Just like gconf_engine_get(), but uses
|
a |
|
key to get. |
|
the return location for an allocated |
Returns : |
newly-allocated GConfValue, or NULL if unset and no default exists. |
GConfValue* gconf_client_get_without_default (GConfClient *client, constgchar *key,GError **err);
Gets the value of a configuration key. Just like gconf_client_get() but doesn't look for a default value if the key is unset.
|
a |
|
key to get. |
|
the return location for an allocated |
Returns : |
newly-allocated GConfValue, or NULL if unset (even if a default exists). |
GConfEntry* gconf_client_get_entry (GConfClient *client, constgchar *key, constgchar *locale,gboolean use_schema_default,GError **err);
Obtains the full GConfEntry for a value. Just like gconf_engine_get_entry(), but uses
|
a |
|
key to get. |
|
preferred locale (as in the locale-related environment variables). |
|
indicates whether to look for a default value when the key is unset. |
|
the return location for an allocated |
Returns : |
a GConfEntry. |
GConfValue* gconf_client_get_default_from_schema (GConfClient *client, constgchar *key,GError **err);
Returns the default value stored in the key's schema, if the key has a schema
associated and the schema exists and the schema contains a default value. Note
that gconf_client_get(), gconf_engine_client_string()gconf_engine_get_default_from_schema(), but uses
|
a |
|
key to get. |
|
the return location for an allocated |
Returns : |
newly-allocated GConfValue, or NULL if the key has no default value in its schema. |
gboolean gconf_client_unset (GConfClient *client, constgchar *key,GError **err);
Unsets the value of key; if key is already unset, has no effect. An
error of note is GCONF_OVERRIDDENgconf_engine_unset(), but uses
|
a |
|
key to unset. |
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_recursive_unset (GConfClient *client, constchar *key,GConfUnsetFlags flags,GError **err);
Unsets all keys below key, including key itself. If any unset fails, continues on to unset
as much as it can. The first failure is returned in err. Just like gconf_engine_recursive_unset()
|
a |
|
a key or directory name to be unset. |
|
change how the unset is done. |
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
Since 2.4.
GSList * gconf_client_all_entries (GConfClient *client, constgchar *dir,GError **err);
Lists the key-value pairs in dir. Does not list subdirectories; for
that use gconf_client_all_dirs(). The returned list contains GConfEntry
objects. A GConfEntry contains an absolute key
and a value. The list is not recursive, it contains only the immediate
children of dir. To free the returned list, gconf_entry_free()
each list element, then g_slist_free()gconf_engine_all_entries(), but uses
|
a |
|
directory to list. |
|
the return location for an allocated |
Returns : |
List of GConfEntry. |
GSList * gconf_client_all_dirs (GConfClient *client, constgchar *dir,GError **err);
Lists the subdirectories in dir. The returned list contains allocated
strings. Each string is the absolute path of a subdirectory. You should g_free()g_slist_free()gconf_engine_all_dirs(), but uses
|
a |
|
directory to get subdirectories from. |
|
the return location for an allocated |
Returns : |
List of allocated subdirectory names. |
void gconf_client_suggest_sync (GConfClient *client,GError **err);
Suggests to gconfd that you've just finished
a block of changes, and it would be an optimal time to sync to
permanent storage. This is only a suggestion; and
gconfd will eventually sync even if you
don't call gconf_engine_suggest_sync(). This function is just a "hint"
provided to gconfd to maximize efficiency
and minimize data loss.
Just like gconf_engine_suggest_sync().
|
a |
|
the return location for an allocated |
gboolean gconf_client_dir_exists (GConfClient *client, constgchar *dir,GError **err);
Queries whether the directory dir exists in the GConf
database. Returns TRUE or FALSE.
Just like gconf_engine_dir_exists(), but uses
|
a |
|
directory to check for |
|
the return location for an allocated |
Returns : |
TRUE or FALSE. |
gboolean gconf_client_key_is_writable (GConfClient *client, constgchar *key,GError **err);
Checks whether the key is writable.
|
a |
|
the value to be changed. |
|
the return location for an allocated |
Returns : |
TRUE if the key is writable, FALSE if the key is read only. |
gdouble gconf_client_get_float (GConfClient *client, constgchar *key,GError **err);
Requests the floating point number (GCONF_VALUE_FLOAT) stored at
key. Automatically performs type-checking, so if a non-float is
stored at key, an error is returned. On error, or if key is unset,
0.0 is returned.
Just like gconf_engine_get_float(), but uses
|
a |
|
key you want the value of. |
|
the return location for an allocated |
Returns : |
the value of key, or 0.0 if no value is obtained.
|
gint gconf_client_get_int (GConfClient *client, constgchar *key,GError **err);
Requests the integer (GCONF_VALUE_INT) stored at
key. Automatically performs type-checking, so if a non-integer is
stored at key, an error is returned. On error, or if key is unset,
0 is returned.
Just like gconf_engine_get_int(), but uses
|
a |
|
key you want the value of. |
|
the return location for an allocated |
Returns : |
the value of key, or 0 if no value is obtained.
|
gchar * gconf_client_get_string (GConfClient *client, constgchar *key,GError **err);
Requests the string (GCONF_VALUE_STRING) stored at
key. Automatically performs type-checking, so if a non-string is
stored at key, an error is returned. On error, or if key is unset,
NULL is returned.
Just like gconf_engine_get_string(), but uses
|
a |
|
key you want the value of. |
|
the return location for an allocated |
Returns : |
allocated string (value of key), or NULL if no value is obtained.
|
gboolean gconf_client_get_bool (GConfClient *client, constgchar *key,GError **err);
Requests the boolean value (GCONF_VALUE_BOOL) stored at
key. Automatically performs type-checking, so if a non-bool is
stored at key, an error is returned. On error, or if key is unset,
FALSE is returned.
Just like gconf_engine_get_bool(), but uses
|
a |
|
key you want the value of. |
|
the return location for an allocated |
Returns : |
the value of key, or FALSE if no value is obtained.
|
GConfSchema* gconf_client_get_schema (GConfClient *client, constgchar *key,GError **err);
Requests the schema (GCONF_VALUE_SCHEMA) stored at key.
Automatically performs type-checking, so if a non-schema is stored at
key, an error is returned. If no value is set or an error occurs,
NULL is returned.
Just like gconf_engine_get_schema(), but uses
|
a |
|
key you want the value of. |
|
the return location for an allocated |
Returns : |
the value of key as an allocated GConfSchema, or NULL if no value was obtained.
|
GSList * gconf_client_get_list (GConfClient *client, constgchar *key, GConfValueType list_type,GError **err);
Requests the list (GCONF_VALUE_LIST) stored at key. Automatically
performs type-checking, so if a non-list is stored at key, or the
list does not contain elements of type list_type, an error is
returned. If no value is set or an error occurs, NULL
is returned. Note that NULL is also the empty list,
so if you need to distinguish the empty list from an unset value, you
must use gconf_client_get() to obtain a raw GConfValue.
Remember that GConf lists can only store primitive types:
GCONF_VALUE_FLOAT, GCONF_VALUE_INT, GCONF_VALUE_BOOL,
GCONF_VALUE_STRING, GCONF_VALUE_SCHEMA. Also remember
that lists must be uniform, you may not mix types in the same list.
The type of the list elements depends on list_type. A GConfValue
with type GCONF_VALUE_LIST normally stores a list of more GConfValue
objects. gconf_client_get_list() automatically converts to primitive C
types. Thus, the list->data fields in the returned list
contain:
GCONF_VALUE_INT |
The integer itself, converted with GINT_TO_POINTER() |
GCONF_VALUE_BOOL |
The bool itself, converted with GINT_TO_POINTER() |
GCONF_VALUE_FLOAT |
A pointer to g_free() |
GCONF_VALUE_STRING |
A pointer to g_free() |
GCONF_VALUE_SCHEMA |
A pointer to GConfSchema, which should be freed with gconf_schema_free()
|
In the GCONF_VALUE_FLOAT and GCONF_VALUE_STRING cases, you must
g_free()GCONF_VALUE_SCHEMA case you must
gconf_schema_free() each element. In all cases you must free the
list itself with g_slist_free()gconf_engine_get_list(), but uses
|
a |
|
key you want the value of. |
|
type of each list element. |
|
the return location for an allocated |
Returns : |
an allocated list, with elements as described above. |
gboolean gconf_client_get_pair (GConfClient *client, constgchar *key, GConfValueType car_type, GConfValueType cdr_type,gpointer car_retloc,gpointer cdr_retloc,GError **err);
Requests the pair (GCONF_VALUE_PAIR) stored at key. Automatically
performs type-checking, so if a non-pair is stored at key, or the
pair does not have the right car_type and cdr_type, an error is
returned. Remember that the car of a pair is
its first value, and the cdr is its second
value, in the Lisp tradition.
Remember that GConf pairs can only store primitive types:
GCONF_VALUE_FLOAT, GCONF_VALUE_INT, GCONF_VALUE_BOOL,
GCONF_VALUE_STRING, GCONF_VALUE_SCHEMA.
gconf_client_get_pair() stores the two fields of the pair in the locations
pointed to by car_retloc and cdr_retloc. The type of these pointers
depends on the corresponding car_type and cdr_type:
GCONF_VALUE_INT |
pointer to |
GCONF_VALUE_BOOL |
pointer to |
GCONF_VALUE_FLOAT |
pointer to |
GCONF_VALUE_STRING |
pointer to |
GCONF_VALUE_SCHEMA |
pointer to GConfSchema* |
In the GCONF_VALUE_STRING case, you must g_free()GCONF_VALUE_SCHEMA case you
must gconf_schema_free() the returned schema. If there's an error
or the value is unset, car_retloc and cdr_retloc are left unchanged.
gconf_client_get_pair() returns TRUE on success.
An example of gconf_client_get_pair() in action:
gdouble car = 10.0;
gchar* cdr = NULL;
GError* error = NULL;
if (!gconf_client_get_pair(conf, "/foo",
GCONF_VALUE_FLOAT,
GCONF_VALUE_STRING,
&car, &cdr, &error))
{
/* Note: car/cdr should be untouched, because an error occurred */
g_assert(error != NULL);
fprintf(stderr, "Error: %s\n", error->message);
g_error_free(error);
error = NULL;
}
else
{
/* Note: car/cdr may be untouched even though there was no error,
if no value was set for "/foo"
*/
printf("Found pair (%g,%s)\n", car, cdr);
if (cdr != NULL)
g_free(cdr);
}
|
a |
|
key you want the value of. |
|
desired type of the pair's first field (car). |
|
desired type of the pair's second field (cdr). |
|
address of a return location for the car. |
|
address of a return location for the cdr. |
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_float (GConfClient *client, constgchar *key,gdouble val,GError **err);
Change the value of key to val. Automatically creates the key if it didn't exist before (ie it was unset or it only had a default value). If the key already exists but doesn't store a float (GCONF_VALUE_FLOAT), gconf_client_set_float() will fail.
Just like gconf_engine_set(), but uses
|
a |
|
key you want to set the value of. |
|
new value of key.
|
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_int (GConfClient *client, constgchar *key,gint val,GError **err);
Change the value of key to val. Automatically creates the key if it didn't exist before (ie it was unset or it only had a default value). If the key already exists but doesn't store an integer (GCONF_VALUE_INT), gconf_client_set_int() will fail.
Just like gconf_engine_set(), but uses
|
a |
|
key you want to set the value of. |
|
new value of key.
|
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_string (GConfClient *client, constgchar *key, constgchar *val,GError **err);
Change the value of key to val. Automatically creates the key if it didn't exist before (ie it was unset or it only had a default value). If the key already exists but doesn't store a string (GCONF_VALUE_STRING), gconf_client_set_string() will fail.
Just like gconf_engine_set(), but uses
|
a |
|
key you want to set the value of. |
|
new value of key.
|
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_bool (GConfClient *client, constgchar *key,gboolean val,GError **err);
Change the value of key to val. Automatically creates the key if it didn't exist before (ie it was unset or it only had a default value). If the key already exists but but doesn't store a boolean (GCONF_VALUE_BOOL), gconf_client_set_bool() will fail.
Just like gconf_engine_set(), but uses
|
a |
|
key you want to set the value of. |
|
new value of key.
|
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_schema (GConfClient *client, constgchar *key, const GConfSchema *val,GError **err);
Change the value of key to val. Automatically creates the key if it didn't exist before (ie it was unset or it only had a default value). If the key already exists but doesn't store a schema value (GCONF_VALUE_SCHEMA), gconf_client_set_schema() will fail.
Just like gconf_engine_set(), but uses
|
a |
|
key you want to set the value of. |
|
new value of key.
|
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_list (GConfClient *client, constgchar *key, GConfValueType list_type,GSList *list,GError **err);
Changes the value of key to a list of type list_type. Automatically creates the key if it didn't exist before
(ie it was unset or it had a default value). If the key already exists but doesn't store a list value
(GCONF_VALUE_LIST), gconf_client_set_list() will fail.
|
a |
|
key you want to set the value of. |
|
type of each list element. |
|
new value of key.
|
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
gboolean gconf_client_set_pair (GConfClient *client, constgchar *key, GConfValueType car_type, GConfValueType cdr_type,gconstpointer address_of_car,gconstpointer address_of_cdr,GError **err);
Changes the value of key to a pair with the first field of type car_type and the second field of type cdr_type.
Automatically creates the key if it didn't exist before (ie it was unset or it had a default value). If the key
already exists but doesn't store a pair value (GCONF_VALUE_PAIR), gconf_client_set_pair() will fail.
|
a |
|
key you want to set the value of. |
|
type of the pair's first field (car). |
|
type of the pair's second field (cdr). |
|
address of the car. |
|
address of the cdr. |
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE on error. |
void gconf_client_error (GConfClient *client,GError *error);
Emits the "error" signal. Rarely useful.
|
a |
|
error to pass to signal handlers. |
void gconf_client_unreturned_error (GConfClient *client,GError *error);
Emits the "unreturned_error" signal. Rarely useful.
|
a |
|
error to pass to signal handlers. |
void gconf_client_value_changed (GConfClient *client, constgchar *key, GConfValue *value);
Emits the "value_changed" signal. Rarely useful.
|
a |
|
key to pass to signal handlers. |
|
value of key to pass to signal handlers.
|
gboolean gconf_client_commit_change_set (GConfClient *client, GConfChangeSet *cs,gboolean remove_committed,GError **err);
Applies the changes in the change set to the remove_committed is TRUE,
then any successfully-committed changes are removed from the change
set. If remove_committed is FALSE, the
GConfChangeSet is left unmodified.
If any set or unset operation results in an error, then processing
terminates and the error is returned in err (unless err was
NULL). If remove_committed was
TRUE, then all the changes committed before the error
occurred will have been removed from the set. If any error occurs,
FALSE is returned.
|
a |
|
a GConfChangeSet. |
|
whether to remove successfully-committed changes from the set. |
|
the return location for an allocated |
Returns : |
TRUE on success, FALSE if an error occurs. |
GConfChangeSet* gconf_client_reverse_change_set (GConfClient *client, GConfChangeSet *cs,GError **err);
Creates a change set that would reverse cs. That is, for each change in cs,
save the current state of that key in the returned change set.
|
a |
|
change set to create the reverse of. |
|
the return location for an allocated |
Returns : |
a new change set that would restore the current state of each key in cs.
|
GConfChangeSet* gconf_client_change_set_from_currentv (GConfClient *client, constgchar **keys,GError **err);
Creates a change set that will change the keys in
NULL-terminated array keys to their current state. Use this to
save the current state of a collection of keys; then you can later revert to the
current state by committing the returned change set.
|
a |
|
NULL-terminated array of key names. |
|
the return location for an allocated |
Returns : |
new change set that changes all the keys to their current state.
|
GConfChangeSet* gconf_client_change_set_from_current (GConfClient *client,GError **err, constgchar *first_key, ...);
Convenient varargs version of gconf_client_change_set_from_currentv().
|
a |
|
the return location for an allocated |
|
first key to save the current state of. |
|
NULL-terminated list of additional keys. |
Returns : |
new change set that changes all the keys to their current state. |
[1] This is all a white lie; some direct GConfEngine operations are safe. But it's complicated to know which, and if an operation isn't safe the resulting bugs will mangle the cache and cause weird bugs at an indeterminate time in the future; you don't want to risk this situation.