diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-10-23 05:52:45 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-10-23 05:52:45 +0800 |
commit | 2432ddfee8e21a62a80e94d875508242a8034015 (patch) | |
tree | b283f4bea9b74dd426cd5a1c1e265e9919b25850 /src/ephy-extensions-manager.c | |
parent | 64ff5c590db02cddccc6088162747c2b69ccd87d (diff) | |
download | gsoc2013-epiphany-2432ddfee8e21a62a80e94d875508242a8034015.tar.gz gsoc2013-epiphany-2432ddfee8e21a62a80e94d875508242a8034015.tar.zst gsoc2013-epiphany-2432ddfee8e21a62a80e94d875508242a8034015.zip |
Only multiplex [attach|detach]_window to extensions implementing the
2004-10-22 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-extensions-manager.c: (load_extension),
(unload_extension):
Only multiplex [attach|detach]_window to extensions implementing the
EphyExtension interface.
Diffstat (limited to 'src/ephy-extensions-manager.c')
-rw-r--r-- | src/ephy-extensions-manager.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index 0473bb273..c68d90dde 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -693,7 +693,8 @@ load_extension (EphyExtensionsManager *manager, info->extension = ephy_loader_get_object (loader, &info->loader_attributes); - if (info->extension != NULL) + /* attach if the extension implements EphyExtensionIface */ + if (EPHY_IS_EXTENSION (info->extension)) { manager->priv->extensions = g_list_prepend (manager->priv->extensions, @@ -701,13 +702,17 @@ load_extension (EphyExtensionsManager *manager, g_list_foreach (manager->priv->windows, (GFunc) attach_window, info->extension); + } + if (info->extension != NULL) + { info->info.active = TRUE; g_signal_emit (manager, signals[CHANGED], 0, info); } else { + info->info.active = FALSE; info->load_failed = TRUE; } } @@ -730,11 +735,15 @@ unload_extension (EphyExtensionsManager *manager, if (info->load_failed) return; - g_list_foreach (manager->priv->windows, (GFunc) detach_window, - info->extension); + /* detach if the extension implements EphyExtensionIface */ + if (EPHY_IS_EXTENSION (info->extension)) + { + g_list_foreach (manager->priv->windows, (GFunc) detach_window, + info->extension); - manager->priv->extensions = - g_list_remove (manager->priv->extensions, info->extension); + manager->priv->extensions = + g_list_remove (manager->priv->extensions, info->extension); + } ephy_loader_release_object (info->loader, G_OBJECT (info->extension)); g_object_unref (info->extension); |