{
KATZE_ARRAY_FOREACH_ITEM (extension, extensions)
if (midori_extension_is_active (extension))
- g_key_file_set_boolean (key_file, "extensions",
- g_object_get_data (G_OBJECT (extension), "filename"), TRUE);
+ {
+ const gchar* filename = g_object_get_data (
+ G_OBJECT (extension), "filename");
+
+ gchar* key;
+ gchar* term;
+
+ key = katze_object_get_string (extension, "key");
+ if (key && *key)
+ term = g_strdup_printf ("%s/%s", filename, key);
+ else
+ term = g_strdup (filename);
+
+ g_key_file_set_boolean (key_file, "extensions", term, TRUE);
+
+ g_free (key);
+ g_free (term);
+ }
g_object_unref (extensions);
}
else if ((_extensions = g_object_get_data (G_OBJECT (app), "extensions")))
if (active_extensions)
{
guint i = 0;
+ gchar* key;
gchar* name;
+ gchar* term;
+
+ key = katze_object_get_string (extension, "key");
+ if (key && *key)
+ term = g_strdup_printf ("%s/%s", filename, key);
+ else
+ term = g_strdup (filename);
+
while ((name = active_extensions[i++]))
- if (!g_strcmp0 (filename, name))
+ if (!g_strcmp0 (term, name))
g_signal_emit_by_name (extension, "activate", app);
+
+ g_free (key);
+ g_free (term);
}
g_signal_connect_after (extension, "activate",
G_CALLBACK (extension_activate_cb), app);
gchar* version;
gchar* authors;
gchar* website;
+ gchar* key;
MidoriApp* app;
gint active;
PROP_DESCRIPTION,
PROP_VERSION,
PROP_AUTHORS,
- PROP_WEBSITE
+ PROP_WEBSITE,
+ PROP_KEY
};
enum {
NULL,
flags));
+ /**
+ * MidoriExtension:key:
+ *
+ * The extension key.
+ * Needed if there is more than one extension object in a single module.
+ *
+ * Since: 0.4.5
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_KEY,
+ g_param_spec_string (
+ "key",
+ "Key",
+ "The extension key",
+ NULL,
+ flags));
+
g_type_class_add_private (class, sizeof (MidoriExtensionPrivate));
}
katze_assign (extension->priv->version, NULL);
katze_assign (extension->priv->authors, NULL);
katze_assign (extension->priv->website, NULL);
+ katze_assign (extension->priv->key, NULL);
katze_assign (extension->priv->config_dir, NULL);
g_list_free (extension->priv->lsettings);
case PROP_WEBSITE:
katze_assign (extension->priv->website, g_value_dup_string (value));
break;
+ case PROP_KEY:
+ katze_assign (extension->priv->key, g_value_dup_string (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_WEBSITE:
g_value_set_string (value, extension->priv->website);
break;
+ case PROP_KEY:
+ g_value_set_string (value, extension->priv->key);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
public string version { get; set; }
[NoAccessorMethod]
public string authors { get; set; }
+ [NoAccessorMethod]
+ public string website { get; set; }
+ [NoAccessorMethod]
+ public string key { get; set; }
public signal void activate (Midori.App app);
public signal void deactivate ();