Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package krunner for openSUSE:Factory checked 
in at 2022-02-24 18:19:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/krunner (Old)
 and      /work/SRC/openSUSE:Factory/.krunner.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "krunner"

Thu Feb 24 18:19:51 2022 rev:97 rq:954277 version:5.91.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/krunner/krunner.changes  2022-01-11 
21:19:28.072967195 +0100
+++ /work/SRC/openSUSE:Factory/.krunner.new.1958/krunner.changes        
2022-02-24 18:22:07.906679486 +0100
@@ -1,0 +2,19 @@
+Sun Feb  6 10:17:12 UTC 2022 - Christophe Giboudeaux <[email protected]>
+
+- Update to 5.91.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/frameworks/5/5.91.0
+- Changes since 5.90.0:
+  * runnermanagerpublictest: Do not load system provided plugins
+  * search plugins in kf<version>
+  * Put aliased classes in "KRunner"-namespace
+  * Fix flickering in Application Launcher for every character typed 
(kde#423161)
+  * Port to KDEDeprecationSettings cmake function
+  * KF5RunnerConfig.cmake.in: Explicitly require QtGui and KCoreAddons,
+    exclude Plasma on deprecation free builds
+  * Add compatibility type definitions for classes without 'Plasma' namespace
+  * Fixups for building without including KService/KIO/Plasma-Frameworks 
(kde#447908)
+  * Silence deprecation warning for KPluginInfo/KServiceTypeTrader in 
compatibility blocks
+
+-------------------------------------------------------------------

Old:
----
  krunner-5.90.0.tar.xz
  krunner-5.90.0.tar.xz.sig

New:
----
  krunner-5.91.0.tar.xz
  krunner-5.91.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ krunner.spec ++++++
--- /var/tmp/diff_new_pack.yEuQ7e/_old  2022-02-24 18:22:08.550679314 +0100
+++ /var/tmp/diff_new_pack.yEuQ7e/_new  2022-02-24 18:22:08.558679312 +0100
@@ -17,7 +17,7 @@
 
 
 %define lname   libKF5Runner5
-%define _tar_path 5.90
+%define _tar_path 5.91
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
@@ -25,7 +25,7 @@
 # Only needed for the package signature condition
 %bcond_without released
 Name:           krunner
-Version:        5.90.0
+Version:        5.91.0
 Release:        0
 Summary:        KDE Framework for providing different actions given a string 
query
 License:        LGPL-2.1-or-later
@@ -100,9 +100,7 @@
 %files devel
 %{_kf5_libdir}/libKF5Runner.so
 %{_kf5_libdir}/cmake/KF5Runner/
-%dir %{_kf5_includedir}/KRunner/
 %{_kf5_includedir}/KRunner/
-%{_kf5_includedir}/*.h
 %{_kf5_mkspecsdir}/qt_KRunner.pri
 %{_kf5_sharedir}/kdevfiletemplates/
 %{_kf5_dbusinterfacesdir}/kf5_org.kde.krunner1.xml


++++++ krunner-5.90.0.tar.xz -> krunner-5.91.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/.gitlab-ci.yml 
new/krunner-5.91.0/.gitlab-ci.yml
--- old/krunner-5.90.0/.gitlab-ci.yml   2022-01-01 13:19:01.000000000 +0100
+++ new/krunner-5.91.0/.gitlab-ci.yml   2022-02-05 16:17:18.000000000 +0100
@@ -2,6 +2,6 @@
 # SPDX-License-Identifier: CC0-1.0
 
 include:
-  - https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-reuse.yml
   - 
https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
   - 
https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
+  - 
https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/reuse-lint.yml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/CMakeLists.txt 
new/krunner-5.91.0/CMakeLists.txt
--- old/krunner-5.90.0/CMakeLists.txt   2022-01-01 13:19:01.000000000 +0100
+++ new/krunner-5.91.0/CMakeLists.txt   2022-02-05 16:17:18.000000000 +0100
@@ -3,13 +3,13 @@
 
 cmake_minimum_required(VERSION 3.16)
 
-set(KF_VERSION "5.90.0") # handled by release scripts
-set(KF_DEP_VERSION "5.90.0") # handled by release scripts
+set(KF_VERSION "5.91.0") # handled by release scripts
+set(KF_DEP_VERSION "5.91.0") # handled by release scripts
 project(KRunner VERSION ${KF_VERSION})
 
 # ECM setup
 include(FeatureSummary)
-find_package(ECM 5.90.0  NO_MODULE)
+find_package(ECM 5.91.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL "https://commits.kde.org/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -27,8 +27,10 @@
 include(KDEPackageAppTemplates)
 include(ECMQtDeclareLoggingCategory)
 include(ECMSetupQtPluginMacroNames)
+include(ECMDeprecationSettings)
 include(KDEGitCommitHooks)
 
+
 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of 
deprecated API excluded from the build [default=0].")
 
 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt 
Assistant, Qt Creator & KDevelop)" OFF)
@@ -45,15 +47,24 @@
 
 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED 
Gui Widgets Quick)
 
+ecm_set_disabled_deprecation_versions(
+    QT ${REQUIRED_QT_VERSION}
+    KF 5.89.0
+    PLASMA 5.0.0  # needed because we use Plasma::Package in the API
+    KSERVICE 5.89.0  # needed because we use KPluginInfo, KServiceTypeTrader 
in the API
+)
+
 find_package(KF5Config ${KF_DEP_VERSION} REQUIRED)
 find_package(KF5CoreAddons ${KF_DEP_VERSION} REQUIRED)
 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED)
-find_package(KF5KIO ${KF_DEP_VERSION} REQUIRED)
-find_package(KF5Service ${KF_DEP_VERSION} REQUIRED)
 find_package(KF5ThreadWeaver ${KF_DEP_VERSION} REQUIRED)
 if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
-   EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.65.0)
+   EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.91.0)
+    find_package(KF5KIO ${KF_DEP_VERSION} REQUIRED)
+    find_package(KF5Service ${KF_DEP_VERSION} REQUIRED)
     find_package(KF5Plasma ${KF_DEP_VERSION} REQUIRED)
+else()
+    set(KF5Plasma_FOUND 0)
 endif()
 
 find_package(KF5Activities ${KF_DEP_VERSION})
@@ -77,10 +88,6 @@
         PACKAGE_SETUP_AUTOMOC_VARIABLES
 )
 
-add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00) # must port away from 
qmlRegisterInterface before upgrading this to 050f00
-add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055100)
-add_definitions(-DPLASMA_DISABLE_DEPRECATED_BEFORE_AND_AT=0x050500) # needed 
because we use Plasma::Package in the API
-
 # Subdirectories
 add_subdirectory(src)
 if (BUILD_TESTING)
@@ -120,7 +127,7 @@
         NAMESPACE KF5::)
 
 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/krunner_version.h"
-        DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF}"
+        DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF}/KRunner"
         COMPONENT Devel)
 
 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/KF5RunnerConfig.cmake.in 
new/krunner-5.91.0/KF5RunnerConfig.cmake.in
--- old/krunner-5.90.0/KF5RunnerConfig.cmake.in 2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/KF5RunnerConfig.cmake.in 2022-02-05 16:17:18.000000000 
+0100
@@ -5,8 +5,12 @@
 @PACKAGE_INIT@
 
 include(CMakeFindDependencyMacro)
-find_dependency(Qt@QT_MAJOR_VERSION@Core "@REQUIRED_QT_VERSION@")
-find_dependency(KF5Plasma "@KF_DEP_VERSION@")
+find_dependency(Qt@QT_MAJOR_VERSION@ @REQUIRED_QT_VERSION@ CONFIG REQUIRED 
Core Gui)
+find_dependency(KF5CoreAddons "@KF_DEP_VERSION@") # KPluginFactory
+find_dependency(KF5Config "@KF_DEP_VERSION@") # KConfigGroup
+if (@KF5Plasma_FOUND@)
+    find_dependency(KF5Plasma "@KF_DEP_VERSION@") # Deprecated Plasma version 
headers
+endif()
 
 @PACKAGE_SETUP_AUTOMOC_VARIABLES@
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/autotests/CMakeLists.txt 
new/krunner-5.91.0/autotests/CMakeLists.txt
--- old/krunner-5.90.0/autotests/CMakeLists.txt 2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/autotests/CMakeLists.txt 2022-02-05 16:17:18.000000000 
+0100
@@ -17,22 +17,31 @@
 
 ecm_add_tests(
    dbusrunnertest.cpp
-   LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets
+   LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::DBus
 )
 ecm_add_tests(
         runnermatchmethodstest.cpp
-    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets
+    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets
 )
 
 
+kcoreaddons_add_plugin(fakerunnerplugin SOURCES fakerunnerplugin.cpp 
INSTALL_NAMESPACE "krunnertest" STATIC)
+target_link_libraries(fakerunnerplugin  KF5Runner)
+kcoreaddons_desktop_to_json(fakerunnerplugin metadatafile1.desktop)
 ecm_add_tests(
     runnermanagerhistorytest.cpp
-    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets
+    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets
 )
+kcoreaddons_target_static_plugins(runnermanagerhistorytest krunnertest)
 
 ecm_add_tests(
     runnermanagersinglerunnermodetest.cpp
-    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::DBus
+    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::DBus
+)
+
+ecm_add_tests(
+    runnermanagertest.cpp
+    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5Runner 
Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::DBus
 )
 
 add_executable(testremoterunner)
@@ -47,3 +56,4 @@
 include(../KF5KRunnerMacros.cmake)
 configure_krunner_test(dbusrunnertest testremoterunner DESKTOP_FILE 
"${CMAKE_CURRENT_SOURCE_DIR}/dbusrunnertest.desktop")
 configure_krunner_test(runnermanagersinglerunnermodetest testremoterunner 
DESKTOP_FILE "${CMAKE_CURRENT_SOURCE_DIR}/dbusrunnertest.desktop")
+configure_krunner_test(runnermanagertest testremoterunner DESKTOP_FILE 
"${CMAKE_CURRENT_SOURCE_DIR}/dbusrunnertest.desktop")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/autotests/dbusrunnertest.cpp 
new/krunner-5.91.0/autotests/dbusrunnertest.cpp
--- old/krunner-5.90.0/autotests/dbusrunnertest.cpp     2022-01-01 
13:19:01.000000000 +0100
+++ new/krunner-5.91.0/autotests/dbusrunnertest.cpp     2022-02-05 
16:17:18.000000000 +0100
@@ -6,9 +6,13 @@
 
 #include "runnermanager.h"
 
+#ifdef KSERVICE_BUILD_DEPRECATED_SINCE
 #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && 
KSERVICE_BUILD_DEPRECATED_SINCE(5, 0)
 #define WITH_KSERVICE 1
-#else
+#endif
+#endif
+
+#ifndef WITH_KSERVICE
 #define WITH_KSERVICE 0
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/autotests/fakerunner.h 
new/krunner-5.91.0/autotests/fakerunner.h
--- old/krunner-5.90.0/autotests/fakerunner.h   2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/autotests/fakerunner.h   2022-02-05 16:17:18.000000000 
+0100
@@ -10,8 +10,12 @@
 class FakeRunner : public AbstractRunner
 {
 public:
+    FakeRunner(QObject *parent, const KPluginMetaData &metadata, const 
QVariantList &args)
+        : AbstractRunner(parent, metadata, args)
+    {
+    }
     FakeRunner(const KPluginMetaData &metadata = 
KPluginMetaData(QStringLiteral("metadata.desktop")))
-        : AbstractRunner(nullptr, metadata, QVariantList())
+        : FakeRunner(nullptr, metadata, {})
     {
     }
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/autotests/fakerunnerplugin.cpp 
new/krunner-5.91.0/autotests/fakerunnerplugin.cpp
--- old/krunner-5.90.0/autotests/fakerunnerplugin.cpp   1970-01-01 
01:00:00.000000000 +0100
+++ new/krunner-5.91.0/autotests/fakerunnerplugin.cpp   2022-02-05 
16:17:18.000000000 +0100
@@ -0,0 +1,10 @@
+/*
+    SPDX-FileCopyrightText: 2021 Alexander Lohnau <[email protected]>
+    SPDX-License-Identifier: LicenseRef-KDE-Accepted-GPL
+*/
+
+#include "fakerunner.h"
+
+K_PLUGIN_CLASS_WITH_JSON(FakeRunner, "metadatafile1.json")
+
+#include "fakerunnerplugin.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/krunner-5.90.0/autotests/runnermanagerhistorytest.cpp 
new/krunner-5.91.0/autotests/runnermanagerhistorytest.cpp
--- old/krunner-5.90.0/autotests/runnermanagerhistorytest.cpp   2022-01-01 
13:19:01.000000000 +0100
+++ new/krunner-5.91.0/autotests/runnermanagerhistorytest.cpp   2022-02-05 
16:17:18.000000000 +0100
@@ -21,9 +21,9 @@
 private:
     void addToHistory(const QStringList &queries, RunnerManager &manager)
     {
-        FakeRunner runner;
+        QCOMPARE(manager.runners().count(), 1);
         for (const QString &query : queries) {
-            QueryMatch match(&runner);
+            QueryMatch match(manager.runners().constFirst());
             // Make sure internally the term and untrimmedTerm are set
             manager.launchQuery(query, "thisrunnerdoesnotexist");
             manager.searchContext()->setQuery(query);
@@ -51,6 +51,8 @@
     QFETCH(const QStringList, expectedEntries);
 
     RunnerManager manager;
+    manager.setAllowedRunners({QStringLiteral("fakerunnerplugin")});
+    
manager.loadRunner(KPluginMetaData::findPluginById(QStringLiteral("krunnertest"),
 QStringLiteral("fakerunnerplugin")));
     addToHistory(queries, manager);
     QCOMPARE(manager.history(), expectedEntries);
 }
@@ -69,6 +71,8 @@
 void RunnerManagerHistoryTest::testHistorySuggestionsAndRemoving()
 {
     RunnerManager manager;
+    manager.setAllowedRunners({QStringLiteral("fakerunnerplugin")});
+    
manager.loadRunner(KPluginMetaData::findPluginById(QStringLiteral("krunnertest"),
 QStringLiteral("fakerunnerplugin")));
     const QStringList queries = {"test1", "test2", "test3"};
     addToHistory(queries, manager);
     QStringList expectedBeforeRemoval = QStringList{"test3", "test2", "test1"};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/autotests/runnermanagertest.cpp 
new/krunner-5.91.0/autotests/runnermanagertest.cpp
--- old/krunner-5.90.0/autotests/runnermanagertest.cpp  1970-01-01 
01:00:00.000000000 +0100
+++ new/krunner-5.91.0/autotests/runnermanagertest.cpp  2022-02-05 
16:17:18.000000000 +0100
@@ -0,0 +1,109 @@
+/*
+    SPDX-FileCopyrightText: 2022 Eduardo Cruz <[email protected]>
+    SPDX-License-Identifier: LGPL-2.1-or-later
+*/
+
+#include "runnermanager.h"
+#include "fakerunner.h"
+
+#include <KSharedConfig>
+#include <QAction>
+#include <QCoreApplication>
+#include <QObject>
+#include <QProcess>
+#include <QStandardPaths>
+#include <QTest>
+
+#include "abstractrunnertest.h"
+
+Q_DECLARE_METATYPE(Plasma::QueryMatch)
+Q_DECLARE_METATYPE(QList<Plasma::QueryMatch>)
+
+using namespace Plasma;
+
+class RunnerManagerTest : public AbstractRunnerTest
+{
+    Q_OBJECT
+private Q_SLOTS:
+    void loadRunner()
+    {
+        startDBusRunnerProcess({QStringLiteral("net.krunnertests.dave")});
+        qputenv("XDG_DATA_DIRS", 
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation).toLocal8Bit());
+        QCoreApplication::setLibraryPaths(QStringList());
+        initProperties();
+        auto md = 
KPluginMetaData::fromDesktopFile(QFINDTESTDATA("dbusrunnertestmulti.desktop"), 
{QStringLiteral("plasma-runner.desktop")});
+        QVERIFY(md.isValid());
+        manager->loadRunner(md);
+    }
+
+    void cleanup()
+    {
+        killRunningDBusProcesses();
+    }
+
+    void init()
+    {
+        qRegisterMetaType<QList<Plasma::QueryMatch>>();
+    }
+
+    /**
+     * This will test the mechanismm that stalls for 250ms before emiting any 
result in RunnerManager::scheduleMatchesChanged()
+     * and the mechanism that anticipates the last results emission in 
RunnerManager::jobDone().
+     */
+    void testScheduleMatchesChanged()
+    {
+        loadRunner();
+        QSignalSpy spyQueryFinished(manager.get(), 
&Plasma::RunnerManager::queryFinished);
+        QSignalSpy spyMatchesChanged(manager.get(), 
&Plasma::RunnerManager::matchesChanged);
+
+        QVERIFY(spyQueryFinished.isValid());
+        QVERIFY(spyMatchesChanged.isValid());
+
+        QCOMPARE(spyQueryFinished.count(), 0);
+
+        // This will track the total execution time
+        QElapsedTimer timer;
+        timer.start();
+
+        // This special string will simulate a 300ms delay
+        manager->launchQuery("fooDelay300");
+
+        // We will have one queryFinished emission immediately signaled by 
RunnerManager::reset()
+        QCOMPARE(spyQueryFinished.count(), 1);
+
+        // However not yet a matcheschanged, it should be stalled for 250ms
+        QCOMPARE(spyMatchesChanged.count(), 0);
+
+        // After 250ms it will emit with empty matches, we wait for that
+        QVERIFY(spyMatchesChanged.wait(265)); // 265ms as a margin of safety 
for 250ms
+
+        // This should have taken no less than 250ms. It waits for 250s before 
"giving up" and emitting an empty matches list.
+        QVERIFY(timer.elapsed() >= 250);
+        QCOMPARE(spyMatchesChanged.count(), 1);
+        QCOMPARE(manager->matches().count(), 0); // This is the empty matches 
"reset" emission, result is not ready yet
+        QCOMPARE(spyQueryFinished.count(), 1); // Still the same, query is not 
done
+
+        // We programmed it to emit the result after 300ms, so we need to wait 
50ms more for the next emission
+        QVERIFY(spyQueryFinished.wait(65)); // 65ms as a margin of safety for 
50ms
+
+        // This should have taken at least 300ms total, as we requested via 
the special query string
+        QVERIFY(timer.elapsed() >= 300);
+
+        // RunnerManager::jobDone() should have anticipated the final 
emission, so it should not have waited the full 250+250 ms.
+        QVERIFY(timer.elapsed() <= 330); // This total should be just a tad 
bigger than 300ms, we put a 10% margin of safety
+
+        QCOMPARE(spyMatchesChanged.count(), 2); // We had the second 
matchesChanged emission, now with the query result
+        QCOMPARE(manager->matches().count(), 1); // The result is here
+        QCOMPARE(spyQueryFinished.count(), 2); // Will have emited 
queryFinished, job is done
+
+        // Now we will make sure that RunnerManager::scheduleMatchesChanged() 
emits matchesChanged instantly
+        // if we start a query with an empty string. It will never produce 
results, stalling is meaninless
+        manager->launchQuery("");
+        QCOMPARE(spyMatchesChanged.count(), 3); // One more, instantly, 
without stall
+        QCOMPARE(manager->matches().count(), 0); // Empty results for empty 
query string
+    }
+};
+
+QTEST_MAIN(RunnerManagerTest)
+
+#include "runnermanagertest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/autotests/testremoterunner.cpp 
new/krunner-5.91.0/autotests/testremoterunner.cpp
--- old/krunner-5.90.0/autotests/testremoterunner.cpp   2022-01-01 
13:19:01.000000000 +0100
+++ new/krunner-5.91.0/autotests/testremoterunner.cpp   2022-02-05 
16:17:18.000000000 +0100
@@ -57,6 +57,19 @@
         m.properties[QStringLiteral("icon-data")] = 
QVariant::fromValue(serializeImage(icon));
 
         ms << m;
+    } else if (searchTerm.startsWith(QLatin1String("fooDelay"))) {
+        // This special query string "fooDelayNNNN" allows us to introduce a 
desired delay
+        // to simulate a slow query
+        const int requestedDelayMs = searchTerm.mid(8).toInt();
+        RemoteMatch m;
+        m.id = QStringLiteral("id3");
+        m.text = QStringLiteral("Match 1");
+        m.iconName = QStringLiteral("icon1");
+        m.type = Plasma::QueryMatch::ExactMatch;
+        m.relevance = 0.8;
+        m.properties[QStringLiteral("actions")] = 
QStringList(QStringLiteral("action1"));
+        QThread::msleep(requestedDelayMs);
+        ms << m;
     } else if (searchTerm.contains(QLatin1String("foo"))) {
         RemoteMatch m;
         m.id = QStringLiteral("id1");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/CMakeLists.txt 
new/krunner-5.91.0/src/CMakeLists.txt
--- old/krunner-5.90.0/src/CMakeLists.txt       2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/CMakeLists.txt       2022-02-05 16:17:18.000000000 
+0100
@@ -61,22 +61,23 @@
 target_link_libraries(KF5Runner
     PUBLIC
         Qt${QT_MAJOR_VERSION}::Core
+        KF5::I18n
+        KF5::ConfigCore
+        Qt${QT_MAJOR_VERSION}::Gui # QIcon
+        KF5::CoreAddons # KPluginFactory
     PRIVATE
         Qt${QT_MAJOR_VERSION}::DBus
-        Qt${QT_MAJOR_VERSION}::Gui
         Qt${QT_MAJOR_VERSION}::Widgets
-        KF5::ConfigCore
-        KF5::Service
-        KF5::I18n
         KF5::ThreadWeaver
-        KF5::CoreAddons #KShell
-        KF5::KIOCore #KProtocolInfo
 )
 if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
-   EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.65.0)
+   EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.91.0)
     target_link_libraries(KF5Runner
         PUBLIC
+            KF5::Service # KPluginInfo
             KF5::Plasma # Must be public because abstractrunner.h needs 
plasma/version.h
+        PRIVATE
+            KF5::KIOCore #KProtocolInfo
     )
 endif()
 if(HAVE_KACTIVITIES)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/abstractrunner.cpp 
new/krunner-5.91.0/src/abstractrunner.cpp
--- old/krunner-5.90.0/src/abstractrunner.cpp   2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/abstractrunner.cpp   2022-02-05 16:17:18.000000000 
+0100
@@ -5,6 +5,11 @@
 */
 
 #include "abstractrunner.h"
+
+#ifndef KSERVICE_BUILD_DEPRECATED_SINCE
+#define KSERVICE_BUILD_DEPRECATED_SINCE(a, b) 0
+#endif
+
 #include "abstractrunner_p.h"
 
 #include <QAction>
@@ -365,7 +370,10 @@
 #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72)
 KPluginInfo AbstractRunner::metadata() const
 {
+    QT_WARNING_PUSH
+    QT_WARNING_DISABLE_DEPRECATED
     return KPluginInfo::fromMetaData(d->runnerDescription);
+    QT_WARNING_POP
 }
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/abstractrunner.h 
new/krunner-5.91.0/src/abstractrunner.h
--- old/krunner-5.90.0/src/abstractrunner.h     2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/abstractrunner.h     2022-02-05 16:17:18.000000000 
+0100
@@ -12,12 +12,17 @@
 #include <QStringList>
 
 #include <KConfigGroup>
-#include <KPluginInfo>
 #include <KPluginMetaData>
-#include <KService>
 
 #include "krunner_export.h"
 
+#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 91)
+#include <KPluginInfo>
+#include <KService>
+#else
+#include <KPluginFactory>
+#endif
+
 #if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 65)
 #include <plasma/plasma_export.h> // for PLASMA_ENABLE_DEPRECATED_SINCE
 #include <plasma_version.h>
@@ -743,4 +748,12 @@
 #endif
 // clang-format on
 
+#if !KRUNNER_ENABLE_DEPRECATED_SINCE(5, 91)
+namespace KRunner
+{
+using AbstractRunner = Plasma::AbstractRunner;
+using RunnerContext = Plasma::RunnerContext;
+}
+#endif
+
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/declarative/CMakeLists.txt 
new/krunner-5.91.0/src/declarative/CMakeLists.txt
--- old/krunner-5.90.0/src/declarative/CMakeLists.txt   2022-01-01 
13:19:01.000000000 +0100
+++ new/krunner-5.91.0/src/declarative/CMakeLists.txt   2022-02-05 
16:17:18.000000000 +0100
@@ -2,6 +2,9 @@
 # SPDX-License-Identifier: BSD-2-Clause
 project(runnermodel)
 
+# we depend on deprecated Qt API, however the QML plugin is deprecated and not 
worth porting
+remove_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x50f02)
+
 add_library(runnermodelplugin SHARED)
 
 target_sources(runnermodelplugin PRIVATE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/querymatch.cpp 
new/krunner-5.91.0/src/querymatch.cpp
--- old/krunner-5.90.0/src/querymatch.cpp       2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/querymatch.cpp       2022-02-05 16:17:18.000000000 
+0100
@@ -8,6 +8,7 @@
 
 #include <QAction>
 #include <QIcon>
+#include <QPointer>
 #include <QReadWriteLock>
 #include <QSharedData>
 #include <QVariant>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/querymatch.h 
new/krunner-5.91.0/src/querymatch.h
--- old/krunner-5.90.0/src/querymatch.h 2022-01-01 13:19:01.000000000 +0100
+++ new/krunner-5.91.0/src/querymatch.h 2022-02-05 16:17:18.000000000 +0100
@@ -347,4 +347,12 @@
 
 }
 
