Hello community, here is the log from the commit of package krunner for openSUSE:Factory checked in at 2020-11-19 11:51:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/krunner (Old) and /work/SRC/openSUSE:Factory/.krunner.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "krunner" Thu Nov 19 11:51:34 2020 rev:83 rq:848578 version:5.76.0 Changes: -------- --- /work/SRC/openSUSE:Factory/krunner/krunner.changes 2020-10-12 13:57:58.874182739 +0200 +++ /work/SRC/openSUSE:Factory/.krunner.new.5913/krunner.changes 2020-11-23 10:33:01.621528112 +0100 @@ -1,0 +2,9 @@ +Sat Nov 7 21:35:16 UTC 2020 - Christophe Giboudeaux <[email protected]> + +- Update to 5.76.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/kde-frameworks-5.76.0 +- Too many changes to list here. + +------------------------------------------------------------------- Old: ---- krunner-5.75.0.tar.xz krunner-5.75.0.tar.xz.sig New: ---- krunner-5.76.0.tar.xz krunner-5.76.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ krunner.spec ++++++ --- /var/tmp/diff_new_pack.CoqQDo/_old 2020-11-23 10:33:02.289528845 +0100 +++ /var/tmp/diff_new_pack.CoqQDo/_new 2020-11-23 10:33:02.293528849 +0100 @@ -17,7 +17,7 @@ %define lname libKF5Runner5 -%define _tar_path 5.75 +%define _tar_path 5.76 # 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 lang Name: krunner -Version: 5.75.0 +Version: 5.76.0 Release: 0 Summary: KDE Framework for providing different actions given a string query License: LGPL-2.1-or-later ++++++ krunner-5.75.0.tar.xz -> krunner-5.76.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/CMakeLists.txt new/krunner-5.76.0/CMakeLists.txt --- old/krunner-5.75.0/CMakeLists.txt 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/CMakeLists.txt 2020-11-07 13:04:28.000000000 +0100 @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.75.0") # handled by release scripts -set(KF5_DEP_VERSION "5.75.0") # handled by release scripts +set(KF5_VERSION "5.76.0") # handled by release scripts +set(KF5_DEP_VERSION "5.76.0") # handled by release scripts project(KRunner VERSION ${KF5_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.75.0 NO_MODULE) +find_package(ECM 5.76.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) @@ -60,7 +60,7 @@ ) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00) -add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054900) +add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054B00) add_definitions(-DPLASMA_DISABLE_DEPRECATED_BEFORE_AND_AT=0x050500) # needed because we use Plasma::Package in the API add_definitions(-DQT_NO_FOREACH -DQT_NO_KEYWORDS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/autotests/CMakeLists.txt new/krunner-5.76.0/autotests/CMakeLists.txt --- old/krunner-5.75.0/autotests/CMakeLists.txt 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/autotests/CMakeLists.txt 2020-11-07 13:04:28.000000000 +0100 @@ -2,10 +2,13 @@ include(ECMAddTests) -ecm_add_tests( - runnercontexttest.cpp - LINK_LIBRARIES Qt5::Test KF5::KIOCore KF5Runner -) +if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND + EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.76.0) + ecm_add_tests( + runnercontexttest.cpp + LINK_LIBRARIES Qt5::Test KF5::KIOCore KF5Runner + ) +endif() ecm_add_tests( dbusrunnertest.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/autotests/runnercontexttest.cpp new/krunner-5.76.0/autotests/runnercontexttest.cpp --- old/krunner-5.75.0/autotests/runnercontexttest.cpp 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/autotests/runnercontexttest.cpp 2020-11-07 13:04:28.000000000 +0100 @@ -6,8 +6,6 @@ #include "runnercontexttest.h" -#include "runnercontext.h" - #include <KProtocolInfo> #include <QDir> @@ -50,6 +48,9 @@ QTest::newRow("invalid protocol-less path") << "/bad/path" << Plasma::RunnerContext::UnknownType; QTest::newRow("calculation") << "5*4" << Plasma::RunnerContext::UnknownType; QTest::newRow("calculation (float)") << "5.2*4" << Plasma::RunnerContext::UnknownType; + // These are not real file paths, see BUG 342876 + QTest::newRow("Invalid casing dir path") << "/UsR" << Plasma::RunnerContext::UnknownType; + QTest::newRow("Invalid casing file path") << "/bin/TruE" << Plasma::RunnerContext::UnknownType; } void RunnerContextTest::typeDetection() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/metainfo.yaml new/krunner-5.76.0/metainfo.yaml --- old/krunner-5.75.0/metainfo.yaml 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/metainfo.yaml 2020-11-07 13:04:28.000000000 +0100 @@ -1,4 +1,4 @@ -maintainer: broulik +maintainer: alex description: Parallelized query system tier: 3 type: solution diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/CMakeLists.txt new/krunner-5.76.0/src/CMakeLists.txt --- old/krunner-5.75.0/src/CMakeLists.txt 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/CMakeLists.txt 2020-11-07 13:04:28.000000000 +0100 @@ -32,7 +32,7 @@ GROUP_BASE_NAME KF VERSION ${KF5_VERSION} DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 5.28 5.71 5.72 5.73 + DEPRECATION_VERSIONS 5.28 5.71 5.72 5.73 5.76 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/abstractrunner.cpp new/krunner-5.76.0/src/abstractrunner.cpp --- old/krunner-5.75.0/src/abstractrunner.cpp 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/abstractrunner.cpp 2020-11-07 13:04:28.000000000 +0100 @@ -20,8 +20,6 @@ #endif #include "krunner_debug.h" -#include "querymatch.h" -#include "runnercontext.h" namespace Plasma { @@ -102,11 +100,13 @@ d->syntaxes.append(syntax); } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) void AbstractRunner::setDefaultSyntax(const RunnerSyntax &syntax) { d->syntaxes.append(syntax); d->defaultSyntax = &(d->syntaxes.last()); } +#endif void AbstractRunner::setSyntaxes(const QList<RunnerSyntax> &syntaxes) { @@ -118,20 +118,18 @@ return d->syntaxes; } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) RunnerSyntax *AbstractRunner::defaultSyntax() const { return d->defaultSyntax; } +#endif void AbstractRunner::performMatch(Plasma::RunnerContext &localContext) { static const int reasonableRunTime = 1500; static const int fastEnoughTime = 250; - if (d->suspendMatching) { - return; - } - QElapsedTimer time; time.start(); @@ -261,15 +259,19 @@ d->priority = priority; } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) RunnerContext::Types AbstractRunner::ignoredTypes() const { return d->blackListed; } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) void AbstractRunner::setIgnoredTypes(RunnerContext::Types types) { d->blackListed = types; } +#endif void AbstractRunner::run(const Plasma::RunnerContext &search, const Plasma::QueryMatch &action) { @@ -277,15 +279,19 @@ Q_UNUSED(action); } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QStringList AbstractRunner::categories() const { return QStringList() << name(); } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QIcon AbstractRunner::categoryIcon(const QString&) const { return icon(); } +#endif void AbstractRunner::match(Plasma::RunnerContext &) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/abstractrunner.h new/krunner-5.76.0/src/abstractrunner.h --- old/krunner-5.75.0/src/abstractrunner.h 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/abstractrunner.h 2020-11-07 13:04:28.000000000 +0100 @@ -175,6 +175,7 @@ */ virtual void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match); +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) /** * Return a list of categories that this runner provides. By default * this list just contains the runners name. It is used by the runner manager @@ -183,17 +184,24 @@ * * This list of categories is also used to provide a better way to * configure the runner instead of the typical on / off switch. + * @deprecated Since 5.76, feature is unused. You can still set the category property in the QueryMatch */ + KRUNNER_DEPRECATED_VERSION(5, 76, "Feature is unused") virtual QStringList categories() const; +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) /** * Returns the icon which accurately describes the category \p category. * This is meant to be used in a configuration dialog when showing * all the categories. * * By default this returns the icon of the AbstractRunner + * * @deprecated Since 5.0, feature removed */ + KRUNNER_DEPRECATED_VERSION_BELATED(5, 76, 5, 0, "No longer use, feature removed") virtual QIcon categoryIcon(const QString& category) const; +#endif /** * The nominal speed of the runner. @@ -207,18 +215,40 @@ */ Priority priority() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * Returns the OR'ed value of all the Information types (as defined in RunnerContext::Type) * this runner is not interested in. * @return OR'ed value of black listed types + * @deprecated This feature is deprecated */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is deprecated") RunnerContext::Types ignoredTypes() const; +#endif +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** - * Sets the types this runner will ignore + * Sets the types this runner will ignore. If the value from RunnerContext::type() is contained in the ignored types + * the match() method won't be called. This way there is no unnecessary thread spawned. The same RunnerContext from + * which the type gets read is later passed into the match(Plasma::RunnerContext &context) method call. * @param types OR'ed listed of ignored types + * @deprecated feature is deprecated. Consider using the minLetterCount and matchRegex properties instead. These + * properties also prevent thread spawning, but can be used far more precise. + * If you want to have this kind of optimization for older KRunner versions you could wrap this + * inside of an version if statement: + * @code + #if KRUNNER_VERSION < QT_VERSION_CHECK(5, 76, 0) + //set ignore types + #endif + * @endcode + * The minLetterCount and matchRegex can be set with a similar version check or added to the desktop file. + * If an older KRunner version loads such a desktop file these unknown properties are just ignored. + * @see minLetterCount + * @see matchRegex */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is deprecated. Consider using the minLetterCount and matchRegex properties instead") void setIgnoredTypes(RunnerContext::Types types); +#endif /** * @return the user visible engine name for the Runner @@ -296,12 +326,16 @@ */ QList<RunnerSyntax> syntaxes() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * @return the default syntax for the runner or @c nullptr if no default syntax has been defined * * @since 4.4 + * @deprecated Since 5.76, feature is unused. */ + KRUNNER_DEPRECATED_VERSION(5, 76, "No longer use, feature is unused") RunnerSyntax *defaultSyntax() const; +#endif /** * @return true if the runner is currently busy with non-interuptable work, signaling that @@ -509,6 +543,7 @@ */ void addSyntax(const RunnerSyntax &syntax); +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * Set @p syntax as the default syntax for the runner; the default syntax will be * substituted to the empty query in single runner mode. This is also used to @@ -522,8 +557,11 @@ * * @param syntax the syntax to register and to set as default * @since 4.4 + * @deprecated Since 5.76, feature is unused. Use addSyntax() instead. **/ + KRUNNER_DEPRECATED_VERSION(5, 76, "Feature unused, use addSyntax() instead") void setDefaultSyntax(const RunnerSyntax &syntax); +#endif /** * Sets the list of syntaxes; passing in an empty list effectively clears diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/runnercontext.cpp new/krunner-5.76.0/src/runnercontext.cpp --- old/krunner-5.75.0/src/runnercontext.cpp 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/runnercontext.cpp 2020-11-07 13:04:28.000000000 +0100 @@ -26,10 +26,6 @@ #include "abstractrunner.h" #include "querymatch.h" -//#define LOCK_FOR_READ(d) if (d->policy == Shared) { d->lock.lockForRead(); } -//#define LOCK_FOR_WRITE(d) if (d->policy == Shared) { d->lock.lockForWrite(); } -//#define UNLOCK(d) if (d->policy == Shared) { d->lock.unlock(); } - #define LOCK_FOR_READ(d) d->lock.lockForRead(); #define LOCK_FOR_WRITE(d) d->lock.lockForWrite(); #define UNLOCK(d) d->lock.unlock(); @@ -37,91 +33,6 @@ namespace Plasma { -/* -Corrects the case of the last component in a path (e.g. /usr/liB -> /usr/lib) -path: The path to be processed. -correctCasePath: The corrected-case path -mustBeDir: Tells whether the last component is a folder or doesn't matter -Returns true on success and false on error, in case of error, correctCasePath is not modified -*/ -bool correctLastComponentCase(const QString &path, QString &correctCasePath, const bool mustBeDir) -{ - // If the file already exists then no need to search for it. - if (QFile::exists(path)) { - correctCasePath = path; - return true; - } - - const QFileInfo pathInfo(path); - - const QDir fileDir = pathInfo.dir(); - - const QString filename = pathInfo.fileName(); - - const QStringList matchingFilenames = fileDir.entryList(QStringList(filename), - mustBeDir ? QDir::Dirs : QDir::NoFilter); - - if (matchingFilenames.empty()) { - return false; - } else { - if (fileDir.path().endsWith(QDir::separator())) { - correctCasePath = fileDir.path() + matchingFilenames[0]; - } else { - correctCasePath = fileDir.path() + QDir::separator() + matchingFilenames[0]; - } - - return true; - } -} - -/* -Corrects the case of a path (e.g. /uSr/loCAL/bIN -> /usr/local/bin) -path: The path to be processed. -corrected: The corrected-case path -Returns true on success and false on error, in case of error, corrected is not modified -*/ -bool correctPathCase(const QString& path, QString &corrected) -{ - // early exit check - if (QFile::exists(path)) { - corrected = path; - return true; - } - - // path components - QStringList components = QString(path).split(QDir::separator()); - - if (components.size() < 1) { - return false; - } - - const bool mustBeDir = components.back().isEmpty(); - - if (mustBeDir) { - components.pop_back(); - } - - if (components.isEmpty()) { - return true; - } - - QString correctPath; - const int initialComponents = components.size(); - for (int i = 0; i < initialComponents - 1; i++) { - const QString tmp = components[0] + QDir::separator() + components[1]; - - if (!correctLastComponentCase(tmp, correctPath, components.size() > 2 || mustBeDir)) { - return false; - } - - components.removeFirst(); - components[0] = correctPath; - } - - corrected = correctPath; - return true; -} - class RunnerContextPrivate : public QSharedData { public: @@ -146,6 +57,7 @@ { } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) /** * Determines type of query && @@ -191,31 +103,27 @@ // it's too ambiguous to be sure we're in a filesystem context path = !url.scheme().isEmpty() ? QDir::cleanPath(url.toLocalFile()) : path; if ((path.indexOf(QLatin1Char('/')) != -1 || path.indexOf(QLatin1Char('\\')) != -1)) { - QString correctCasePath; - if (correctPathCase(path, correctCasePath)) { - path = correctCasePath; - QFileInfo info(path); - - if (info.isSymLink()) { - path = info.canonicalFilePath(); - info = QFileInfo(path); - } - if (info.isDir()) { - type = RunnerContext::Directory; - mimeType = QStringLiteral("inode/folder"); - } else if (info.isFile()) { - type = RunnerContext::File; - QMimeDatabase db; - QMimeType mime = db.mimeTypeForFile(path); - if (!mime.isDefault()) { - mimeType = mime.name(); - } + QFileInfo info(path); + if (info.isSymLink()) { + path = info.canonicalFilePath(); + info = QFileInfo(path); + } + if (info.isDir()) { + type = RunnerContext::Directory; + mimeType = QStringLiteral("inode/folder"); + } else if (info.isFile()) { + type = RunnerContext::File; + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(path); + if (!mime.isDefault()) { + mimeType = mime.name(); } } } } } } +#endif void invalidate() { @@ -313,7 +221,9 @@ } d->term = term; +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) d->determineType(); +#endif } QString RunnerContext::query() const @@ -323,26 +233,34 @@ // and setQuery(QString) calls reset() return d->term; } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) void RunnerContext::setEnabledCategories(const QStringList& categories) { d->enabledCategories = categories; } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QStringList RunnerContext::enabledCategories() const { return d->enabledCategories; } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) RunnerContext::Type RunnerContext::type() const { return d->type; } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QString RunnerContext::mimeType() const { return d->mimeType; } +#endif bool RunnerContext::isValid() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/runnercontext.h new/krunner-5.76.0/src/runnercontext.h --- old/krunner-5.75.0/src/runnercontext.h 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/runnercontext.h 2020-11-07 13:04:28.000000000 +0100 @@ -81,34 +81,51 @@ */ QString query() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * The type of item the search term might refer to. * @see Type + * @deprecated feature is deprecated. Do the checks manually inside of the match logic */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is deprecated. Do the checks manually inside of the match logic") Type type() const; +#endif +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * A list of categories of which results should be returned. * This list is typically populated from the AbstractRunner::categories * function. + * @deprecated Since 5.76, feature is unused and not supported by most runners */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is unused and not supported by most runners") QStringList enabledCategories() const; +#endif +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * Sets the list of enabled categories. Runners can use this list * to optimize themselves by only returning results from the enabled * categories + * @deprecated Since 5.76, feature is unused and not supported by most runners */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is unused and not supported by most runners") void setEnabledCategories(const QStringList &categories); +#endif +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * The mimetype that the search term refers to, if discoverable. * * @return QString() if the mimetype can not be determined, otherwise * the mimetype of the object being referred to by the search * string. + * @deprecated feature is unused, determine the mime type manually if needed */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is unused, determine the mime type manually if needed") QString mimeType() const; +#endif + /** * @returns true if this context is no longer valid and therefore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/runnermanager.cpp new/krunner-5.76.0/src/runnermanager.cpp --- old/krunner-5.75.0/src/runnermanager.cpp 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/runnermanager.cpp 2020-11-07 13:04:28.000000000 +0100 @@ -16,7 +16,6 @@ #include <QRegularExpression> #include <KSharedConfig> -#include <KPluginInfo> #include <KServiceTypeTrader> #include <KPluginMetaData> #include <KConfigWatcher> @@ -125,7 +124,9 @@ // to half the number of threads DefaultRunnerPolicy::instance().setCap(qMax(2, Queue::instance()->maximumNumberOfThreads() / 2)); +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) enabledCategories = config.readEntry("enabledCategories", QStringList()); +#endif context.restore(config); } @@ -254,16 +255,18 @@ } if (runner) { + bool allCategoriesDisabled = true; + #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) const QStringList categories = runner->categories(); allCategories << categories; - bool allCategoriesDisabled = true; for (const QString &cat : categories) { if (enabledCategories.contains(cat)) { allCategoriesDisabled = false; break; } } + #endif if (enabledCategories.isEmpty() || !allCategoriesDisabled) { qCDebug(KRUNNER) << "Loaded:" << runnerName; @@ -461,7 +464,11 @@ void startJob(AbstractRunner *runner) { - if ((runner->ignoredTypes() & context.type()) == 0) { +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) + if ((runner->ignoredTypes() & context.type()) != 0) { + return; + } +#endif QSharedPointer<FindMatchesJob> job(new FindMatchesJob(runner, &context, Queue::instance())); QObject::connect(job.data(), SIGNAL(done(ThreadWeaver::JobPointer)), q, SLOT(jobDone(ThreadWeaver::JobPointer))); if (runner->speed() == AbstractRunner::SlowSpeed) { @@ -469,7 +476,6 @@ } Queue::instance()->enqueue(job); searchJobs.insert(job); - } } // Delay in ms before slow runners are allowed to run @@ -515,19 +521,17 @@ { d->configFile = configFile; d->loadConfiguration(); - //ThreadWeaver::setDebugLevel(true, 4); } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) RunnerManager::RunnerManager(KConfigGroup &c, QObject *parent) : QObject(parent), d(new RunnerManagerPrivate(this)) { - // Should this be really needed? Maybe d->loadConfiguration(c) would make - // more sense. d->conf = KConfigGroup(&c, "PlasmaRunnerManager"); d->loadConfiguration(); - //ThreadWeaver::setDebugLevel(true, 4); } +#endif RunnerManager::~RunnerManager() { @@ -554,6 +558,7 @@ } } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) void RunnerManager::setEnabledCategories(const QStringList& categories) { KConfigGroup config = d->configGroup(); @@ -565,6 +570,7 @@ d->loadRunners(); } } +#endif QStringList RunnerManager::allowedRunners() const { @@ -572,6 +578,7 @@ return config.readEntry("pluginWhiteList", QStringList()); } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QStringList RunnerManager::enabledCategories() const { KConfigGroup config = d->configGroup(); @@ -585,6 +592,7 @@ return list; } +#endif #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 72) && KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) void RunnerManager::loadRunner(const KService::Ptr service) @@ -861,15 +869,6 @@ return; } - if (term.isEmpty()) { - if (d->singleMode && d->currentSingleRunner->defaultSyntax()) { - term = d->currentSingleRunner->defaultSyntax()->exampleQueries().first().remove(QLatin1String(":q:")); - } else { - reset(); - return; - } - } - if (d->context.query() == term) { // we already are searching for this! return; @@ -881,20 +880,22 @@ reset(); d->context.setQuery(term); +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) d->context.setEnabledCategories(d->enabledCategories); +#endif - QHash<QString, AbstractRunner*> runable; + QHash<QString, AbstractRunner*> runnable; //if the name is not empty we will launch only the specified runner if (d->singleMode) { - runable.insert(QString(), d->currentSingleRunner); + runnable.insert(QString(), d->currentSingleRunner); d->context.setSingleRunnerQueryMode(true); } else { - runable = d->runners; + runnable = d->runners; } const int queryLetterCount = term.count(); - for (Plasma::AbstractRunner *r : qAsConst(runable)) { + for (Plasma::AbstractRunner *r : qAsConst(runnable)) { if (r->isMatchingSuspended()) { continue; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/runnermanager.h new/krunner-5.76.0/src/runnermanager.h --- old/krunner-5.75.0/src/runnermanager.h 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/runnermanager.h 2020-11-07 13:04:28.000000000 +0100 @@ -41,7 +41,13 @@ public: explicit RunnerManager(QObject *parent=nullptr); explicit RunnerManager(const QString &configFile, QObject *parent=nullptr); +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) + /** + * @deprecated Since 5.76, use "RunnerManager(const QString &configFile, QObject *parent)" instead. + */ + KRUNNER_DEPRECATED_VERSION(5, 76, "use RunnerManager(const QString &configFile, QObject *parent) instead") explicit RunnerManager(KConfigGroup &config, QObject *parent=nullptr); +#endif ~RunnerManager(); /** @@ -153,12 +159,16 @@ */ void setAllowedRunners(const QStringList &runners); +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * Sets the list of categories which matches should be * returned for. It also internally tries not to execute the * runners which do not fall in this category. + * @deprecated Since 5.76, feature is unused and not supported by most runners */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is unused and not supported by most runners") void setEnabledCategories(const QStringList &categories); +#endif #if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 72) #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) @@ -207,10 +217,14 @@ */ QStringList allowedRunners() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * @return the list of enabled categories + * @deprecated Since 5.76, feature is unused and not supported by most runners */ + KRUNNER_DEPRECATED_VERSION(5, 76, "feature is unused and not supported by most runners") QStringList enabledCategories() const; +#endif /** * @return mime data of the specified match diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/runnersyntax.cpp new/krunner-5.76.0/src/runnersyntax.cpp --- old/krunner-5.75.0/src/runnersyntax.cpp 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/runnersyntax.cpp 2020-11-07 13:04:28.000000000 +0100 @@ -15,9 +15,16 @@ { public: RunnerSyntaxPrivate(const QString &s, const QString &d) - : description(d) + : description(d), + termDescription(i18n("search term")) { - exampleQueries.append(s); + addExampleQuery(s); + } + + void addExampleQuery(const QString &s) + { + const QString termDesc(QLatin1Char('<') + termDescription + QLatin1Char('>')); + exampleQueries.append(QString(s).replace(QStringLiteral(":q:"), termDesc)); } QStringList exampleQueries; @@ -48,7 +55,7 @@ void RunnerSyntax::addExampleQuery(const QString &exampleQuery) { - d->exampleQueries.append(exampleQuery); + d->addExampleQuery(exampleQuery); } QStringList RunnerSyntax::exampleQueries() const @@ -56,6 +63,7 @@ return d->exampleQueries; } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QStringList RunnerSyntax::exampleQueriesWithTermDescription() const { QStringList queries; @@ -66,32 +74,39 @@ return queries; } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) void RunnerSyntax::setDescription(const QString &description) { d->description = description; } +#endif QString RunnerSyntax::description() const { +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QString description = d->description; description.replace(QLatin1String(":q:"), QLatin1Char('<') + searchTermDescription() + QLatin1Char('>')); return description; +#else + return d->description; +#endif } +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) void RunnerSyntax::setSearchTermDescription(const QString &description) { d->termDescription = description; } +#endif +#if KRUNNER_BUILD_DEPRECATED_SINCE(5, 76) QString RunnerSyntax::searchTermDescription() const { - if (d->termDescription.isEmpty()) { - return i18n("search term"); - } - return d->termDescription; } +#endif } // Plasma namespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/src/runnersyntax.h new/krunner-5.76.0/src/runnersyntax.h --- old/krunner-5.75.0/src/runnersyntax.h 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/src/runnersyntax.h 2020-11-07 13:04:28.000000000 +0100 @@ -22,7 +22,21 @@ * Represents a query prototype that the runner accepts. These can be * created and registered with AbstractRunner::addSyntax(Syntax &) to * allow applications to show to the user what the runner is currently - * capable of doing + * capable of doing. + * + * Lets say the runner has a trigger word and then the user can type anything after that. In that case you could use + * ":q:" as a placeholder, which will get expanded to i18n("search term") and be put in brackets. + * @code + Plasma::RunnerSyntax syntax(QStringLiteral("sometriggerword :q:"), i18n("Description for this syntax")); + addSyntax(syntax); + * @endcode + * + * But if the query the user has to enter is sth. specific like a program, + * url or file you should use a custom placeholder to make it easier to understand. + * @code + Plasma::RunnerSyntax syntax(QStringLiteral("sometriggereword <%1>").arg(i18n("program name"))), i18n("Description for this syntax")); + addSyntax(syntax); + * @endcode */ class KRUNNER_EXPORT RunnerSyntax { @@ -30,12 +44,9 @@ /** * Constructs a simple syntax object * - * @param exampleQuery an example of the query, with :q: placed wherever - * search term text might appear. e.g. if the runner - * accepts "keyword some random text" then the value - * of this parameter should be "keyword :q:" - * @param descrition A description of what the described syntax does from - * the user's point of view. + * @param exampleQuery See the class description for examples and placeholder conventions. + * @param description A description of what the described syntax does from + * the user's point of view. */ RunnerSyntax(const QString &exampleQuery, const QString &description); @@ -57,10 +68,7 @@ * This allows the runner to show these relationships by grouping the * example queries into one Syntax object * - * @param exampleQuery an example of the query, with :q: placed wherever - * search term text might appear. e.g. if the runner - * accepts "keyword some random text" then the value - * of this parameter should be "keyword :q:" + * @param exampleQuery See the class description for examples and placeholder conventions. */ void addExampleQuery(const QString &exampleQuery); @@ -69,12 +77,17 @@ */ QStringList exampleQueries() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * @return the example queries associated with this Syntax object, with * the searchTermDescription replacing instances of :q:. Used for showing * the queries in the user interface. + * @deprecated Since 5.76, the description should be directly set when creating the example query. + * To display the queries in the user interface. Use exampleQueries() instead. */ + KRUNNER_DEPRECATED_VERSION(5, 76, "The descriptions should be directly set when creating the example query. Use exampleQueries() instead.") QStringList exampleQueriesWithTermDescription() const; +#endif /** * Sets the description for the syntax, describing what it does from @@ -88,19 +101,27 @@ */ QString description() const; +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * Sets the text that should be used to replace instances of :q: * in the text. By default this is the generic phrase "search term". * If the syntax expects a specific kind of input, it may be defined * here. A syntax used by a runner that changes the brightness of the display * may set this to "brightness" for instance. + * @deprecated Since 5.76, set the description directly when creating the example query. Use <my query description> instead of :q: when creating the string */ + KRUNNER_DEPRECATED_VERSION(5, 76, "Set the description directly when creating the example query. Use <my query description> instead of :q: when creating the string") void setSearchTermDescription(const QString &description); +#endif +#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76) /** * @return a description of the search term for this syntax + * @deprecated Since 5.76, the desciption should be directly set when creating the example query. */ + KRUNNER_DEPRECATED_VERSION(5, 76, "Feature is obsolete, the search term description should be set inside of the example query directly") QString searchTermDescription() const; +#endif private: RunnerSyntaxPrivate *const d; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-5.75.0/templates/runnerpython/runnerpy.kdevtemplate new/krunner-5.76.0/templates/runnerpython/runnerpy.kdevtemplate --- old/krunner-5.75.0/templates/runnerpython/runnerpy.kdevtemplate 2020-10-04 11:56:50.000000000 +0200 +++ new/krunner-5.76.0/templates/runnerpython/runnerpy.kdevtemplate 2020-11-07 13:04:28.000000000 +0100 @@ -3,10 +3,12 @@ Name[az]=Python KRunner qoşması Name[ca]=Connector Python del KRunner Name[cs]=Modul KRunneru pr Python +Name[da]=Python-plugin til KRunner Name[de]=KRunner-Modul für Python Name[el]=Πρόσθετο Python KRunner Name[en_GB]=Python KRunner Plugin Name[es]=Complemento en Python para KRunner +Name[et]=Pythoni KRunneri plugin Name[fr]=module externe « KRunner » pour Python Name[it]=Estensione Python di KRunner Name[ko]=Python KRunner 플러그인 @@ -24,10 +26,12 @@ Comment=Template for a KRunner Python Plugin using D-Bus Comment[az]=D-Bus ilə istifadə olunan KRunner Python Qoşması üçün nümunə Comment[ca]=Plantilla per a un connector Python del KRunner usant D-Bus +Comment[da]=Skabelon til et KRunner Python-plugin med brug af D-Bus Comment[de]=Vorlage für ein KRunner-Modul für Python, das D-Bus verwendet Comment[el]=Πρότυπο για ένα Python πρόσθετο του KRunner με χρήση D-Bus Comment[en_GB]=Template for a KRunner Python Plugin using D-Bus Comment[es]=Plantilla para un complemento en Python para KRunner que usa D-Bus +Comment[et]=D-Busi kasutav KRunneri Pythoni plugina mall Comment[fr]=Modèle pour le module externe « KRunner » pour Python, utilisant « D-Bus » Comment[it]=Modello per un'estensione Python di KRunner che usa D-Bus Comment[ko]=D-Bus를 사용하는 KRunner Python 플러그인 템플릿 _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
