GConf Misc

GConf Misc — The GConf Library Utilities

Synopsis

#include <runtime/na-gconf-utils.h>

GSList *            na_gconf_utils_get_subdirs          (GConfClient *gconf,
                                                         const gchar *path);
void                na_gconf_utils_free_subdirs         (GSList *subdirs);
gboolean            na_gconf_utils_has_entry            (GSList *entries,
                                                         const gchar *entry);
GSList *            na_gconf_utils_get_entries          (GConfClient *gconf,
                                                         const gchar *path);
gboolean            na_gconf_utils_get_bool_from_entries
                                                        (GSList *entries,
                                                         const gchar *entry,
                                                         gboolean *value);
gboolean            na_gconf_utils_get_string_from_entries
                                                        (GSList *entries,
                                                         const gchar *entry,
                                                         gchar **value);
gboolean            na_gconf_utils_get_string_list_from_entries
                                                        (GSList *entries,
                                                         const gchar *entry,
                                                         GSList **value);
void                na_gconf_utils_dump_entries         (GSList *entries);
void                na_gconf_utils_free_entries         (GSList *entries);
gboolean            na_gconf_utils_read_bool            (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean use_schema,
                                                         gboolean default_value);
gint                na_gconf_utils_read_int             (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean use_schema,
                                                         gint default_value);
gchar *             na_gconf_utils_read_string          (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean use_schema,
                                                         const gchar *default_value);
GSList *            na_gconf_utils_read_string_list     (GConfClient *gconf,
                                                         const gchar *path);
gboolean            na_gconf_utils_write_bool           (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean value,
                                                         gchar **message);
gboolean            na_gconf_utils_write_int            (GConfClient *gconf,
                                                         const gchar *path,
                                                         gint value,
                                                         gchar **message);
gboolean            na_gconf_utils_write_string         (GConfClient *gconf,
                                                         const gchar *path,
                                                         const gchar *value,
                                                         gchar **message);
gboolean            na_gconf_utils_write_string_list    (GConfClient *gconf,
                                                         const gchar *path,
                                                         GSList *value,
                                                         gchar **message);
gboolean            na_gconf_utils_remove_entry         (GConfClient *gconf,
                                                         const gchar *path,
                                                         gchar **message);
GSList *            na_gconf_utils_slist_from_string    (const gchar *value);
gchar *             na_gconf_utils_slist_to_string      (GSList *slist);

Description

Starting with Nautilus-Actions 3.1.0, GConf, whether it is used as a preference storage subsystem or as an I/O provider, is deprecated.

Details

na_gconf_utils_get_subdirs ()

GSList *            na_gconf_utils_get_subdirs          (GConfClient *gconf,
                                                         const gchar *path);

gconf :

a GConfClient instance.

path :

a full path to be read.

Returns :

a list of full path subdirectories. The returned list should be na_gconf_utils_free_subdirs() by the caller.

Since 2.30


na_gconf_utils_free_subdirs ()

void                na_gconf_utils_free_subdirs         (GSList *subdirs);

Release the list.

subdirs :

the subdirectory list as returned from na_gconf_utils_get_subdirs().

Since 2.30


na_gconf_utils_has_entry ()

gboolean            na_gconf_utils_has_entry            (GSList *entries,
                                                         const gchar *entry);

entries :

the list of entries as returned by na_gconf_utils_get_entries().

entry :

the entry to be tested.

Returns :

TRUE if the given entry exists in the specified entries, FALSE else.

Since 2.30


na_gconf_utils_get_entries ()

GSList *            na_gconf_utils_get_entries          (GConfClient *gconf,
                                                         const gchar *path);

Loads all the key=value pairs of the specified key.

gconf :

a GConfClient instance.

path :

a full path to be read.

Returns :

a list of GConfEntry. The returned list is not recursive : it contains only the immediate children of path. To free the returned list, call na_gconf_utils_free_entries().

Since 2.30


na_gconf_utils_get_bool_from_entries ()

gboolean            na_gconf_utils_get_bool_from_entries
                                                        (GSList *entries,
                                                         const gchar *entry,
                                                         gboolean *value);

entries :

a list of GConfEntry as returned by na_gconf_utils_get_entries().

entry :

the searched entry.

value :

a pointer to a gboolean to be set to the found value.

Returns :

TRUE if the entry was found, FALSE else. If the entry was not found, or was not of boolean type, value is set to FALSE.

Since 2.30


na_gconf_utils_get_string_from_entries ()

gboolean            na_gconf_utils_get_string_from_entries
                                                        (GSList *entries,
                                                         const gchar *entry,
                                                         gchar **value);

entries :

a list of GConfEntry as returned by na_gconf_utils_get_entries().

entry :

the searched entry.

value :

a pointer to a gchar * to be set to the found value.

Returns :

TRUE if the entry was found, FALSE else. If the entry was not found, or was not of string type, value is set to NULL. If value is returned not NULL, it should be g_free() by the caller.

Since 2.30


na_gconf_utils_get_string_list_from_entries ()

gboolean            na_gconf_utils_get_string_list_from_entries
                                                        (GSList *entries,
                                                         const gchar *entry,
                                                         GSList **value);

entries :

a list of GConfEntry as returned by na_gconf_utils_get_entries().

entry :

the searched entry.

value :

a pointer to a GSList * to be set to the found value.

Returns :

TRUE if the entry was found, FALSE else. If the entry was not found, or was not of string list type, value is set to NULL. If value is returned not NULL, it should be na_core_utils_slist_free() by the caller.

Since 2.30


na_gconf_utils_dump_entries ()

void                na_gconf_utils_dump_entries         (GSList *entries);

Dumps the content of the entries.

entries :

a list of GConfEntry as returned by na_gconf_utils_get_entries().