+#if !KRUNNER_ENABLE_DEPRECATED_SINCE(5, 91)
+namespace KRunner
+{
+using QueryMatch = Plasma::QueryMatch;
+using AbstractRunner = Plasma::AbstractRunner;
+}
+#endif
+
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/runnercontext.cpp 
new/krunner-5.91.0/src/runnercontext.cpp
--- old/krunner-5.90.0/src/runnercontext.cpp    2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/runnercontext.cpp    2022-02-05 16:17:18.000000000 
+0100
@@ -19,9 +19,12 @@
 #include <QUrl>
 
 #include <KConfigGroup>
-#include <KProtocolInfo>
 #include <KShell>
 
+#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76)
+#include <KProtocolInfo>
+#endif
+
 #include "abstractrunner.h"
 #include "krunner_debug.h"
 #include "querymatch.h"
@@ -234,12 +237,10 @@
     // we still have to remove all the matches, since if the
     // ref count was 1 (e.g. only the RunnerContext is using
     // the dptr) then we won't get a copy made
-    if (!d->matches.isEmpty()) {
-        d->matches.clear();
-        Q_EMIT matchesChanged();
-    }
-
+    d->matches.clear();
     d->term.clear();
+    Q_EMIT matchesChanged();
+
     d->mimeType.clear();
     d->uniqueIds.clear();
     d->type = UnknownType;
