126
126
list = gconf_client_all_entries (client, schema_dir, error);
128
g_return_if_fail (*error == NULL);
130
131
for (l = list; l; l = l->next) {
131
GConfEntry *entry = l->data;
132
GConfEntry *entry = l->data;
133
const gchar *schema_key;
134
GConfEntry *applet_entry;
135
const gchar *applet_schema_key;
135
tmp = g_path_get_basename (gconf_entry_get_key (entry));
139
schema_key = gconf_entry_get_key (entry);
140
tmp = g_path_get_basename (schema_key);
137
142
if (strchr (tmp, '-'))
138
143
g_warning ("Applet key '%s' contains a hyphen. Please "
139
144
"use underscores in gconf keys\n", tmp);
141
146
key = g_strdup_printf ("%s/%s", prefs_key, tmp);
145
gconf_engine_associate_schema (
146
client->engine, key, gconf_entry_get_key (entry), error);
149
/* Associating a schema is potentially expensive, so let's try
150
* to avoid this by doing it only when needed. So we check if
151
* the key is already correctly associated. */
153
applet_entry = gconf_client_get_entry (client, key,
156
applet_schema_key = gconf_entry_get_schema_name (applet_entry);
158
applet_schema_key = NULL;
160
if (g_strcmp0 (schema_key, applet_schema_key) != 0) {
161
gconf_engine_associate_schema (client->engine,
162
key, schema_key, error);
164
if (gconf_entry_get_value (applet_entry) == NULL ||
165
gconf_entry_get_is_default (applet_entry)) {
166
/* unset the key: gconf_client_get_entry()
167
* brought an invalid entry in the client
168
* cache, and we want to fix this */
169
gconf_client_unset (client, key, NULL);
176
gconf_entry_unref (applet_entry);
150
177
gconf_entry_unref (entry);
170
197
prefs_subdir = g_strdup_printf ("%s/%s", prefs_key, tmp);
171
198
schema_subdir = g_strdup_printf ("%s/%s", schema_dir, tmp);
173
panel_applet_associate_schemas_in_dir (
174
client, prefs_subdir, schema_subdir, error);
200
panel_applet_associate_schemas_in_dir (client,
176
205
g_free (prefs_subdir);
177
206
g_free (schema_subdir);
207
236
error = &our_error;
209
panel_applet_associate_schemas_in_dir (
210
applet->priv->client, applet->priv->prefs_key, schema_dir, error);
238
panel_applet_associate_schemas_in_dir (applet->priv->client,
239
applet->priv->prefs_key,
212
243
if (!opt_error && our_error) {
213
244
g_warning (G_STRLOC ": failed to add preferences from '%s' : '%s'",