manager: Set peas search path only once

There is no need to redo it for every added plugin.
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-04-21 11:31:29 +02:00
parent 3121963220
commit 2ac43f391a
2 changed files with 15 additions and 10 deletions

View File

@@ -174,18 +174,8 @@ calls_provider_load_plugin (const char *name)
PeasEngine *plugins;
PeasPluginInfo *info;
PeasExtension *extension;
const gchar *dir;
// Add Calls search path and rescan
plugins = peas_engine_get_default ();
peas_engine_add_search_path (plugins, PLUGIN_LIBDIR, NULL);
g_debug ("Scanning for plugins in `%s'", PLUGIN_LIBDIR);
dir = g_getenv ("CALLS_PLUGIN_DIR");
if (dir && dir[0] != '\0') {
g_debug ("Adding %s to plugin search path", dir);
peas_engine_prepend_search_path (plugins, dir, NULL);
}
// Find the plugin
info = peas_engine_get_plugin_info (plugins, name);