diff --git a/.kde-ci.yml b/.kde-ci.yml index 10e802981..bec5820c5 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -26,3 +26,4 @@ Dependencies: 'frameworks/kwayland': '@latest' 'frameworks/kwindowsystem': '@latest' 'frameworks/kxmlgui': '@latest' + 'plasma/plasma-workspace': '@same' diff --git a/CMakeLists.txt b/CMakeLists.txt index b2076e4de..9f6b92cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,9 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED NO_MODULE COMPONENTS DBus Gui find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Activities Archive CoreAddons GuiAddons Crash DBusAddons Declarative GlobalAccel Kirigami2 I18n IconThemes KIO NewStuff Notifications Plasma PlasmaQuick Wayland WindowSystem XmlGui) + +find_package(LibTaskManager REQUIRED) +add_definitions(-DPLASMA_WORKSPACE_VERSION="${LibTaskManager_VERSION}") find_package(X11 REQUIRED) set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" diff --git a/declarativeimports/core/environment.cpp b/declarativeimports/core/environment.cpp index 2312e1db5..aae4692cc 100644 --- a/declarativeimports/core/environment.cpp +++ b/declarativeimports/core/environment.cpp @@ -61,35 +61,24 @@ uint Environment::makeVersion(uint major, uint minor, uint release) const uint Environment::identifyPlasmaDesktopVersion() { //! Identify Plasma Desktop version - QProcess process; - process.start("plasmashell", QStringList() << "-v"); - process.waitForFinished(); - QString output(process.readAllStandardOutput()); + QStringList plasmaDesktopVersionParts = QString(PLASMA_WORKSPACE_VERSION).split("."); - QStringList stringSplit = output.split(" "); - - if (stringSplit.count() >= 2) { + if (plasmaDesktopVersionParts.count() == 3) { qDebug() << " /////////////////////////"; - QString cleanVersionString = stringSplit[1].remove("\n"); - QStringList plasmaDesktopVersionParts = cleanVersionString.split("."); - - if (plasmaDesktopVersionParts.count() == 3) { - uint maj = plasmaDesktopVersionParts[0].toUInt(); - uint min = plasmaDesktopVersionParts[1].toUInt(); - uint rel = plasmaDesktopVersionParts[2].toUInt(); - - if (maj > 0) { + uint maj = plasmaDesktopVersionParts[0].toUInt(); + uint min = plasmaDesktopVersionParts[1].toUInt(); + uint rel = plasmaDesktopVersionParts[2].toUInt(); - uint desktopVersion = makeVersion(maj, min, rel); + if (maj > 0) { + uint desktopVersion = makeVersion(maj, min, rel); - QString message("Plasma Desktop version: " + QString::number(maj) + "." - + QString::number(min) + "." + QString::number(rel) - + " (" + QString::number(desktopVersion) + ")"); - qDebug() << message; - qDebug() << " /////////////////////////"; + QString message("Plasma Desktop version: " + QString::number(maj) + "." + + QString::number(min) + "." + QString::number(rel) + + " (" + QString::number(desktopVersion) + ")"); + qDebug() << message; + qDebug() << " /////////////////////////"; - return desktopVersion; - } + return desktopVersion; } qDebug() << " /////////////////////////";