diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-12-02 01:55:38 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-12-02 01:55:38 +0800 |
commit | 4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2 (patch) | |
tree | 35c9aa5cc718deeada5c124910a89041249fa0b2 /src | |
parent | dbdc93016ca22fc58bf4ee71ba6c55002a256c4a (diff) | |
download | gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.tar gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.tar.gz gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.tar.bz2 gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.tar.lz gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.tar.xz gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.tar.zst gsoc2013-epiphany-4759edbaf17bf4c7b3fbd523fdd2f6bb70c5f6c2.zip |
If the gconf key doesn't exist, or has the wrong value type, set it to
2004-12-01 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-extensions-manager.c: (sync_loaded_extensions):
If the gconf key doesn't exist, or has the wrong value type,
set it to ["extensions-manager-ui"] to ensure the extensions manager
UI is loaded if it's installed.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-extensions-manager.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index 16aae78ee..a6ef2bf36 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -39,6 +39,8 @@ #include <libgnomevfs/gnome-vfs-ops.h> #include <libgnomevfs/gnome-vfs-utils.h> +#include <gconf/gconf-client.h> + #include <gmodule.h> #include <dirent.h> #include <string.h> @@ -854,14 +856,33 @@ unload_extension (EphyExtensionsManager *manager, static void sync_loaded_extensions (EphyExtensionsManager *manager) { - GSList *active_extensions; + GConfClient *client; + GConfValue *value; + GSList *active_extensions = NULL; GList *l; gboolean active; ExtensionInfo *info; LOG ("Synching changed list of active extensions") - active_extensions = eel_gconf_get_string_list (CONF_LOADED_EXTENSIONS); + client = gconf_client_get_default (); + g_return_if_fail (client != NULL); + + value = gconf_client_get (client, CONF_LOADED_EXTENSIONS, NULL); + + /* make sure the extensions-manager-ui is loaded */ + if (value == NULL || + value->type != GCONF_VALUE_LIST || + gconf_value_get_list_type (value) != GCONF_VALUE_STRING) + { + active_extensions = g_slist_prepend (active_extensions, + g_strdup ("extensions-manager-ui")); + eel_gconf_set_string_list (CONF_LOADED_EXTENSIONS, active_extensions); + } + else + { + active_extensions = eel_gconf_get_string_list (CONF_LOADED_EXTENSIONS); + } for (l = manager->priv->data; l != NULL; l = l->next) { @@ -891,6 +912,8 @@ sync_loaded_extensions (EphyExtensionsManager *manager) g_slist_foreach (active_extensions, (GFunc) g_free, NULL); g_slist_free (active_extensions); + + g_object_unref (client); } static void |