diff --git a/.kde-ci.yml b/.kde-ci.yml index 684ffd38e4..6d8b2232bf 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -19,7 +19,6 @@ Dependencies: 'frameworks/knewstuff': '@latest-kf6' 'frameworks/knotifications': '@latest-kf6' 'frameworks/kpackage': '@latest-kf6' - 'frameworks/krunner': '@latest-kf6' 'frameworks/kservice': '@latest-kf6' 'frameworks/ksvg': '@latest-kf6' 'frameworks/kwidgetsaddons': '@latest-kf6' diff --git a/CMakeLists.txt b/CMakeLists.txt index b279a5bf87..07d24cb3bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,13 +129,6 @@ set_package_properties(KF6DocTools PROPERTIES ) add_feature_info("KF6DocTools" KF6DocTools_FOUND "Enable building documentation") -find_package(KF6Runner ${KF6_MIN_VERSION} CONFIG) -set_package_properties(KF6Runner PROPERTIES - PURPOSE "Enable building of KWin with krunner support" - TYPE OPTIONAL - ) -add_feature_info("KF6Runner" KF6Runner_FOUND "Enable building of KWin with krunner support") - find_package(KF6Kirigami2 ${KF6_MIN_VERSION} CONFIG) set_package_properties(KF6Kirigami2 PROPERTIES DESCRIPTION "A QtQuick based components set" @@ -379,7 +372,7 @@ ecm_find_qmlmodule(org.kde.plasma.components 2.0) ########### configure tests ############### cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF6Activities_FOUND" OFF) -cmake_dependent_option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON "KF6Runner_FOUND" OFF) +option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON) set(HAVE_GLX ${epoxy_HAS_GLX}) get_target_property(QT_DISABLED_FEATURES Qt6::Gui QT_DISABLED_PUBLIC_FEATURES) diff --git a/src/plugins/krunner-integration/CMakeLists.txt b/src/plugins/krunner-integration/CMakeLists.txt index c70cb26f76..1cf474c3b9 100644 --- a/src/plugins/krunner-integration/CMakeLists.txt +++ b/src/plugins/krunner-integration/CMakeLists.txt @@ -6,6 +6,6 @@ set(krunnerintegration_SOURCES qt_add_dbus_adaptor(krunnerintegration_SOURCES org.kde.krunner1.xml windowsrunnerinterface.h KWin::WindowsRunner) kcoreaddons_add_plugin(krunnerintegration SOURCES ${krunnerintegration_SOURCES} INSTALL_NAMESPACE "kwin/plugins") -target_link_libraries(krunnerintegration kwin KF6::I18n KF6::Runner) +target_link_libraries(krunnerintegration kwin KF6::I18n) install(FILES kwin-runner-windows.desktop DESTINATION ${KDE_INSTALL_DATAROOTDIR}/krunner/dbusplugins) diff --git a/src/plugins/krunner-integration/dbusutils_p.h b/src/plugins/krunner-integration/dbusutils_p.h index 568724dd5f..2e02d13d5d 100644 --- a/src/plugins/krunner-integration/dbusutils_p.h +++ b/src/plugins/krunner-integration/dbusutils_p.h @@ -10,19 +10,21 @@ #pragma once -#include #include #include #include #include +const qreal HighestCategoryRelevance = 100; // KRunner::QueryMatch::CategoryRelevance::Highest +const qreal LowCategoryRelevance = 30; + struct RemoteMatch { // sssuda{sv} QString id; QString text; QString iconName; - KRunner::QueryMatch::Type type = KRunner::QueryMatch::NoMatch; + int categoryRelevance = HighestCategoryRelevance; qreal relevance = 0; QVariantMap properties; }; @@ -56,7 +58,7 @@ inline QDBusArgument &operator<<(QDBusArgument &argument, const RemoteMatch &mat argument << match.id; argument << match.text; argument << match.iconName; - argument << match.type; + argument << match.categoryRelevance; argument << match.relevance; argument << match.properties; argument.endStructure(); @@ -69,9 +71,7 @@ inline const QDBusArgument &operator>>(const QDBusArgument &argument, RemoteMatc argument >> match.id; argument >> match.text; argument >> match.iconName; - uint type; - argument >> type; - match.type = (KRunner::QueryMatch::Type)type; + argument >> match.categoryRelevance; argument >> match.relevance; argument >> match.properties; argument.endStructure(); diff --git a/src/plugins/krunner-integration/windowsrunnerinterface.cpp b/src/plugins/krunner-integration/windowsrunnerinterface.cpp index 53b9a0c6df..0fb46d67a8 100644 --- a/src/plugins/krunner-integration/windowsrunnerinterface.cpp +++ b/src/plugins/krunner-integration/windowsrunnerinterface.cpp @@ -172,9 +172,9 @@ RemoteMatches WindowsRunner::Match(const QString &searchTerm) const QString appName = window->resourceClass(); const QString name = window->caption(); if (name.startsWith(term, Qt::CaseInsensitive) || appName.startsWith(term, Qt::CaseInsensitive)) { - matches << windowsMatch(window, action, 0.8, KRunner::QueryMatch::ExactMatch); + matches << windowsMatch(window, action, 0.8, HighestCategoryRelevance); } else if ((name.contains(term, Qt::CaseInsensitive) || appName.contains(term, Qt::CaseInsensitive)) && actionSupported(window, action)) { - matches << windowsMatch(window, action, 0.7, KRunner::QueryMatch::PossibleMatch); + matches << windowsMatch(window, action, 0.7, LowCategoryRelevance); } } @@ -192,7 +192,7 @@ RemoteMatches WindowsRunner::Match(const QString &searchTerm) continue; } if ((window->desktops().contains(desktop) || window->isOnAllDesktops()) && actionSupported(window, action)) { - matches << windowsMatch(window, action, 0.5, KRunner::QueryMatch::PossibleMatch); + matches << windowsMatch(window, action, 0.5, LowCategoryRelevance); } } } @@ -254,7 +254,7 @@ RemoteMatch WindowsRunner::desktopMatch(const VirtualDesktop *desktop, const Win { RemoteMatch match; match.id = QString::number(action) + QLatin1Char('_') + desktop->id(); - match.type = KRunner::QueryMatch::ExactMatch; + match.categoryRelevance = HighestCategoryRelevance; match.iconName = QStringLiteral("user-desktop"); match.text = desktop->name(); match.relevance = relevance; @@ -266,14 +266,14 @@ RemoteMatch WindowsRunner::desktopMatch(const VirtualDesktop *desktop, const Win return match; } -RemoteMatch WindowsRunner::windowsMatch(const Window *window, const WindowsRunnerAction action, qreal relevance, KRunner::QueryMatch::Type type) const +RemoteMatch WindowsRunner::windowsMatch(const Window *window, const WindowsRunnerAction action, qreal relevance, qreal categoryRelevance) const { RemoteMatch match; match.id = QString::number((int)action) + QLatin1Char('_') + window->internalId().toString(); match.text = window->caption(); match.iconName = window->icon().name(); match.relevance = relevance; - match.type = type; + match.categoryRelevance = categoryRelevance; QVariantMap properties; const QList desktops = window->desktops(); diff --git a/src/plugins/krunner-integration/windowsrunnerinterface.h b/src/plugins/krunner-integration/windowsrunnerinterface.h index c830383990..a048b6bfec 100644 --- a/src/plugins/krunner-integration/windowsrunnerinterface.h +++ b/src/plugins/krunner-integration/windowsrunnerinterface.h @@ -15,8 +15,6 @@ #include "dbusutils_p.h" #include "plugin.h" -#include - #include #include #include @@ -56,7 +54,7 @@ private: }; RemoteMatch desktopMatch(const VirtualDesktop *desktop, const WindowsRunnerAction action = ActivateDesktopAction, qreal relevance = 1.0) const; - RemoteMatch windowsMatch(const Window *window, const WindowsRunnerAction action = ActivateAction, qreal relevance = 1.0, KRunner::QueryMatch::Type type = KRunner::QueryMatch::ExactMatch) const; + RemoteMatch windowsMatch(const Window *window, const WindowsRunnerAction action = ActivateAction, qreal relevance = 1.0, qreal categoryRelevance = HighestCategoryRelevance) const; bool actionSupported(const Window *window, const WindowsRunnerAction action) const; }; }