From e6e3c454e380bc1e55a719907df43f73f491fca2 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 10 May 2021 18:21:02 -0400 Subject: [PATCH] [PATCH]: Change path variable for loading plugins. Remmina is coded to load plugins from path (REMMINA_RUNTIME_PLUGINDIR) provided during compile-time. This causes cycle between outputs 'out' and 'plugins'. Therefore, code it to load plugins from path (REMMINA_PLUGIN_PATH) provided during run-time. --- CMakeLists.txt | 3 --- config.h.in | 1 - src/remmina_plugin_manager.c | 10 ++++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17a58b04..acbbe440 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,9 +313,6 @@ if(NOT REMMINA_LOCALEDIR) endif() if(NOT REMMINA_PLUGINDIR) set(REMMINA_PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/remmina/plugins") - if(NOT REMMINA_RUNTIME_PLUGINDIR) - set(REMMINA_RUNTIME_PLUGINDIR "${REMMINA_PLUGINDIR}") - endif() endif() if(NOT REMMINA_UIDIR) set(REMMINA_UIDIR "${REMMINA_DATADIR}/remmina/ui") diff --git a/config.h.in b/config.h.in index e59bf78a..8e8da940 100644 --- a/config.h.in +++ b/config.h.in @@ -22,7 +22,6 @@ #define REMMINA_RUNTIME_DATADIR "${REMMINA_RUNTIME_DATADIR}" #define REMMINA_RUNTIME_LOCALEDIR "${REMMINA_RUNTIME_LOCALEDIR}" -#define REMMINA_RUNTIME_PLUGINDIR "${REMMINA_RUNTIME_PLUGINDIR}" #define REMMINA_RUNTIME_UIDIR "${REMMINA_RUNTIME_UIDIR}" #define REMMINA_RUNTIME_THEMEDIR "${REMMINA_RUNTIME_THEMEDIR}" #define REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR "${REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR}" diff --git a/src/remmina_plugin_manager.c b/src/remmina_plugin_manager.c index a1b713a8..74e2c0f0 100644 --- a/src/remmina_plugin_manager.c +++ b/src/remmina_plugin_manager.c @@ -294,7 +294,7 @@ void remmina_plugin_manager_init() { TRACE_CALL(__func__); GDir *dir; - const gchar *name, *ptr; + const gchar *remmina_plugin_path, *name, *ptr; gchar *fullpath; RemminaPlugin *plugin; RemminaSecretPlugin *sp; @@ -312,8 +312,10 @@ void remmina_plugin_manager_init() return; } - g_print("Load modules from %s\n", REMMINA_RUNTIME_PLUGINDIR); - dir = g_dir_open(REMMINA_RUNTIME_PLUGINDIR, 0, NULL); + remmina_plugin_path = g_getenv("REMMINA_PLUGIN_PATH"); + + g_print("Load modules from %s\n", remmina_plugin_path); + dir = g_dir_open(remmina_plugin_path, 0, NULL); if (dir == NULL) return; @@ -323,7 +325,7 @@ void remmina_plugin_manager_init() ptr++; if (!remmina_plugin_manager_loader_supported(ptr)) continue; - fullpath = g_strdup_printf(REMMINA_RUNTIME_PLUGINDIR "/%s", name); + fullpath = g_strconcat(remmina_plugin_path, "/", name); remmina_plugin_manager_load_plugin(fullpath); g_free(fullpath); } -- 2.31.1