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:
@@ -36,6 +36,12 @@ If using ModemManager, Calls will wait for ModemManager to appear on
|
||||
D-Bus and then wait for usable modems to appear. The UI will be
|
||||
inactive and display a status message until a usable modem appears.
|
||||
|
||||
When running from the source tree you can use `CALLS_PLUGIN_DIR` environment
|
||||
varible to specify the directroy from where plugins are loaded. To e.g. load
|
||||
the dummy plugin from the source tree:
|
||||
|
||||
export CALLS_PLUGIN_DIR=_build/plugins/dummy/
|
||||
_build/src/gnome-calls -p dummy
|
||||
|
||||
### oFono
|
||||
There is also an oFono backend, "ofono". This was the first backend
|
||||
|
@@ -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