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