|  |  |  | Caja-Actions™ Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
#include <runtime/na-mateconf-utils.h> GSList * na_mateconf_utils_get_subdirs (MateConfClient *mateconf,const gchar *path); void na_mateconf_utils_free_subdirs (GSList *subdirs); gboolean na_mateconf_utils_has_entry (GSList *entries,const gchar *entry); GSList * na_mateconf_utils_get_entries (MateConfClient *mateconf,const gchar *path); gboolean na_mateconf_utils_get_bool_from_entries (GSList *entries,const gchar *entry,gboolean *value); gboolean na_mateconf_utils_get_string_from_entries (GSList *entries,const gchar *entry,gchar **value); gboolean na_mateconf_utils_get_string_list_from_entries (GSList *entries,const gchar *entry,GSList **value); void na_mateconf_utils_dump_entries (GSList *entries); void na_mateconf_utils_free_entries (GSList *entries); gboolean na_mateconf_utils_read_bool (MateConfClient *mateconf,const gchar *path,gboolean use_schema,gboolean default_value); gint na_mateconf_utils_read_int (MateConfClient *mateconf,const gchar *path,gboolean use_schema,gint default_value); gchar * na_mateconf_utils_read_string (MateConfClient *mateconf,const gchar *path,gboolean use_schema,const gchar *default_value); GSList * na_mateconf_utils_read_string_list (MateConfClient *mateconf,const gchar *path); gboolean na_mateconf_utils_write_bool (MateConfClient *mateconf,const gchar *path,gboolean value,gchar **message); gboolean na_mateconf_utils_write_int (MateConfClient *mateconf,const gchar *path,gint value,gchar **message); gboolean na_mateconf_utils_write_string (MateConfClient *mateconf,const gchar *path,const gchar *value,gchar **message); gboolean na_mateconf_utils_write_string_list (MateConfClient *mateconf,const gchar *path,GSList *value,gchar **message); gboolean na_mateconf_utils_remove_entry (MateConfClient *mateconf,const gchar *path,gchar **message); GSList * na_mateconf_utils_slist_from_string (const gchar *value); gchar * na_mateconf_utils_slist_to_string (GSList *slist);
Starting with Caja-Actions 3.1.0, MateConf, whether it is used as a preference storage subsystem or as an I/O provider, is deprecated.
GSList * na_mateconf_utils_get_subdirs (MateConfClient *mateconf,const gchar *path);
| 
 | a MateConfClient instance. | 
| 
 | a full path to be read. | 
| Returns : | a list of full path subdirectories.
The returned list should be na_mateconf_utils_free_subdirs()by the caller. | 
Since 2.30
void                na_mateconf_utils_free_subdirs         (GSList *subdirs);
Release the list.
| 
 | the subdirectory list as returned from na_mateconf_utils_get_subdirs(). | 
Since 2.30
gboolean na_mateconf_utils_has_entry (GSList *entries,const gchar *entry);
| 
 | the list of entries as returned by na_mateconf_utils_get_entries(). | 
| 
 | the entry to be tested. | 
| Returns : | TRUEif the givenentryexists in the specifiedentries,FALSEelse. | 
Since 2.30
GSList * na_mateconf_utils_get_entries (MateConfClient *mateconf,const gchar *path);
Loads all the key=value pairs of the specified key.
| 
 | a MateConfClient instance. | 
| 
 | a full path to be read. | 
| Returns : | a list of MateConfEntry.
The returned list is not recursive : it contains only the immediate
children of path. To free the returned list, callna_mateconf_utils_free_entries(). | 
Since 2.30
gboolean na_mateconf_utils_get_bool_from_entries (GSList *entries,const gchar *entry,gboolean *value);
| 
 | a list of MateConfEntry as returned by na_mateconf_utils_get_entries(). | 
| 
 | the searched entry. | 
| 
 | a pointer to a gboolean to be set to the found value. | 
| Returns : | TRUEif the entry was found,FALSEelse.
If the entry was not found, or was not of boolean type,valueis set
toFALSE. | 
Since 2.30
gboolean na_mateconf_utils_get_string_from_entries (GSList *entries,const gchar *entry,gchar **value);
| 
 | a list of MateConfEntry as returned by na_mateconf_utils_get_entries(). | 
| 
 | the searched entry. | 
| 
 | a pointer to a gchar * to be set to the found value. | 
| Returns : | TRUEif the entry was found,FALSEelse.
If the entry was not found, or was not of string type,valueis set
toNULL.
Ifvalueis returned not NULL, it should beg_free()by the caller. | 
Since 2.30
gboolean na_mateconf_utils_get_string_list_from_entries (GSList *entries,const gchar *entry,GSList **value);
| 
 | a list of MateConfEntry as returned by na_mateconf_utils_get_entries(). | 
| 
 | the searched entry. | 
| 
 | a pointer to a GSList * to be set to the found value. | 
