diff options
| author | Sean Davis <smd.seandavis@gmail.com> | 2016-01-10 08:44:23 -0500 |
|---|---|---|
| committer | Sean Davis <smd.seandavis@gmail.com> | 2016-01-10 08:44:23 -0500 |
| commit | 697e96b16806d045f7e732c35678a545833b8f31 (patch) | |
| tree | 7f96e71b3eca3d910f5809642732d9a67bdbddd5 | |
| parent | 7d8be8b95c94dba92947657ee0af5b81fdf9e409 (diff) | |
| download | parole-697e96b16806d045f7e732c35678a545833b8f31.tar.gz | |
Support loading plugins from basename (plugin-name.so)
| -rw-r--r-- | src/parole-module.c | 9 | ||||
| -rw-r--r-- | src/parole-module.h | 4 | ||||
| -rw-r--r-- | 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); |