From 57524439c4e7e2898f8c7b01fbd327a459966991 Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Mon, 16 May 2011 14:03:51 +0000 Subject: [PATCH] Allow plugins to be loaded both from the build-directory and the system on Linux --- .../TelldusCenter/tellduscenterapplication.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/telldus-gui/TelldusCenter/tellduscenterapplication.cpp b/telldus-gui/TelldusCenter/tellduscenterapplication.cpp index 270ac015..7db41951 100644 --- a/telldus-gui/TelldusCenter/tellduscenterapplication.cpp +++ b/telldus-gui/TelldusCenter/tellduscenterapplication.cpp @@ -92,23 +92,25 @@ void TelldusCenterApplication::eventTriggered( const QString &name, const QStrin void TelldusCenterApplication::loadPlugins() { QDir pluginsDir = QDir(qApp->applicationDirPath()); + QStringList paths; #if defined(Q_OS_MAC) if (pluginsDir.dirName() == "MacOS") { pluginsDir.cdUp(); } #endif - + if (pluginsDir.cd("Plugins")) { - this->setLibraryPaths( QStringList(pluginsDir.absolutePath()) ); + paths << pluginsDir.absolutePath(); } #if defined(Q_OS_UNIX) - QStringList paths = QStringList() << DEFINE_STRING(PLUGIN_LIB_PATH); - this->setLibraryPaths( paths ); + paths << DEFINE_STRING(PLUGIN_LIB_PATH); #endif - + + this->setLibraryPaths( paths ); + QScriptValue mainWindowObject = d->scriptEnvironment->engine()->newQObject(d->mainWindow); d->scriptEnvironment->engine()->globalObject().property("application").setProperty("mainwindow", mainWindowObject);