--- a/gplugin-gtk3-viewer/gplugin-gtk-viewer.c Sat Oct 23 02:11:16 2021 -0500
+++ b/gplugin-gtk3-viewer/gplugin-gtk-viewer.c Sun Oct 24 02:10:58 2021 -0500
@@ -164,7 +164,6 @@
GOptionContext *ctx = NULL;
GtkWidget *window = NULL;
- const gchar *env_paths = NULL;
ctx = g_option_context_new("");
g_option_context_add_main_entries(ctx, entries, NULL);
@@ -193,17 +192,8 @@
manager = gplugin_manager_get_default();
- env_paths = g_getenv("GPLUGIN_PLUGIN_PATH");
- if(env_paths != NULL) {
- gchar **paths = g_strsplit(env_paths, G_SEARCHPATH_SEPARATOR_S, 0);
- for(i = 0; paths[i] != NULL; i++) {
- gplugin_manager_prepend_path(manager, paths[i]);
+ gplugin_manager_prepend_paths_from_environment(manager, + "GPLUGIN_PLUGIN_PATH"); gplugin_manager_refresh(manager);
--- a/gplugin-gtk4-viewer/gplugin-gtk-viewer.c Sat Oct 23 02:11:16 2021 -0500
+++ b/gplugin-gtk4-viewer/gplugin-gtk-viewer.c Sun Oct 24 02:10:58 2021 -0500
@@ -53,22 +53,12 @@
startup_cb(G_GNUC_UNUSED GApplication *app, G_GNUC_UNUSED gpointer data)
GPluginManager *manager = NULL;
- const gchar *env_paths = NULL;
gplugin_init(GPLUGIN_CORE_FLAGS_NONE);
manager = gplugin_manager_get_default();
- env_paths = g_getenv("GPLUGIN_PLUGIN_PATH");
- if(env_paths != NULL) {
- gchar **paths = g_strsplit(env_paths, G_SEARCHPATH_SEPARATOR_S, 0);
- for(i = 0; paths[i] != NULL; i++) {
- gplugin_manager_prepend_path(manager, paths[i]);
+ gplugin_manager_prepend_paths_from_environment(manager, + "GPLUGIN_PLUGIN_PATH"); gplugin_manager_refresh(manager);
--- a/gplugin-query/gplugin-query.c Sat Oct 23 02:11:16 2021 -0500
+++ b/gplugin-query/gplugin-query.c Sun Oct 24 02:10:58 2021 -0500
@@ -298,7 +298,6 @@
GOptionContext *ctx = NULL;
GOptionGroup *group = NULL;
- const gchar *env_paths = NULL;
ctx = g_option_context_new("PLUGIN-ID...");
@@ -329,18 +328,8 @@
manager = gplugin_manager_get_default();
- env_paths = g_getenv("GPLUGIN_PLUGIN_PATH");
- if(env_paths != NULL) {
- gchar **paths = g_strsplit(env_paths, G_SEARCHPATH_SEPARATOR_S, 0);
- for(i = 0; paths[i] != NULL; i++) {
- gplugin_manager_prepend_path(manager, paths[i]);
+ gplugin_manager_prepend_paths_from_environment(manager, + "GPLUGIN_PLUGIN_PATH"); --- a/gplugin/gplugin-manager.c Sat Oct 23 02:11:16 2021 -0500
+++ b/gplugin/gplugin-manager.c Sun Oct 24 02:10:58 2021 -0500
@@ -133,7 +133,6 @@
- void (*changer)(GPluginManager *, const gchar *);
from_env = g_getenv(name);
@@ -141,16 +140,13 @@
paths = g_strsplit(from_env, G_SEARCHPATH_SEPARATOR_S, 0);
- changer = &gplugin_manager_prepend_path;
- changer = &gplugin_manager_append_path;
+ for(i = 0; paths[i]; i++) { + gplugin_manager_prepend_path(manager, paths[i]); + gplugin_manager_append_path(manager, paths[i]);
- for(i = 0; paths[i]; i++) {
- (*changer)(manager, paths[i]);