diff options
author | Garrett Regier <garrettregier@gmail.com> | 2015-09-21 21:36:17 -0700 |
---|---|---|
committer | Garrett Regier <garrettregier@gmail.com> | 2015-09-22 01:04:38 -0700 |
commit | bf43336ed9183b55c0c0e17a25676eec4c4160ad (patch) | |
tree | 5fe46ec30d4a7f65a1318270b0310df89e6b106b /libpeas/peas-engine.c | |
parent | 9e2a607a18f3ad585b06ea3605140889a1366e0f (diff) | |
download | libpeas-bf43336ed9183b55c0c0e17a25676eec4c4160ad.tar.gz |
Add peas_utils_get_loader_module_from_id()
This simplifies loading a plugin loader's module.
Diffstat (limited to 'libpeas/peas-engine.c')
-rw-r--r-- | libpeas/peas-engine.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c index d54a758..a667c88 100644 --- a/libpeas/peas-engine.c +++ b/libpeas/peas-engine.c @@ -647,26 +647,16 @@ static PeasObjectModule * get_plugin_loader_module (gint loader_id) { GlobalLoaderInfo *global_loader_info = &loaders[loader_id]; - gint i, j; - const gchar *loader_name; - gchar *module_name, *module_dir; + const gchar *loader_name, *module_name; + gchar *module_dir; if (global_loader_info->module != NULL) return global_loader_info->module; loader_name = peas_utils_get_loader_from_id (loader_id); - module_name = g_strconcat (loader_name, "loader", NULL); + module_name = peas_utils_get_loader_module_from_id (loader_id); module_dir = peas_dirs_get_plugin_loader_dir (loader_name); - /* Remove '.'s from the module name */ - for (i = 0, j = 0; module_name[i] != '\0'; ++i) - { - if (module_name[i] != '.') - module_name[j++] = module_name[i]; - } - - module_name[j] = '\0'; - /* Bind loaders globally, binding * locally can break the plugin loaders */ @@ -681,7 +671,6 @@ get_plugin_loader_module (gint loader_id) } g_free (module_dir); - g_free (module_name); return global_loader_info->module; } |