Since 2.30


na_gconf_utils_free_entries ()

void                na_gconf_utils_free_entries         (GSList *entries);

Releases the provided list.

entries :

a list of GConfEntry as returned by na_gconf_utils_get_entries().

Since 2.30


na_gconf_utils_read_bool ()

gboolean            na_gconf_utils_read_bool            (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean use_schema,
                                                         gboolean default_value);

gconf :

a GConfClient instance.

path :

the full path to the key.

use_schema :

whether to use the default value from schema, or not.

default_value :

default value to be used if schema is not used or doesn't exist.

Returns :

the required boolean value.

Since 2.30


na_gconf_utils_read_int ()

gint                na_gconf_utils_read_int             (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean use_schema,
                                                         gint default_value);

gconf :

a GConfClient instance.

path :

the full path to the key.

use_schema :

whether to use the default value from schema, or not.

default_value :

default value to be used if schema is not used or doesn't exist.

Returns :

the required integer value.

Since 2.30


na_gconf_utils_read_string ()

gchar *             na_gconf_utils_read_string          (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean use_schema,
                                                         const gchar *default_value);

gconf :

a GConfClient instance.

path :

the full path to the key.

use_schema :

whether to use the default value from schema, or not.

default_value :

default value to be used if schema is not used or doesn't exist.

Returns :

the required string value in a newly allocated string which should be g_free() by the caller.

Since 2.30


na_gconf_utils_read_string_list ()

GSList *            na_gconf_utils_read_string_list     (GConfClient *gconf,
                                                         const gchar *path);

gconf :

a GConfClient instance.

path :

the full path to the key to be read.

Returns :

a list of strings, or NULL if the entry was not found or was not of string list type. The returned list must be released with na_core_utils_slist_free().

Since 2.30


na_gconf_utils_write_bool ()

gboolean            na_gconf_utils_write_bool           (GConfClient *gconf,
                                                         const gchar *path,
                                                         gboolean value,
                                                         gchar **message);

Warning

na_gconf_utils_write_bool is deprecated and should not be used in newly-written code. 3.1

Writes a boolean at the given path.

gconf :

a GConfClient instance.

path :

the full path to the key.

value :

the value to be written.

message :

a pointer to a gchar * which will be allocated if needed.

Returns :

TRUE if the writing has been successful, FALSE else. If returned not NULL, the message contains an error message. It should be g_free() by the caller.

Since 2.30


na_gconf_utils_write_int ()

gboolean            na_gconf_utils_write_int            (GConfClient *gconf,
                                                         const gchar *path,
                                                         gint value,
                                                         gchar **message);

Warning

na_gconf_utils_write_int is deprecated and should not be used in newly-written code. 3.1

Writes an integer at the given path.

gconf :

a GConfClient instance.

path :

the full path to the key.

value :

the value to be written.

message :

a pointer to a gchar * which will be allocated if needed.

Returns :

TRUE if the writing has been successful, FALSE else. If returned not NULL, the message contains an error message. It should be g_free() by the caller.

Since 2.30


na_gconf_utils_write_string ()

gboolean            na_gconf_utils_write_string         (GConfClient *gconf,
                                                         const gchar *path,
                                                         const gchar *value,
                                                         gchar **message);

Warning

na_gconf_utils_write_string is deprecated and should not be used in newly-written code. 3.1

Writes a string at the given path.

gconf :

a GConfClient instance.

path :

the full path to the key.

value :

the value to be written.

message :

a pointer to a gchar * which will be allocated if needed.

Returns :

TRUE if the writing has been successful, FALSE else. If returned not NULL, the message contains an error message. It should be g_free() by the caller.

Since 2.30


na_gconf_utils_write_string_list ()

gboolean            na_gconf_utils_write_string_list    (GConfClient *gconf,
                                                         const gchar *path,
                                                         GSList *value,
                                                         gchar **message);

Warning

na_gconf_utils_write_string_list is deprecated and should not be used in newly-written code. 3.1

Writes a list of strings at the given path.

gconf :

a GConfClient instance.

path :

the full path to the key.

value :

the list of values to be written.

message :

a pointer to a gchar * which will be allocated if needed.

Returns :

TRUE if the writing has been successful, FALSE else. If returned not NULL, the message contains an error message. It should be g_free() by the caller.

Since 2.30


na_gconf_utils_remove_entry ()

gboolean            na_gconf_utils_remove_entry         (GConfClient *gconf,
                                                         const gchar *path,
                                                         gchar **message);

Warning

na_gconf_utils_remove_entry is deprecated and should not be used in newly-written code. 3.1

Removes an entry from user preferences.

gconf :

a GConfClient instance.

path :

the full path to the entry.

message :

a pointer to a gchar * which will be allocated if needed.

Returns :

TRUE if the operation was successful, FALSE else.

Since 2.30


na_gconf_utils_slist_from_string ()

GSList *            na_gconf_utils_slist_from_string    (const gchar *value);

Warning

na_gconf_utils_slist_from_string is deprecated and should not be used in newly-written code. 3.1

Converts a string representing a list of strings in a GConf format to a list of strings.

value :

a string of the form [xxx,yyy,...] as read from GConf.

Returns :

a newly allocated list of strings, which should be na_core_utils_slist_free() by the caller, or NULL if the provided string was not of the GConf form.

Since 2.30


na_gconf_utils_slist_to_string ()

gchar *             na_gconf_utils_slist_to_string      (GSList *slist);

Warning

na_gconf_utils_slist_to_string is deprecated and should not be used in newly-written code. 3.1

slist :

a GSList to be displayed.

Returns :

the content of slist, with the GConf format, as a newly allocated string which should be g_free() by the caller.

Since 2.30