Update extension test to extension_init changes

This commit is contained in:
Vincent Cappe 2012-04-12 02:35:14 +02:00 committed by Christian Dywan
parent e5a793c9e7
commit 3428fbb586

View file

@ -166,13 +166,25 @@ extension_settings (void)
static void static void
extension_activate (gconstpointer data) extension_activate (gconstpointer data)
{ {
MidoriExtension* extension;
MidoriApp* app = midori_app_new (); MidoriApp* app = midori_app_new ();
MidoriExtension* extension = MIDORI_EXTENSION (data);
if (extension == NULL)
return;
g_object_set (app, "settings", midori_web_settings_new (), NULL); g_object_set (app, "settings", midori_web_settings_new (), NULL);
g_signal_emit_by_name (extension, "activate", app);
midori_extension_deactivate (extension); if (MIDORI_IS_EXTENSION (data))
{
extension = MIDORI_EXTENSION (data);
g_signal_emit_by_name (extension, "activate", app);
midori_extension_deactivate (extension);
}
else if (KATZE_IS_ARRAY (data))
{
KATZE_ARRAY_FOREACH_ITEM (extension, KATZE_ARRAY (data))
{
g_signal_emit_by_name (extension, "activate", app);
midori_extension_deactivate (extension);
}
}
g_object_unref (app); g_object_unref (app);
} }