| Returns : | TRUEif the entry was found,FALSEelse.
If the entry was not found, or was not of string list type,valueis set toNULL.
Ifvalueis returned not NULL, it should bena_core_utils_slist_free()by the caller. | 
Since 2.30
void                na_mateconf_utils_dump_entries         (GSList *entries);
Dumps the content of the entries.
| 
 | a list of MateConfEntry as returned by na_mateconf_utils_get_entries(). | 
Since 2.30
void                na_mateconf_utils_free_entries         (GSList *entries);
Releases the provided list.
| 
 | a list of MateConfEntry as returned by na_mateconf_utils_get_entries(). | 
Since 2.30
gboolean na_mateconf_utils_read_bool (MateConfClient *mateconf,const gchar *path,gboolean use_schema,gboolean default_value);
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | whether to use the default value from schema, or not. | 
| 
 | default value to be used if schema is not used or doesn't exist. | 
| Returns : | the required boolean value. | 
Since 2.30
gint na_mateconf_utils_read_int (MateConfClient *mateconf,const gchar *path,gboolean use_schema,gint default_value);
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | whether to use the default value from schema, or not. | 
| 
 | default value to be used if schema is not used or doesn't exist. | 
| Returns : | the required integer value. | 
Since 2.30
gchar * na_mateconf_utils_read_string (MateConfClient *mateconf,const gchar *path,gboolean use_schema,const gchar *default_value);
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | whether to use the default value from schema, or not. | 
| 
 | 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
GSList * na_mateconf_utils_read_string_list (MateConfClient *mateconf,const gchar *path);
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key to be read. | 
| Returns : | a list of strings,
or NULLif the entry was not found or was not of string list type.
The returned list must be released withna_core_utils_slist_free(). | 
Since 2.30
gboolean na_mateconf_utils_write_bool (MateConfClient *mateconf,const gchar *path,gboolean value,gchar **message);
na_mateconf_utils_write_bool is deprecated and should not be used in newly-written code. 3.1
Writes a boolean at the given path.
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | the value to be written. | 
| 
 | a pointer to a gchar * which will be allocated if needed. | 
| Returns : | TRUEif the writing has been successful,FALSEelse.
If returned not NULL, themessagecontains an error message.
It should beg_free()by the caller. | 
Since 2.30
gboolean na_mateconf_utils_write_int (MateConfClient *mateconf,const gchar *path,gint value,gchar **message);
na_mateconf_utils_write_int is deprecated and should not be used in newly-written code. 3.1
Writes an integer at the given path.
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | the value to be written. | 
| 
 | a pointer to a gchar * which will be allocated if needed. | 
| Returns : | TRUEif the writing has been successful,FALSEelse.
If returned not NULL, themessagecontains an error message.
It should beg_free()by the caller. | 
Since 2.30
gboolean na_mateconf_utils_write_string (MateConfClient *mateconf,const gchar *path,const gchar *value,gchar **message);
na_mateconf_utils_write_string is deprecated and should not be used in newly-written code. 3.1
Writes a string at the given path.
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | the value to be written. | 
| 
 | a pointer to a gchar * which will be allocated if needed. | 
| Returns : | TRUEif the writing has been successful,FALSEelse.
If returned not NULL, themessagecontains an error message.
It should beg_free()by the caller. | 
Since 2.30
gboolean na_mateconf_utils_write_string_list (MateConfClient *mateconf,const gchar *path,GSList *value,gchar **message);
na_mateconf_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.
| 
 | a MateConfClient instance. | 
| 
 | the full path to the key. | 
| 
 | the list of values to be written. | 
| 
 | a pointer to a gchar * which will be allocated if needed. | 
| Returns : | TRUEif the writing has been successful,FALSEelse.
If returned not NULL, themessagecontains an error message.
It should beg_free()by the caller. | 
Since 2.30
gboolean na_mateconf_utils_remove_entry (MateConfClient *mateconf,const gchar *path,gchar **message);
na_mateconf_utils_remove_entry is deprecated and should not be used in newly-written code. 3.1
Removes an entry from user preferences.
| 
 | a MateConfClient instance. | 
| 
 | the full path to the entry. | 
| 
 | a pointer to a gchar * which will be allocated if needed. | 
| Returns : | TRUEif the operation was successful,FALSEelse. | 
Since 2.30
GSList *            na_mateconf_utils_slist_from_string    (const gchar *value);
na_mateconf_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 MateConf format to a list of strings.
| 
 | a string of the form [xxx,yyy,...] as read from MateConf. | 
| Returns : | a newly allocated list of strings, which should be na_core_utils_slist_free()by the caller, orNULLif the provided
string was not of the MateConf form. | 
Since 2.30
gchar *             na_mateconf_utils_slist_to_string      (GSList *slist);
na_mateconf_utils_slist_to_string is deprecated and should not be used in newly-written code. 3.1
| 
 | a GSList to be displayed. | 
| Returns : | the content of slist, with the MateConf format, as a newly
allocated string which should beg_free()by the caller. | 
Since 2.30