From ff9a45651a8928f366b68a7325465871bdc5ad5f Mon Sep 17 00:00:00 2001 From: Crispin Flowerday Date: Tue, 7 Feb 2006 23:02:35 +0000 Subject: Add an 'enabled' flag in the EphyExtensionInfo struct to track whether 2006-02-07 Crispin Flowerday * src/ephy-extensions-manager.c: (load_extension), (unload_extension), (sync_loaded_extensions): * src/ephy-extensions-manager.h: Add an 'enabled' flag in the EphyExtensionInfo struct to track whether gconf says it should be loaded. The 'active' flag is whether it is actually loaded. --- ChangeLog | 10 ++++++++++ src/ephy-extensions-manager.c | 20 ++++++++++++++++---- src/ephy-extensions-manager.h | 3 ++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 628a8a48a..a37a2c0d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-02-07 Crispin Flowerday + + * src/ephy-extensions-manager.c: (load_extension), + (unload_extension), (sync_loaded_extensions): + * src/ephy-extensions-manager.h: + + Add an 'enabled' flag in the EphyExtensionInfo struct to + track whether gconf says it should be loaded. The + 'active' flag is whether it is actually loaded. + 2006-02-07 Christian Persch * embed/mozilla/mozilla-embed-single.cpp: diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index 632bbda2c..a06152e01 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -723,8 +723,6 @@ load_extension (EphyExtensionsManager *manager, if (info->extension != NULL) { info->info.active = TRUE; - - g_signal_emit (manager, signals[CHANGED], 0, info); } else { @@ -783,8 +781,6 @@ unload_extension (EphyExtensionsManager *manager, info->info.active = FALSE; info->extension = NULL; - - g_signal_emit (manager, signals[CHANGED], 0, info); } static void @@ -820,6 +816,8 @@ sync_loaded_extensions (EphyExtensionsManager *manager) for (l = manager->priv->data; l != NULL; l = l->next) { + gboolean changed; + info = (ExtensionInfo *) l->data; active = (g_slist_find_custom (active_extensions, @@ -831,6 +829,10 @@ sync_loaded_extensions (EphyExtensionsManager *manager) active ? "" : "not ", info->info.active ? "" : "not "); + changed = ( info->info.enabled != active ); + + info->info.enabled = active; + if (active != info->info.active) { if (active) @@ -841,6 +843,16 @@ sync_loaded_extensions (EphyExtensionsManager *manager) { unload_extension (manager, info); } + + if (active == info->info.active) + { + changed = TRUE; + } + } + + if (changed) + { + g_signal_emit (manager, signals[CHANGED], 0, info); } } diff --git a/src/ephy-extensions-manager.h b/src/ephy-extensions-manager.h index 2e3d1a07b..38dd45350 100644 --- a/src/ephy-extensions-manager.h +++ b/src/ephy-extensions-manager.h @@ -45,7 +45,8 @@ typedef struct { char *identifier; GKeyFile *keyfile; - gboolean active; + guint active :1; + guint enabled :1; } EphyExtensionInfo; struct _EphyExtensionsManagerClass -- cgit v1.2.3