@@ -249,7 +250,9 @@
 
 void RunnerContext::setQuery(const QString &term)
 {
-    reset();
+    if (!this->query().isEmpty()) {
+        reset();
+    }
 
     if (term.isEmpty()) {
         return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/runnermanager.cpp 
new/krunner-5.91.0/src/runnermanager.cpp
--- old/krunner-5.90.0/src/runnermanager.cpp    2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/runnermanager.cpp    2022-02-05 16:17:18.000000000 
+0100
@@ -18,7 +18,11 @@
 #include <KConfigWatcher>
 #include <KFileUtils>
 #include <KPluginMetaData>
+#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72)
 #include <KServiceTypeTrader>
+#else
+#define KSERVICE_BUILD_DEPRECATED_SINCE(a, b) 0
+#endif
 #include <KSharedConfig>
 
 #include "config.h"
@@ -43,7 +47,7 @@
 
 namespace Plasma
 {
-#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0)
+#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && 
KSERVICE_BUILD_DEPRECATED_SINCE(5, 0)
 void warnAboutDeprecatedMetaData(const KPluginInfo &pluginInfo)
 {
     if (!pluginInfo.libraryPath().isEmpty()) {
@@ -63,6 +67,7 @@
         : q(parent)
     {
         matchChangeTimer.setSingleShot(true);
+        matchChangeTimer.setTimerType(Qt::TimerType::PreciseTimer); // Without 
this, autotest will fail due to imprecision of this timer
         delayTimer.setSingleShot(true);
 
         QObject::connect(&matchChangeTimer, &QTimer::timeout, q, [this]() {
@@ -84,11 +89,28 @@
 
     void scheduleMatchesChanged()
     {
-        if (lastMatchChangeSignalled.hasExpired(250)) {
+        // We avoid over-refreshing the client. We only refresh every this 
much milliseconds
+        constexpr int refreshPeriod = 250;
+        // This will tell us if we are reseting the matches to start a new 
search. RunnerContext::reset() clears its query string for its emission
+        if (context.query().isEmpty()) {
+            matchChangeTimer.stop();
+            // This actually contains the query string for the new search that 
we're launching (if any):
+            if (!this->untrimmedTerm.trimmed().isEmpty()) {
+                // We are starting a new search, we shall stall for some time 
before deciding to show an empty matches list.
+                // This stall should be enough for the engine to provide more 
meaningful result, so we avoid refreshing with
+                // an empty results list if possible.
+                matchChangeTimer.start(refreshPeriod);
+                // We "pretend" that we have refreshed it so the next call 
will be forced to wait the timeout:
+                lastMatchChangeSignalled.restart();
+            } else {
+                // We have an empty input string, so it's not a real query. We 
don't expect any results to come, so no need to stall
+                Q_EMIT q->matchesChanged(context.matches());
+            }
+        } else if (lastMatchChangeSignalled.hasExpired(refreshPeriod)) {
             matchChangeTimer.stop();
             Q_EMIT q->matchesChanged(context.matches());
         } else {
-            matchChangeTimer.start(250 - lastMatchChangeSignalled.elapsed());
+            matchChangeTimer.start(refreshPeriod - 
lastMatchChangeSignalled.elapsed());
         }
     }
 
@@ -315,13 +337,17 @@
         searchJobs.remove(runJob);
         oldSearchJobs.remove(runJob);
 
-        if (searchJobs.isEmpty() && context.matches().isEmpty()) {
-            // we finished our run, and there are no valid matches, and so no
-            // signal will have been sent out. so we need to emit the signal
-            // ourselves here
-            Q_EMIT q->matchesChanged(context.matches());
-        }
         if (searchJobs.isEmpty()) {
+            // If there are any new matches scheduled to be notified, we 
should anticipate it and just refresh right now
+            if (matchChangeTimer.isActive()) {
+                matchChangeTimer.stop();
+                Q_EMIT q->matchesChanged(context.matches());
+            } else if (context.matches().isEmpty()) {
+                // we finished our run, and there are no valid matches, and so 
no
+                // signal will have been sent out. so we need to emit the 
signal
+                // ourselves here
+                Q_EMIT q->matchesChanged(context.matches());
+            }
             Q_EMIT q->queryFinished();
         }
     }
@@ -806,10 +832,9 @@
     const QString constraint = parentApp.isEmpty() ? QStringLiteral("not exist 
[X-KDE-ParentApp] or [X-KDE-ParentApp] == ''")
                                                    : 
QStringLiteral("[X-KDE-ParentApp] == '") + parentApp + QLatin1Char('\'');
 
-    const KService::List offers = 
KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), constraint);
     QT_WARNING_PUSH
-    QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
-    QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
+    QT_WARNING_DISABLE_DEPRECATED
+    const KService::List offers = 
KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), constraint);
     const KPluginInfo::List backwardCompatPluginInfos = 
KPluginInfo::fromServices(offers);
     QT_WARNING_POP
 
@@ -827,7 +852,7 @@
 
 QVector<KPluginMetaData> RunnerManager::runnerMetaDataList()
 {
-    QVector<KPluginMetaData> pluginMetaDatas = 
KPluginMetaData::findPlugins(QStringLiteral("kf5/krunner"));
+    QVector<KPluginMetaData> pluginMetaDatas = 
KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR) 
"/krunner"));
     QSet<QString> knownRunnerIds;
     knownRunnerIds.reserve(pluginMetaDatas.size());
     for (const KPluginMetaData &pluginMetaData : 
std::as_const(pluginMetaDatas)) {
@@ -845,12 +870,11 @@
         }
     }
 
-#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0)
+#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && 
KSERVICE_BUILD_DEPRECATED_SINCE(5, 0)
     // also search for deprecated kservice-based KRunner plugins metadata
-    const KService::List offers = 
KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"));
     QT_WARNING_PUSH
-    QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
-    QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
+    QT_WARNING_DISABLE_DEPRECATED
+    const KService::List offers = 
KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"));
     const KPluginInfo::List backwardCompatPluginInfos = 
KPluginInfo::fromServices(offers);
     QT_WARNING_POP
 
@@ -868,7 +892,10 @@
 #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72)
 KPluginInfo::List RunnerManager::listRunnerInfo(const QString &parentApp)
 {
+    QT_WARNING_PUSH
+    QT_WARNING_DISABLE_DEPRECATED
     return KPluginInfo::fromMetaData(runnerMetaDataList(parentApp));
+    QT_WARNING_POP
 }
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/runnermanager.h 
new/krunner-5.91.0/src/runnermanager.h
--- old/krunner-5.90.0/src/runnermanager.h      2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/runnermanager.h      2022-02-05 16:17:18.000000000 
+0100
@@ -12,13 +12,16 @@
 #include <QList>
 #include <QObject>
 
+#include "krunner_export.h"
+
+#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 91)
 #include <KPluginInfo>
+#endif
 #include <KPluginMetaData>
 
 #include <memory>
 
 #include "abstractrunner.h"
-#include "krunner_export.h"
 
 class QAction;
 class KConfigGroup;
@@ -309,7 +312,7 @@
     void loadRunner(const QString &path);
 #endif
 
-#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 77)
+#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 88)
     /**
      * @return the list of allowed plugins
      * @since 4.4
@@ -466,5 +469,11 @@
 };
 
 }
+#if !KRUNNER_ENABLE_DEPRECATED_SINCE(5, 91)
+namespace KRunner
+{
+using RunnerManager = Plasma::RunnerManager;
+}
+#endif
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/krunner-5.90.0/src/runnersyntax.h 
new/krunner-5.91.0/src/runnersyntax.h
--- old/krunner-5.90.0/src/runnersyntax.h       2022-01-01 13:19:01.000000000 
+0100
+++ new/krunner-5.91.0/src/runnersyntax.h       2022-02-05 16:17:18.000000000 
+0100
@@ -132,4 +132,11 @@
 
 } // namespace Plasma
 
+#if !KRUNNER_ENABLE_DEPRECATED_SINCE(5, 91)
+namespace KRunner
+{
+using RunnerSyntax = Plasma::RunnerSyntax;
+}
+#endif
+
 #endif // multiple inclusion guard

Reply via email to