1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-04 20:07:36 +00:00

manager: Only set search path from CALLS_PLUGIN_DIR when path exists

Libpeas has issues searching in a path that doesn't exsist.
This commit is contained in:
Julian Sparber 2022-09-22 17:54:44 +02:00
parent 270d145b65
commit 486846b069
2 changed files with 13 additions and 4 deletions

View file

@ -805,8 +805,13 @@ calls_manager_init (CallsManager *self)
g_autofree char *plugin_dir_provider = NULL;
plugin_dir_provider = g_build_filename (dir, "provider", NULL);
g_debug ("Adding %s to plugin search path", plugin_dir_provider);
peas_engine_prepend_search_path (peas, plugin_dir_provider, NULL);
if (g_file_test (plugin_dir_provider, G_FILE_TEST_EXISTS)) {
g_debug ("Adding %s to plugin search path", plugin_dir_provider);
peas_engine_prepend_search_path (peas, plugin_dir_provider, NULL);
} else {
g_warning ("Not adding %s to plugin search path, because the directory doesn't exist. Check if env CALLS_PLUGIN_DIR is set correctly", plugin_dir_provider);
}
}
default_plugin_dir_provider = g_build_filename(PLUGIN_LIBDIR, "provider", NULL);

View file

@ -60,8 +60,12 @@ main (gint argc,
if (dir && dir[0] != '\0') {
g_autofree char *plugin_dir_provider = NULL;
plugin_dir_provider = g_build_filename (dir, "provider", NULL);
g_debug ("Adding %s to plugin search path", plugin_dir_provider);
peas_engine_prepend_search_path (peas, plugin_dir_provider, NULL);
if (g_file_test (plugin_dir_provider, G_FILE_TEST_EXISTS)) {
g_debug ("Adding %s to plugin search path", plugin_dir_provider);
peas_engine_prepend_search_path (peas, plugin_dir_provider, NULL);
} else {
g_warning ("Not adding %s to plugin search path, because the directory doesn't exist. Check if env CALLS_PLUGIN_DIR is set correctly", plugin_dir_provider);
}
}
default_plugin_dir_provider = g_build_filename (PLUGIN_LIBDIR, "provider", NULL);