[Xfce4-commits] [apps/parole] 01/01: Support loading plugins from basename (plugin-name.so)
noreply at xfce.org
noreply at xfce.org
Sun Jan 10 14:44:32 CET 2016
This is an automated email from the git hooks/post-receive script.
bluesabre pushed a commit to branch master
in repository apps/parole.
commit 697e96b16806d045f7e732c35678a545833b8f31
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sun Jan 10 08:44:23 2016 -0500
Support loading plugins from basename (plugin-name.so)
---
src/parole-module.c | 9 +++++++--
src/parole-module.h | 4 +++-
src/parole-plugins-manager.c | 5 +++--
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/parole-module.c b/src/parole-module.c
index 6ca328c..fc325cb 100644
--- a/src/parole-module.c
+++ b/src/parole-module.c
@@ -172,6 +172,7 @@ static void
parole_provider_module_init (ParoleProviderModule *module)
{
module->library = NULL;
+ module->library_name = NULL;
module->initialize = NULL;
module->shutdown = NULL;
module->active = FALSE;
@@ -183,7 +184,7 @@ parole_provider_module_init (ParoleProviderModule *module)
}
ParoleProviderModule *
-parole_provider_module_new (const gchar *filename, const gchar *desktop_file)
+parole_provider_module_new (const gchar *filename, const gchar *desktop_file, const gchar *library_name)
{
ParoleProviderModule *module = NULL;
@@ -194,7 +195,11 @@ parole_provider_module_new (const gchar *filename, const gchar *desktop_file)
module->desktop_file = g_strdup (desktop_file);
g_object_set_data_full (G_OBJECT (module), "desktop-file",
module->desktop_file, (GDestroyNotify) g_free);
-
+
+ module->library_name = g_strdup (library_name);
+ g_object_set_data_full (G_OBJECT (module), "library-name",
+ module->library_name, (GDestroyNotify) g_free);
+
return module;
}
diff --git a/src/parole-module.h b/src/parole-module.h
index 405e6a3..3ca6697 100644
--- a/src/parole-module.h
+++ b/src/parole-module.h
@@ -45,6 +45,7 @@ struct _ParoleProviderModule
GTypeModule parent;
GModule *library;
+ gchar *library_name;
ParolePluginPlayer *player;
GType (*initialize) (ParoleProviderModule *module);
@@ -65,7 +66,8 @@ struct _ParoleProviderModuleClass
GType parole_provider_module_get_type (void) G_GNUC_CONST;
ParoleProviderModule *parole_provider_module_new (const gchar *filename,
- const gchar *desktop_file);
+ const gchar *desktop_file,
+ const gchar *library_name);
gboolean parole_provider_module_new_plugin (ParoleProviderModule *module);
diff --git a/src/parole-plugins-manager.c b/src/parole-plugins-manager.c
index 2831c7d..7b79da4 100644
--- a/src/parole-plugins-manager.c
+++ b/src/parole-plugins-manager.c
@@ -564,7 +564,8 @@ parole_plugins_manager_load_plugins (ParolePluginsManager *manager)
for ( i = 0; i < len; i++)
{
- if ( !g_strcmp0 (plugins_rc[i], module->name) )
+ if ( !g_strcmp0 (plugins_rc[i], module->name) ||
+ !g_strcmp0 (plugins_rc[i], PAROLE_PROVIDER_MODULE (module)->library_name) )
{
TRACE ("Loading plugin :%s", module->name);
if ( !g_type_module_use (module) )
@@ -713,7 +714,7 @@ void parole_plugins_manager_load (ParolePluginsManager *manager)
continue;
}
TRACE ("Creating a module for %s desktop file %s", library_path, desktop_file);
- module = parole_provider_module_new (library_path, desktop_file);
+ module = parole_provider_module_new (library_path, desktop_file, library_name);
g_ptr_array_add (manager->priv->array, module);
g_free (library_name);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list