From 73e7c975afc47f7638d1b91f7ee7a5dc85e8e957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 25 Aug 2025 10:11:13 +0200 Subject: [PATCH] Update lib search paths for all plugin types --- libnymea-core/experiences/experiencemanager.cpp | 6 ++++++ .../hardware/network/networkaccessmanagerimpl.cpp | 2 +- libnymea-core/integrations/apikeysprovidersloader.cpp | 6 ++++++ libnymea-core/integrations/thingmanagerimplementation.cpp | 6 ++++++ libnymea-core/platform/platform.cpp | 7 +++++++ libnymea-core/zwave/zwavemanager.cpp | 8 +++++++- 6 files changed, 33 insertions(+), 2 deletions(-) diff --git a/libnymea-core/experiences/experiencemanager.cpp b/libnymea-core/experiences/experiencemanager.cpp index a2e0e2eb..7f8b173a 100644 --- a/libnymea-core/experiences/experiencemanager.cpp +++ b/libnymea-core/experiences/experiencemanager.cpp @@ -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(); diff --git a/libnymea-core/hardware/network/networkaccessmanagerimpl.cpp b/libnymea-core/hardware/network/networkaccessmanagerimpl.cpp index 94028ba8..da958ccf 100644 --- a/libnymea-core/hardware/network/networkaccessmanagerimpl.cpp +++ b/libnymea-core/hardware/network/networkaccessmanagerimpl.cpp @@ -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. */ diff --git a/libnymea-core/integrations/apikeysprovidersloader.cpp b/libnymea-core/integrations/apikeysprovidersloader.cpp index aa5a529a..5b4281e6 100644 --- a/libnymea-core/integrations/apikeysprovidersloader.cpp +++ b/libnymea-core/integrations/apikeysprovidersloader.cpp @@ -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(); diff --git a/libnymea-core/integrations/thingmanagerimplementation.cpp b/libnymea-core/integrations/thingmanagerimplementation.cpp index 2f3ee433..c4a91790 100644 --- a/libnymea-core/integrations/thingmanagerimplementation.cpp +++ b/libnymea-core/integrations/thingmanagerimplementation.cpp @@ -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"); } diff --git a/libnymea-core/platform/platform.cpp b/libnymea-core/platform/platform.cpp index fd46d48e..262933a4 100644 --- a/libnymea-core/platform/platform.cpp +++ b/libnymea-core/platform/platform.cpp @@ -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"); } diff --git a/libnymea-core/zwave/zwavemanager.cpp b/libnymea-core/zwave/zwavemanager.cpp index 1e82d402..22dccb0b 100644 --- a/libnymea-core/zwave/zwavemanager.cpp +++ b/libnymea-core/zwave/zwavemanager.cpp @@ -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"); }