manager: Allow to add plugin dir via environent
This eases testing of plugins from the source tree: CALLS_PLUGIN_DIR=_build/plugins/dummy/ _build/src/gnome-calls -p dummy
This commit is contained in:
@@ -86,12 +86,19 @@ load_provider (const gchar* 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);
|
||||
if (!info)
|
||||
|
||||
Reference in New Issue
Block a user