aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCrispin Flowerday <gnome@flowerday.cx>2006-02-08 07:02:35 +0800
committerCrispin Flowerday <crispin@src.gnome.org>2006-02-08 07:02:35 +0800
commitff9a45651a8928f366b68a7325465871bdc5ad5f (patch)
treea58dbf0ed81d5fb544d7ee24c21316cf29e126ce /src
parent6b21e23b69422d176a2405a5f834181e1e106c0e (diff)
downloadgsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.tar
gsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.tar.gz
gsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.tar.bz2
gsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.tar.lz
gsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.tar.xz
gsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.tar.zst
gsoc2013-epiphany-ff9a45651a8928f366b68a7325465871bdc5ad5f.zip
Add an 'enabled' flag in the EphyExtensionInfo struct to track whether
2006-02-07 Crispin Flowerday <gnome@flowerday.cx> * 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.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-extensions-manager.c20
-rw-r--r--src/ephy-extensions-manager.h3
2 files changed, 18 insertions, 5 deletions
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