aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-shlib-loader.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-10-21 23:31:19 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-21 23:31:19 +0800
commit8e4b79936d79e1fb33947fbfbea1f69141488790 (patch)
tree3ea3a4c212b43be8b3526d5098800a61f63b1d41 /lib/ephy-shlib-loader.c
parent944263b78b78513f86b48dd74a1ba9900f05ed10 (diff)
downloadgsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.tar
gsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.tar.gz
gsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.tar.bz2
gsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.tar.lz
gsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.tar.xz
gsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.tar.zst
gsoc2013-epiphany-8e4b79936d79e1fb33947fbfbea1f69141488790.zip
Expose the extension description keyfile directly to the loaders.
2005-10-21 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-loader.c: (ephy_loader_get_object): * lib/ephy-loader.h: * lib/ephy-module.c: (ephy_module_load), (ephy_module_new): * lib/ephy-module.h: * lib/ephy-shlib-loader.c: (impl_get_object), (ephy_shlib_loader_class_init): * src/ephy-extensions-manager.c: (free_extension_info), (ephy_extensions_manager_load_ini_string), (get_loader_for_type), (load_extension): * src/ephy-python-loader.c: (impl_get_object): Expose the extension description keyfile directly to the loaders.
Diffstat (limited to 'lib/ephy-shlib-loader.c')
-rw-r--r--lib/ephy-shlib-loader.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/ephy-shlib-loader.c b/lib/ephy-shlib-loader.c
index 2b0b9b6d2..c1a82e938 100644
--- a/lib/ephy-shlib-loader.c
+++ b/lib/ephy-shlib-loader.c
@@ -36,9 +36,6 @@ typedef struct
GObject *object;
} LoaderData;
-static GQuark Library_quark = 0;
-static GQuark library_quark = 0;
-
#define EPHY_SHLIB_LOADER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SHLIB_LOADER, EphyShlibLoaderPrivate))
struct _EphyShlibLoaderPrivate
@@ -143,24 +140,25 @@ find_object (const LoaderData *data,
static GObject *
impl_get_object (EphyLoader *eloader,
- GData **attributes)
+ GKeyFile *keyfile)
{
EphyShlibLoader *loader = EPHY_SHLIB_LOADER (eloader);
GSList *l;
LoaderData *data = NULL;
- const char *library;
+ char *library;
+ gboolean resident;
- library = g_datalist_id_get_data (attributes, Library_quark);
- if (library == NULL)
- {
- library = g_datalist_id_get_data (attributes, library_quark);
- }
+ g_return_val_if_fail (keyfile != NULL, NULL);
+
+ library = g_key_file_get_string (keyfile, "Loader", "Library", NULL);
if (library == NULL)
{
g_warning ("NULL library name!\n");
return NULL;
}
+ resident = g_key_file_get_boolean (keyfile, "Loader", "Resident", NULL);
+
l = g_slist_find_custom (loader->priv->data, library,
(GCompareFunc) find_library);
@@ -171,6 +169,7 @@ impl_get_object (EphyLoader *eloader,
if (data->object != NULL)
{
+ g_free (library);
return g_object_ref (data->object);
}
}
@@ -182,13 +181,14 @@ impl_get_object (EphyLoader *eloader,
if (data->module == NULL)
{
- data->module = ephy_module_new (library);
+ data->module = ephy_module_new (library, resident);
}
g_return_val_if_fail (data->object == NULL, data->object);
if (g_type_module_use (G_TYPE_MODULE (data->module)) == FALSE)
{
+ g_free (library);
g_warning ("Could not load extension file at %s\n",
ephy_module_get_path (data->module));
return NULL;
@@ -203,6 +203,8 @@ impl_get_object (EphyLoader *eloader,
g_object_set_data (G_OBJECT (data->object), DATA_KEY, data);
}
+ g_free (library);
+
return data->object;
}
@@ -241,7 +243,4 @@ ephy_shlib_loader_class_init (EphyShlibLoaderClass *klass)
object_class->finalize = ephy_shlib_loader_finalize;
g_type_class_add_private (object_class, sizeof (EphyShlibLoaderPrivate));
-
- Library_quark = g_quark_from_string ("Library");
- library_quark = g_quark_from_string ("library");
}