Update lib search paths for all plugin types

This commit is contained in:
Simon Stürz 2025-08-25 10:11:13 +02:00
parent 835c1d9dd2
commit 73e7c975af
6 changed files with 33 additions and 2 deletions

View File

@ -90,9 +90,15 @@ QStringList ExperienceManager::pluginSearchDirs() const
searchDirs << QString::fromUtf8(envDefaultPathData).split(':');
}
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt5", "nymea").replace("plugins", "experiences");
}
#else
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt6", "nymea").replace("plugins", "experiences");
}
#endif
searchDirs << QDir(QCoreApplication::applicationDirPath() + "/../lib/nymea/experiences").absolutePath();
searchDirs << QDir(QCoreApplication::applicationDirPath() + "/../experiences/").absolutePath();
searchDirs << QDir(QCoreApplication::applicationDirPath() + "/../../../experiences/").absolutePath();

View File

@ -35,7 +35,7 @@
\ingroup hardware
\inmodule libnymea
The network manager class is a reimplementation of the \l{http://doc-snapshot.qt-project.org/qt5-5.4/qnetworkaccessmanager.html}{QNetworkAccessManager}
The network manager class is a reimplementation of the QNetworkAccessManager
and allows plugins to send network requests and receive replies.
*/

View File

@ -54,9 +54,15 @@ QStringList ApiKeysProvidersLoader::pluginSearchDirs() const
searchDirs << QString::fromUtf8(envDefaultPathData).split(':');
}
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt5", "nymea").replace("plugins", "apikeysproviders");
}
#else
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt6", "nymea").replace("plugins", "apikeysproviders");
}
#endif
searchDirs << QDir(QCoreApplication::applicationDirPath() + "/../lib/nymea/apikeysproviders").absolutePath();
searchDirs << QDir(QCoreApplication::applicationDirPath() + "/../apikeysproviders/").absolutePath();
searchDirs << QDir(QCoreApplication::applicationDirPath() + "/../../../apikeysproviders/").absolutePath();

View File

@ -150,9 +150,15 @@ QStringList ThingManagerImplementation::pluginSearchDirs()
searchDirs << QString::fromUtf8(envDefaultPathData).split(':');
}
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt5", "nymea");
}
#else
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt6", "nymea");
}
#endif
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("plugins", "nymea/plugins");
}

View File

@ -116,9 +116,16 @@ QStringList Platform::pluginSearchDirs() const
searchDirs << QString::fromUtf8(envDefaultPathData).split(':');
}
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt5", "nymea").replace("plugins", "platform");
}
#else
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt6", "nymea").replace("plugins", "platform");
}
#endif
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("plugins", "nymea/platform");
}

View File

@ -679,10 +679,16 @@ bool ZWaveManager::loadBackend()
if (!envPath.isEmpty()) {
searchDirs << QString(envPath).split(':');
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt5", "nymea").replace("plugins", "zwave");
}
#else
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt6", "nymea").replace("plugins", "zwave");
}
#endif
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("plugins", "nymea/zwave");
}