Fix plugin search dirs
This commit is contained in:
parent
02b97a686e
commit
0948ffb11e
@ -17,7 +17,7 @@ Platform::Platform(QObject *parent) : QObject(parent)
|
|||||||
foreach (const QString &entry, dir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot)) {
|
foreach (const QString &entry, dir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot)) {
|
||||||
qCDebug(dcPlatform()) << "Found dir entry" << entry;
|
qCDebug(dcPlatform()) << "Found dir entry" << entry;
|
||||||
QFileInfo fi;
|
QFileInfo fi;
|
||||||
if (entry.startsWith("libnymea_systemplugin") && entry.endsWith(".so")) {
|
if (entry.startsWith("libnymea_platformplugin") && entry.endsWith(".so")) {
|
||||||
fi.setFile(path + "/" + entry);
|
fi.setFile(path + "/" + entry);
|
||||||
} else {
|
} else {
|
||||||
fi.setFile(path + "/" + entry + "/libnymea_platformplugin" + entry + ".so");
|
fi.setFile(path + "/" + entry + "/libnymea_platformplugin" + entry + ".so");
|
||||||
@ -68,10 +68,19 @@ PlatformUpdateController *Platform::updateController() const
|
|||||||
|
|
||||||
QStringList Platform::pluginSearchDirs() const
|
QStringList Platform::pluginSearchDirs() const
|
||||||
{
|
{
|
||||||
QStringList ret;
|
QStringList searchDirs;
|
||||||
ret << QString(qgetenv("NYMEA_PLATFORM_PLUGINS_PATH")).split(':');
|
QByteArray envPath = qgetenv("NYMEA_PLATFORM_PLUGINS_PATH");
|
||||||
ret << QCoreApplication::applicationDirPath();
|
if (!envPath.isEmpty()) {
|
||||||
return ret;
|
searchDirs << QString(envPath).split(':');
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
|
||||||
|
searchDirs << libraryPath.replace("qt5", "nymea").replace("plugins", "platforms");
|
||||||
|
}
|
||||||
|
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/nymea/platforms";
|
||||||
|
searchDirs << QCoreApplication::applicationDirPath() + "/../platforms/";
|
||||||
|
searchDirs << QCoreApplication::applicationDirPath() + "/../../../platforms/";
|
||||||
|
return searchDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user