summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>1999-12-21 00:47:32 +0000
committerHavoc Pennington <hp@src.gnome.org>1999-12-21 00:47:32 +0000
commite962b75645f21b0ddc94a8e2ffbf82e91dcb89af (patch)
treecafee9c237669d2191741b0ae15f30965974c4d9
parentdffadadc3bb6e5ea134214b3a0ae22423be47d7c (diff)
downloadgconf-e962b75645f21b0ddc94a8e2ffbf82e91dcb89af.tar.gz
const correctness
1999-12-20 Havoc Pennington <hp@redhat.com> * gconf/gconf-sources.c (gconf_sources_new_from_addresses): const correctness * gconf/gconfd.c: Massive const-correctness changes to match latest ORBit * gconf/gconf.c (notify): "in string" seems to be const again now. * wrappers/gtk/gconf-client.c (cache_pairs_in_dir): store the is_default parameter when preloading * gconf/gconf.c (gconf_all_entries): receive the is_default parameter * gconf/gconfd.c (gconfd_all_entries): pass the is_default parameter over the CORBA link * backends/xml-backend.c (listify_foreach): Add the schema name to the entry if appropriate (if value is unset) * gconf/gconf-sources.c (gconf_sources_all_entries): Change to match new semantics of all_entries in the backend; get all entries that have a schema set on them, and the corresponding default value if appropriate. * gconf/gconf-value.c (gconf_entry_set_is_default): new function (gconf_entry_set_schema_name): new function * backends/xml-backend.c (listify_foreach): Include keys that exist but have no value set in the list of returned entries.
-rw-r--r--ChangeLog33
-rw-r--r--backends/xml-backend.c17
-rw-r--r--gconf/GConf.idl4
-rw-r--r--gconf/GConfX.idl4
-rw-r--r--gconf/gconf-client.c5
-rw-r--r--gconf/gconf-sources.c62
-rw-r--r--gconf/gconf-sources.h2
-rw-r--r--gconf/gconf-value.c33
-rw-r--r--gconf/gconf-value.h19
-rw-r--r--gconf/gconf.c16
-rw-r--r--gconf/gconfd.c109
-rw-r--r--wrappers/gtk/gconf-client.c5
12 files changed, 224 insertions, 85 deletions
diff --git a/ChangeLog b/ChangeLog
index 7531f4f5..77c968ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,38 @@
1999-12-20 Havoc Pennington <hp@redhat.com>
+ * gconf/gconf-sources.c (gconf_sources_new_from_addresses): const
+ correctness
+
+ * gconf/gconfd.c: Massive const-correctness changes to match
+ latest ORBit
+
+ * gconf/gconf.c (notify): "in string" seems to be const again now.
+
+ * wrappers/gtk/gconf-client.c (cache_pairs_in_dir): store the
+ is_default parameter when preloading
+
+ * gconf/gconf.c (gconf_all_entries): receive the is_default
+ parameter
+
+ * gconf/gconfd.c (gconfd_all_entries): pass the is_default
+ parameter over the CORBA link
+
+ * backends/xml-backend.c (listify_foreach): Add the schema name to
+ the entry if appropriate (if value is unset)
+
+ * gconf/gconf-sources.c (gconf_sources_all_entries): Change to
+ match new semantics of all_entries in the backend; get all entries
+ that have a schema set on them, and the corresponding default
+ value if appropriate.
+
+ * gconf/gconf-value.c (gconf_entry_set_is_default): new function
+ (gconf_entry_set_schema_name): new function
+
+ * backends/xml-backend.c (listify_foreach): Include keys that
+ exist but have no value set in the list of returned entries.
+
+1999-12-20 Havoc Pennington <hp@redhat.com>
+
* tests/testlisteners.c: fix include
* wrappers/gtk/gconf-client.c (gconf_client_preload): Actually
diff --git a/backends/xml-backend.c b/backends/xml-backend.c
index 763124ca..9a1d3231 100644
--- a/backends/xml-backend.c
+++ b/backends/xml-backend.c
@@ -1708,13 +1708,20 @@ static void
listify_foreach(const gchar* key, Entry* e, ListifyData* ld)
{
GConfValue* val;
-
+ GConfEntry* entry;
+
val = entry_value(e, ld->locales);
+
+ entry = gconf_entry_new_nocopy(g_strdup(key),
+ val ? gconf_value_copy(val) : NULL);
- if (val != NULL)
- ld->list = g_slist_prepend(ld->list,
- gconf_entry_new_nocopy(g_strdup(key),
- gconf_value_copy(val)));
+ if (val == NULL &&
+ e->schema_name)
+ {
+ gconf_entry_set_schema_name(entry, e->schema_name);
+ }
+
+ ld->list = g_slist_prepend(ld->list, entry);
}
static GSList*
diff --git a/gconf/GConf.idl b/gconf/GConf.idl
index 8ca2eae2..5936501e 100644
--- a/gconf/GConf.idl
+++ b/gconf/GConf.idl
@@ -85,6 +85,7 @@ exception ConfigException {
interface ConfigServer {
typedef sequence<string> KeyList;
typedef sequence<ConfigValue> ValueList;
+ typedef sequence<boolean> IsDefaultList;
typedef unsigned long Context;
const Context invalid_context = 0;
@@ -135,7 +136,8 @@ interface ConfigServer {
in string dir,
in string locale,
out KeyList keys,
- out ValueList values)
+ out ValueList values,
+ out IsDefaultList is_defaults)
raises (ConfigException);
void all_dirs(in Context ctx,
diff --git a/gconf/GConfX.idl b/gconf/GConfX.idl
index 8ca2eae2..5936501e 100644
--- a/gconf/GConfX.idl
+++ b/gconf/GConfX.idl
@@ -85,6 +85,7 @@ exception ConfigException {
interface ConfigServer {
typedef sequence<string> KeyList;
typedef sequence<ConfigValue> ValueList;
+ typedef sequence<boolean> IsDefaultList;
typedef unsigned long Context;
const Context invalid_context = 0;
@@ -135,7 +136,8 @@ interface ConfigServer {
in string dir,
in string locale,
out KeyList keys,
- out ValueList values)
+ out ValueList values,
+ out IsDefaultList is_defaults)
raises (ConfigException);
void all_dirs(in Context ctx,
diff --git a/gconf/gconf-client.c b/gconf/gconf-client.c
index 300dcca8..a972731f 100644
--- a/gconf/gconf-client.c
+++ b/gconf/gconf-client.c
@@ -615,11 +615,10 @@ cache_pairs_in_dir(GConfClient* client, const gchar* dir)
gconf_client_cache(client,
full_key,
- /* It can't be the default, all_entries() only
- returns values that are actually set */
- FALSE,
+ gconf_entry_is_default(pair),
gconf_entry_steal_value(pair));
+ g_free(full_key);
gconf_entry_destroy(pair);
diff --git a/gconf/gconf-sources.c b/gconf/gconf-sources.c
index ddf03f57..e9f90c14 100644
--- a/gconf/gconf-sources.c
+++ b/gconf/gconf-sources.c
@@ -298,7 +298,7 @@ gconf_source_sync_all (GConfSource* source, GConfError** err)
*/
GConfSources*
-gconf_sources_new_from_addresses(gchar** addresses, GConfError** err)
+gconf_sources_new_from_addresses(const gchar** addresses, GConfError** err)
{
GConfSources* sources;
GConfError* all_errors = NULL;
@@ -729,6 +729,43 @@ hash_destroy_pointers_func(gpointer key, gpointer value, gpointer user_data)
g_free(value);
}
+struct DefaultsLookupData {
+ GConfSources* sources;
+ const gchar** locales;
+};
+
+static void
+hash_lookup_defaults_func(gpointer key, gpointer value, gpointer user_data)
+{
+ GConfEntry *entry = value;
+ struct DefaultsLookupData* dld = user_data;
+ GConfSources *sources = dld->sources;
+ const gchar** locales = dld->locales;
+
+ if (gconf_entry_value(entry) == NULL)
+ {
+ if (gconf_entry_schema_name(entry) != NULL)
+ {
+ GConfValue *val;
+
+
+ val = gconf_sources_query_value(sources,
+ gconf_entry_schema_name(entry),
+ locales,
+ TRUE,
+ NULL,
+ NULL);
+
+ if (val != NULL)
+ {
+ gconf_entry_set_value_nocopy(entry, val);
+ gconf_entry_set_is_default(entry, TRUE);
+ }
+ }
+ }
+}
+
+
GSList*
gconf_sources_all_entries (GConfSources* sources,
const gchar* dir,
@@ -741,20 +778,12 @@ gconf_sources_all_entries (GConfSources* sources,
gboolean first_pass = TRUE; /* as an optimization, don't bother
doing hash lookups on first source
*/
-
+ struct DefaultsLookupData dld = { sources, locales };
+
/* Empty GConfSources, skip it */
if (sources->sources == NULL)
return NULL;
- /* Only one GConfSource, just return its list of entries */
- if (sources->sources->next == NULL)
- {
- return gconf_source_all_entries(sources->sources->data, dir, locales, err);
- }
-
- /* 2 or more sources in the list, use a hash to merge them */
- g_assert(g_list_length(sources->sources) > 1);
-
hash = g_hash_table_new(g_str_hash, g_str_equal);
tmp = sources->sources;
@@ -805,7 +834,14 @@ gconf_sources_all_entries (GConfSources* sources,
if (previous != NULL)
{
- /* Discard */
+ if (gconf_entry_value(previous) != NULL)
+ /* Discard this latest one */
+ ;
+ else
+ /* Save the new value, previously we had an entry but no value */
+ gconf_entry_set_value_nocopy(previous,
+ gconf_entry_steal_value(pair));
+
gconf_entry_destroy(pair);
}
else
@@ -827,6 +863,8 @@ gconf_sources_all_entries (GConfSources* sources,
flattened = NULL;
+ g_hash_table_foreach(hash, hash_lookup_defaults_func, &dld);
+
g_hash_table_foreach(hash, hash_listify_func, &flattened);
g_hash_table_destroy(hash);
diff --git a/gconf/gconf-sources.h b/gconf/gconf-sources.h
index 8626a978..05709d4f 100644
--- a/gconf/gconf-sources.h
+++ b/gconf/gconf-sources.h
@@ -65,7 +65,7 @@ struct _GConfSources {
/* Even on error, this gives you an empty source list, i.e. never
returns NULL but may set the error if some addresses weren't
resolved and may contain no sources. */
-GConfSources* gconf_sources_new_from_addresses (gchar **addresses,
+GConfSources* gconf_sources_new_from_addresses (const gchar **addresses,
GConfError **err);
GConfSources* gconf_sources_new_from_source (GConfSource *source);
void gconf_sources_destroy (GConfSources *sources);
diff --git a/gconf/gconf-value.c b/gconf/gconf-value.c
index 1563f640..24584f8a 100644
--- a/gconf/gconf-value.c
+++ b/gconf/gconf-value.c
@@ -665,7 +665,9 @@ gconf_entry_new_nocopy(gchar* key, GConfValue* val)
pair->key = key;
pair->value = val;
-
+ pair->schema_name = NULL;
+ pair->is_default = FALSE;
+
return pair;
}
@@ -685,3 +687,32 @@ gconf_entry_steal_value (GConfEntry* entry)
entry->value = NULL;
return val;
}
+
+void
+gconf_entry_set_value_nocopy(GConfEntry* entry,
+ GConfValue* val)
+{
+ if (entry->value)
+ gconf_value_destroy(entry->value);
+
+ entry->value = val;
+}
+
+void
+gconf_entry_set_schema_name(GConfEntry* entry,
+ const gchar* name)
+{
+ if (entry->schema_name)
+ g_free(entry->schema_name);
+
+ entry->schema_name = name ? g_strdup(name) : NULL;
+}
+
+void
+gconf_entry_set_is_default (GConfEntry* entry,
+ gboolean is_default)
+{
+ entry->is_default = is_default;
+}
+
+
diff --git a/gconf/gconf-value.h b/gconf/gconf-value.h
index dda88aa7..b6e2c6d4 100644
--- a/gconf/gconf-value.h
+++ b/gconf/gconf-value.h
@@ -154,16 +154,29 @@ typedef struct _GConfEntry GConfEntry;
struct _GConfEntry {
gchar* key;
GConfValue* value;
+ gchar* schema_name;
+ gboolean is_default;
};
#define gconf_entry_key(x) ((const gchar*)(x)->key)
#define gconf_entry_value(x) ((x)->value)
+#define gconf_entry_schema_name(x) ((x)->schema_name)
+#define gconf_entry_is_default(x) ((x)->is_default)
/* Pair takes memory ownership of both key and value */
-GConfEntry* gconf_entry_new_nocopy (gchar* key, GConfValue* val);
-void gconf_entry_destroy (GConfEntry* entry);
+GConfEntry* gconf_entry_new_nocopy (gchar *key,
+ GConfValue *val);
+void gconf_entry_destroy (GConfEntry *entry);
+
/* Transfer ownership of value to the caller. */
-GConfValue* gconf_entry_steal_value (GConfEntry* entry);
+GConfValue* gconf_entry_steal_value (GConfEntry *entry);
+void gconf_entry_set_value_nocopy (GConfEntry *entry,
+ GConfValue *val);
+void gconf_entry_set_schema_name (GConfEntry *entry,
+ const gchar *name);
+void gconf_entry_set_is_default (GConfEntry *entry,
+ gboolean is_default);
+
#endif
diff --git a/gconf/gconf.c b/gconf/gconf.c
index fcbe8e57..85f2f77e 100644
--- a/gconf/gconf.c
+++ b/gconf/gconf.c
@@ -918,6 +918,7 @@ gconf_all_entries(GConfEngine* conf, const gchar* dir, GConfError** err)
GSList* pairs = NULL;
ConfigServer_ValueList* values;
ConfigServer_KeyList* keys;
+ ConfigServer_IsDefaultList* is_defaults;
CORBA_Environment ev;
ConfigServer cs;
guint i;
@@ -982,7 +983,7 @@ gconf_all_entries(GConfEngine* conf, const gchar* dir, GConfError** err)
ConfigServer_all_entries(cs, priv->context,
(gchar*)dir,
(gchar*)gconf_current_locale(),
- &keys, &values,
+ &keys, &values, &is_defaults,
&ev);
if (gconf_server_broken(&ev))
@@ -1014,6 +1015,10 @@ gconf_all_entries(GConfEngine* conf, const gchar* dir, GConfError** err)
pair =
gconf_entry_new_nocopy(g_strdup(keys->_buffer[i]),
gconf_value_from_corba_value(&(values->_buffer[i])));
+
+ /* note, there's an accesor function for setting this that we are
+ cheating and not using */
+ pair->is_default = is_defaults->_buffer[i];
pairs = g_slist_prepend(pairs, pair);
@@ -1022,6 +1027,7 @@ gconf_all_entries(GConfEngine* conf, const gchar* dir, GConfError** err)
CORBA_free(keys);
CORBA_free(values);
+ CORBA_free(is_defaults);
return pairs;
}
@@ -1395,8 +1401,8 @@ static void
notify(PortableServer_Servant servant,
CORBA_unsigned_long context,
CORBA_unsigned_long cnxn,
- CORBA_char* key,
- ConfigValue* value,
+ const CORBA_char* key,
+ const ConfigValue* value,
CORBA_boolean is_default,
CORBA_Environment *ev);
@@ -1414,8 +1420,8 @@ static void
notify(PortableServer_Servant servant,
CORBA_unsigned_long context,
CORBA_unsigned_long server_id,
- CORBA_char* key,
- ConfigValue* value,
+ const CORBA_char* key,
+ const ConfigValue* value,
CORBA_boolean is_default,
CORBA_Environment *ev)
{
diff --git a/gconf/gconfd.c b/gconf/gconfd.c
index 31ec8b5e..e3f27c2d 100644
--- a/gconf/gconfd.c
+++ b/gconf/gconfd.c
@@ -144,7 +144,7 @@ static GConfValue* context_query_default_value(GConfContext* ctx,
GConfError** err);
static void context_set(GConfContext* ctx, const gchar* key,
- GConfValue* value, ConfigValue* cvalue,
+ GConfValue* value, const ConfigValue* cvalue,
GConfError** err);
static void context_unset(GConfContext* ctx, const gchar* key,
const gchar* locale,
@@ -182,12 +182,12 @@ static void sleep_old_contexts(void);
static ConfigServer server = CORBA_OBJECT_NIL;
static ConfigServer_Context
-gconfd_get_context(PortableServer_Servant servant, CORBA_char * address,
+gconfd_get_context(PortableServer_Servant servant, const CORBA_char* address,
CORBA_Environment* ev);
static CORBA_unsigned_long
gconfd_add_listener(PortableServer_Servant servant, ConfigServer_Context ctx,
- CORBA_char * where,
+ const CORBA_char* where,
ConfigListener who, CORBA_Environment *ev);
static void
gconfd_remove_listener(PortableServer_Servant servant,
@@ -196,13 +196,13 @@ gconfd_remove_listener(PortableServer_Servant servant,
CORBA_Environment *ev);
static ConfigValue*
gconfd_lookup(PortableServer_Servant servant, ConfigServer_Context ctx,
- CORBA_char * key,
+ const CORBA_char* key,
CORBA_Environment *ev);
static ConfigValue*
gconfd_lookup_with_locale(PortableServer_Servant servant, ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char * locale,
+ const CORBA_char* key,
+ const CORBA_char* locale,
CORBA_boolean use_schema_default,
CORBA_boolean * is_default,
CORBA_Environment *ev);
@@ -210,59 +210,61 @@ gconfd_lookup_with_locale(PortableServer_Servant servant, ConfigServer_Context c
static ConfigValue*
gconfd_lookup_default_value(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char * locale,
+ const CORBA_char* key,
+ const CORBA_char* locale,
CORBA_Environment *ev);
static void
gconfd_set(PortableServer_Servant servant, ConfigServer_Context ctx,
- CORBA_char * key,
- ConfigValue* value, CORBA_Environment *ev);
+ const CORBA_char* key,
+ const ConfigValue* value, CORBA_Environment *ev);
static void
gconfd_unset(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
+ const CORBA_char* key,
CORBA_Environment *ev);
static void
gconfd_unset_with_locale(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char * locale,
+ const CORBA_char* key,
+ const CORBA_char* locale,
CORBA_Environment *ev);
static CORBA_boolean
gconfd_dir_exists(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
+ const CORBA_char* dir,
CORBA_Environment *ev);
static void
gconfd_remove_dir(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
+ const CORBA_char* dir,
CORBA_Environment *ev);
static void
gconfd_all_entries (PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
- CORBA_char * locale,
+ const CORBA_char* dir,
+ const CORBA_char* locale,
ConfigServer_KeyList ** keys,
- ConfigServer_ValueList ** values, CORBA_Environment * ev);
+ ConfigServer_ValueList ** values,
+ ConfigServer_IsDefaultList ** is_defaults,
+ CORBA_Environment * ev);
static void
gconfd_all_dirs (PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
+ const CORBA_char* dir,
ConfigServer_KeyList ** keys, CORBA_Environment * ev);
static void
gconfd_set_schema (PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char* schema_key, CORBA_Environment * ev);
+ const CORBA_char* key,
+ const CORBA_char* schema_key, CORBA_Environment * ev);
static void
gconfd_sync(PortableServer_Servant servant,
@@ -306,12 +308,12 @@ static POA_ConfigServer__vepv poa_server_vepv = { &base_epv, &server_epv };
static POA_ConfigServer poa_server_servant = { NULL, &poa_server_vepv };
static ConfigServer_Context
-gconfd_get_context(PortableServer_Servant servant, CORBA_char * address,
+gconfd_get_context(PortableServer_Servant servant, const CORBA_char* address,
CORBA_Environment* ev)
{
ConfigServer_Context ctx;
GConfSources* sources;
- gchar* addresses[] = { address, NULL };
+ const gchar* addresses[] = { address, NULL };
GConfError* error = NULL;
ctx = lookup_context_id_from_address(address);
@@ -338,7 +340,7 @@ gconfd_get_context(PortableServer_Servant servant, CORBA_char * address,
static CORBA_unsigned_long
gconfd_add_listener(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * where,
+ const CORBA_char* where,
const ConfigListener who, CORBA_Environment *ev)
{
GConfContext* gcc;
@@ -382,17 +384,17 @@ gconfd_remove_listener(PortableServer_Servant servant,
static ConfigValue*
gconfd_lookup(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
+ const CORBA_char* key,
CORBA_Environment *ev)
{
- /* CORBA_char* normally can't be NULL but we cheat here */
+ /* const CORBA_char* normally can't be NULL but we cheat here */
return gconfd_lookup_with_locale(servant, ctx, key, NULL, TRUE, NULL, ev);
}
static ConfigValue*
gconfd_lookup_with_locale(PortableServer_Servant servant, ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char * locale,
+ const CORBA_char* key,
+ const CORBA_char* locale,
CORBA_boolean use_schema_default,
CORBA_boolean * value_is_default,
CORBA_Environment *ev)
@@ -438,8 +440,8 @@ gconfd_lookup_with_locale(PortableServer_Servant servant, ConfigServer_Context c
static ConfigValue*
gconfd_lookup_default_value(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char * locale,
+ const CORBA_char* key,
+ const CORBA_char* locale,
CORBA_Environment *ev)
{
GConfValue* val;
@@ -480,8 +482,8 @@ gconfd_lookup_default_value(PortableServer_Servant servant,
static void
gconfd_set(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- ConfigValue* value, CORBA_Environment *ev)
+ const CORBA_char* key,
+ const ConfigValue* value, CORBA_Environment *ev)
{
gchar* str;
GConfValue* val;
@@ -523,8 +525,8 @@ gconfd_set(PortableServer_Servant servant,
static void
gconfd_unset_with_locale(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char * locale,
+ const CORBA_char* key,
+ const CORBA_char* locale,
CORBA_Environment *ev)
{
GConfContext* gcc;
@@ -543,17 +545,17 @@ gconfd_unset_with_locale(PortableServer_Servant servant,
static void
gconfd_unset(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
+ const CORBA_char* key,
CORBA_Environment *ev)
{
- /* This is a cheat, since CORBA_char* isn't normally NULL */
+ /* This is a cheat, since const CORBA_char* isn't normally NULL */
gconfd_unset_with_locale(servant, ctx, key, NULL, ev);
}
static CORBA_boolean
gconfd_dir_exists(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char *dir,
+ const CORBA_char* dir,
CORBA_Environment *ev)
{
GConfContext *gcc;
@@ -576,7 +578,7 @@ gconfd_dir_exists(PortableServer_Servant servant,
static void
gconfd_remove_dir(PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
+ const CORBA_char* dir,
CORBA_Environment *ev)
{
GConfContext* gcc;
@@ -597,10 +599,11 @@ gconfd_remove_dir(PortableServer_Servant servant,
static void
gconfd_all_entries (PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
- CORBA_char * locale,
+ const CORBA_char* dir,
+ const CORBA_char* locale,
ConfigServer_KeyList ** keys,
ConfigServer_ValueList ** values,
+ ConfigServer_IsDefaultList ** is_defaults,
CORBA_Environment * ev)
{
GSList* pairs;
@@ -637,6 +640,11 @@ gconfd_all_entries (PortableServer_Servant servant,
(*values)->_length = n;
(*values)->_maximum = n;
+ *is_defaults = ConfigServer_IsDefaultList__alloc();
+ (*is_defaults)->_buffer = CORBA_sequence_CORBA_boolean_allocbuf(n);
+ (*is_defaults)->_length = n;
+ (*is_defaults)->_maximum = n;
+
tmp = pairs;
i = 0;
@@ -650,7 +658,8 @@ gconfd_all_entries (PortableServer_Servant servant,
(*keys)->_buffer[i] = CORBA_string_dup(p->key);
fill_corba_value_from_gconf_value(p->value, &((*values)->_buffer[i]));
-
+ (*is_defaults)->_buffer[i] = gconf_entry_is_default(p);
+
gconf_entry_destroy(p);
++i;
@@ -667,7 +676,7 @@ gconfd_all_entries (PortableServer_Servant servant,
static void
gconfd_all_dirs (PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * dir,
+ const CORBA_char* dir,
ConfigServer_KeyList ** keys, CORBA_Environment * ev)
{
GSList* subdirs;
@@ -719,8 +728,8 @@ gconfd_all_dirs (PortableServer_Servant servant,
static void
gconfd_set_schema (PortableServer_Servant servant,
ConfigServer_Context ctx,
- CORBA_char * key,
- CORBA_char* schema_key, CORBA_Environment * ev)
+ const CORBA_char* key,
+ const CORBA_char* schema_key, CORBA_Environment * ev)
{
GConfContext* gcc;
GConfError* error = NULL;
@@ -820,7 +829,7 @@ gconf_server_load_sources(void)
/* We want to stay alive but do nothing, because otherwise every
request would result in another failed gconfd being spawned.
*/
- gchar* empty_addr[] = { NULL };
+ const gchar* empty_addr[] = { NULL };
gconf_log(GCL_ERR, _("No configuration sources in the source path, configuration won't be saved; edit "GCONF_SYSCONFDIR"/gconf/path"));
/* don't request error since there aren't any addresses */
sources = gconf_sources_new_from_addresses(empty_addr, NULL);
@@ -830,7 +839,7 @@ gconf_server_load_sources(void)
}
else
{
- sources = gconf_sources_new_from_addresses(addresses, &error);
+ sources = gconf_sources_new_from_addresses((const gchar**)addresses, &error);
if (error != NULL)
{
@@ -1169,7 +1178,7 @@ context_hibernate(GConfContext* ctx)
static void
context_awaken(GConfContext* ctx, GConfError** err)
{
- gchar* addresses[2];
+ const gchar* addresses[2];
g_return_if_fail(ctx->listeners == NULL);
g_return_if_fail(ctx->sources == NULL);
@@ -1293,7 +1302,7 @@ typedef struct _ListenerNotifyClosure ListenerNotifyClosure;
struct _ListenerNotifyClosure {
ConfigServer_Context context;
- ConfigValue* value;
+ const ConfigValue* value;
gboolean is_default;
GSList* dead;
CORBA_Environment ev;
@@ -1334,7 +1343,7 @@ notify_listeners_cb(GConfListeners* listeners,
static void
context_notify_listeners(GConfContext* ctx,
- const gchar* key, ConfigValue* value,
+ const gchar* key, const ConfigValue* value,
gboolean is_default)
{
ListenerNotifyClosure closure;
@@ -1412,7 +1421,7 @@ static void
context_set(GConfContext* ctx,
const gchar* key,
GConfValue* val,
- ConfigValue* value,
+ const ConfigValue* value,
GConfError** err)
{
g_assert(ctx->listeners != NULL);
diff --git a/wrappers/gtk/gconf-client.c b/wrappers/gtk/gconf-client.c
index 300dcca8..a972731f 100644
--- a/wrappers/gtk/gconf-client.c
+++ b/wrappers/gtk/gconf-client.c
@@ -615,11 +615,10 @@ cache_pairs_in_dir(GConfClient* client, const gchar* dir)
gconf_client_cache(client,
full_key,
- /* It can't be the default, all_entries() only
- returns values that are actually set */
- FALSE,
+ gconf_entry_is_default(pair),
gconf_entry_steal_value(pair));
+ g_free(full_key);
gconf_entry_destroy(pair);