summaryrefslogtreecommitdiff
path: root/src/plugins/pglist.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-11-02 22:03:25 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-11-02 22:03:25 (GMT)
commit1bef27ee10a820ceabdcfc6389e61b7fab934eea (patch)
tree2194de32593137d3bfda7256c1e65cb1743e70db /src/plugins/pglist.c
parent699e2811a9305f871fe9adcb4797461e947cc863 (diff)
Load UI plugins only in case of graphical support.
Diffstat (limited to 'src/plugins/pglist.c')
-rw-r--r--src/plugins/pglist.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/pglist.c b/src/plugins/pglist.c
index 6b36d2f..e4cb825 100644
--- a/src/plugins/pglist.c
+++ b/src/plugins/pglist.c
@@ -39,6 +39,7 @@
#include "plugin-int.h"
#include "../common/extstr.h"
#include "../core/logs.h"
+#include "../core/nox.h"
#include "../core/paths.h"
@@ -255,6 +256,7 @@ static void browse_directory_for_plugins(const char *dir)
{
struct dirent **namelist; /* Eléments trouvés */
int ret; /* Bilan du parcours */
+ bool nox; /* Absence de support graphique*/
char *filename; /* Elément à ausculter */
GPluginModule *plugin; /* Greffon à intégrer ou pas */
@@ -265,8 +267,27 @@ static void browse_directory_for_plugins(const char *dir)
return;
}
+ nox = run_in_nox_mode();
+
while (ret--)
{
+
+ if (nox)
+ {
+#ifdef _WIN32
+# define UI_SHARED_SUFFIX "-ui.dll"
+#else
+# define UI_SHARED_SUFFIX "-ui.so"
+#endif
+
+ if (strstr(namelist[ret]->d_name, UI_SHARED_SUFFIX) != NULL)
+ {
+ log_variadic_message(LMT_ERROR, _("Skipping unsuitable file: %s"), namelist[ret]->d_name);
+ continue;
+ }
+
+ }
+
filename = (char *)calloc(strlen(dir) + 1 + strlen(namelist[ret]->d_name) + 1, sizeof(char));
strcpy(filename, dir);