Commit 2ac43f39 authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

manager: Set peas search path only once

There is no need to redo it for every added plugin.
parent 31219632
...@@ -471,6 +471,9 @@ calls_manager_class_init (CallsManagerClass *klass) ...@@ -471,6 +471,9 @@ calls_manager_class_init (CallsManagerClass *klass)
static void static void
calls_manager_init (CallsManager *self) calls_manager_init (CallsManager *self)
{ {
PeasEngine *peas;
const gchar *dir;
self->state = CALLS_MANAGER_STATE_NO_PROVIDER; self->state = CALLS_MANAGER_STATE_NO_PROVIDER;
self->provider_name = NULL; self->provider_name = NULL;
self->primary_call = NULL; self->primary_call = NULL;
...@@ -480,6 +483,18 @@ calls_manager_init (CallsManager *self) ...@@ -480,6 +483,18 @@ calls_manager_init (CallsManager *self)
g_object_bind_property (self, "country-code", g_object_bind_property (self, "country-code",
self->contacts_provider, "country-code", self->contacts_provider, "country-code",
G_BINDING_DEFAULT); G_BINDING_DEFAULT);
// Prepend peas plugin search path
peas = peas_engine_get_default ();
peas_engine_add_search_path (peas, 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 (peas, dir, NULL);
}
} }
......
...@@ -174,18 +174,8 @@ calls_provider_load_plugin (const char *name) ...@@ -174,18 +174,8 @@ calls_provider_load_plugin (const char *name)
PeasEngine *plugins; PeasEngine *plugins;
PeasPluginInfo *info; PeasPluginInfo *info;
PeasExtension *extension; PeasExtension *extension;
const gchar *dir;
// Add Calls search path and rescan
plugins = peas_engine_get_default (); 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 // Find the plugin
info = peas_engine_get_plugin_info (plugins, name); info = peas_engine_get_plugin_info (plugins, name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment