Allow plugins to be loaded both from the build-directory and the system on Linux
This commit is contained in:
parent
217c63fe6c
commit
57524439c4
1 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue