From 78d4eadf3b3bf911efcc3f971eb5f2c43fbe8757 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 14 Jul 2022 11:52:25 +0200 Subject: [PATCH] wip --- support/SkinnyNamespace.cpp | 32 +++++++++++++++++++++++++++++++- support/support.pro | 1 - 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/support/SkinnyNamespace.cpp b/support/SkinnyNamespace.cpp index d1f85682..310414fd 100644 --- a/support/SkinnyNamespace.cpp +++ b/support/SkinnyNamespace.cpp @@ -12,11 +12,41 @@ #include #include -#include +#include #define STRINGIFY(x) #x #define STRING(x) STRINGIFY(x) +#if defined( PLUGIN_PATH ) + +#include +#include + +#define STRINGIFY(x) #x +#define STRING(x) STRINGIFY(x) + +static int initPluginPath() +{ + const char env[] = "QT_PLUGIN_PATH"; + + QByteArray value = qgetenv( env ); + if ( !value.isEmpty() ) + { + if ( QChar( value.at( value.size() - 1 ) ) != QDir::listSeparator() ) + value += QDir::listSeparator().toLatin1(); + } + + value += STRING( PLUGIN_PATH ); + + qputenv( env, value ); + return 0; +} + +// some plugins are loaded before entering QCoreApplication +static bool pluginPath = initPluginPath(); + +#endif // PLUGIN_PATH + #if defined( ENSURE_SKINS ) #include diff --git a/support/support.pro b/support/support.pro index 71c2c00e..80773cf8 100644 --- a/support/support.pro +++ b/support/support.pro @@ -19,7 +19,6 @@ HEADERS += \ SOURCES += \ SkinnyNamespace.cpp \ - SkinnyPlugin.cpp \ SkinnyShapeFactory.cpp \ SkinnyShapeProvider.cpp \ SkinnyShortcut.cpp