Hello community, here is the log from the commit of package krunner for openSUSE:Factory checked in at 2014-07-18 16:50:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/krunner (Old) and /work/SRC/openSUSE:Factory/.krunner.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "krunner" Changes: -------- --- /work/SRC/openSUSE:Factory/krunner/krunner.changes 2014-06-10 14:36:01.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.krunner.new/krunner.changes 2014-07-18 16:50:29.000000000 +0200 @@ -1,0 +2,15 @@ +Fri Jul 11 09:48:50 UTC 2014 - [email protected] + +- Define kf5_version within package + +------------------------------------------------------------------- +Tue Jul 1 21:35:32 UTC 2014 - [email protected] + +- Update to 5.0.0 + * Final release of KDE Frameworks 5 + * API improvements and cleanups + * Buildsystem fixes + * For more details please see: + http://www.kde.org/announcements/kde-frameworks-5.0.php + +------------------------------------------------------------------- Old: ---- krunner-4.100.0.tar.xz New: ---- krunner-5.0.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ krunner.spec ++++++ --- /var/tmp/diff_new_pack.KjPALp/_old 2014-07-18 16:50:30.000000000 +0200 +++ /var/tmp/diff_new_pack.KjPALp/_new 2014-07-18 16:50:30.000000000 +0200 @@ -18,20 +18,21 @@ %define lname libKF5Runner5 Name: krunner -Version: 4.100.0 +Version: 5.0.0 Release: 0 +%define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 0.0.14 +BuildRequires: extra-cmake-modules >= 1.0.0 BuildRequires: fdupes -BuildRequires: kconfig-devel >= %{_kf5_version} -BuildRequires: kcoreaddons-devel >= %{_kf5_version} +BuildRequires: kconfig-devel >= %{kf5_version} +BuildRequires: kcoreaddons-devel >= %{kf5_version} BuildRequires: kf5-filesystem -BuildRequires: ki18n-devel >= %{_kf5_version} -BuildRequires: kio-devel >= %{_kf5_version} -BuildRequires: kservice-devel >= %{_kf5_version} -BuildRequires: plasma-framework-devel >= %{_kf5_version} -BuildRequires: solid-devel >= %{_kf5_version} -BuildRequires: threadweaver-devel >= %{_kf5_version} +BuildRequires: ki18n-devel >= %{kf5_version} +BuildRequires: kio-devel >= %{kf5_version} +BuildRequires: kservice-devel >= %{kf5_version} +BuildRequires: plasma-framework-devel >= %{kf5_version} +BuildRequires: solid-devel >= %{kf5_version} +BuildRequires: threadweaver-devel >= %{kf5_version} BuildRequires: pkgconfig(Qt5Gui) >= 5.2.0 BuildRequires: pkgconfig(Qt5Quick) >= 5.2.0 BuildRequires: pkgconfig(Qt5Test) >= 5.2.0 @@ -39,7 +40,7 @@ License: LGPL-2.1+ Group: System/GUI/KDE Url: http://www.kde.org -Source: http://download.kde.org/unstable/frameworks/%{version}/portingAids/%{name}-%{version}.tar.xz +Source: http://download.kde.org/stable/frameworks/%{version}/portingAids/%{name}-%{version}.tar.xz Source1: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -66,7 +67,7 @@ Group: Development/Libraries/KDE Requires: %lname = %{version} Requires: extra-cmake-modules -Requires: plasma-framework-devel >= %{_kf5_version} +Requires: plasma-framework-devel >= %{kf5_version} Requires: pkgconfig(Qt5Core) >= 5.2.0 %description devel ++++++ krunner-4.100.0.tar.xz -> krunner-5.0.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/CMakeLists.txt new/krunner-5.0.0/CMakeLists.txt --- old/krunner-4.100.0/CMakeLists.txt 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/CMakeLists.txt 2014-07-01 20:18:20.000000000 +0200 @@ -3,7 +3,7 @@ project(KRunner) # ECM setup -find_package(ECM 0.0.14 REQUIRED NO_MODULE) +find_package(ECM 1.0.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(FeatureSummary) @@ -15,8 +15,8 @@ include(KDECompilerSettings) include(KDECMakeSettings) -set(KF5_VERSION "4.100.0") # handled by release scripts -set(KF5_DEP_VERSION "4.100.0") # handled by release scripts +set(KF5_VERSION "5.0.0") # handled by release scripts +set(KF5_DEP_VERSION "5.0.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KRUNNER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/examples/runner/plasma-runner-example-homefiles.desktop new/krunner-5.0.0/examples/runner/plasma-runner-example-homefiles.desktop --- old/krunner-4.100.0/examples/runner/plasma-runner-example-homefiles.desktop 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/examples/runner/plasma-runner-example-homefiles.desktop 2014-07-01 20:18:20.000000000 +0200 @@ -6,6 +6,7 @@ Name[cs]=Soubory domovské složky Name[da]=Filer i hjem Name[de]=Persönliche Dateien +Name[en_GB]=Home Files Name[es]=Archivos personales Name[fi]=Kodin tiedostot Name[fr]=Fichiers personnels @@ -40,6 +41,7 @@ Comment[cs]=Část ukázky demonstrující vytváření modulů pro Runner Comment[da]=Del af vejledning til demonstration af hvordan man laver Runner-plugins Comment[de]=Teil einer Anleitung zur Demonstration, wie Runner-Module erstellt werden +Comment[en_GB]=Part of a tutorial demonstrating how to create Runner plugins Comment[es]=Parte de un tutorial que demuestra cómo crear complementos de Runner Comment[fi]=Osa tutoriaalia, joka näyttää, miten Runner-liitännäisiä tehdään Comment[fr]=Éléments d'un tutoriel montrant comment créer des modules « Runner » diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/abstractrunner.cpp new/krunner-5.0.0/src/abstractrunner.cpp --- old/krunner-4.100.0/src/abstractrunner.cpp 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/abstractrunner.cpp 2014-07-01 20:18:20.000000000 +0200 @@ -264,6 +264,16 @@ { } +QStringList AbstractRunner::categories() const +{ + return QStringList() << name(); +} + +QIcon AbstractRunner::categoryIcon(const QString&) const +{ + return icon(); +} + void AbstractRunner::match(Plasma::RunnerContext &search) { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/abstractrunner.h new/krunner-5.0.0/src/abstractrunner.h --- old/krunner-4.100.0/src/abstractrunner.h 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/abstractrunner.h 2014-07-01 20:18:20.000000000 +0200 @@ -173,6 +173,26 @@ virtual void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match); /** + * 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 + * to disable certain runners if all the categories they provide have + * been disabled. + * + * This list of categories is also used to provide a better way to + * configure the runner instead of the typical on / off switch. + */ + virtual QStringList categories() const; + + /** + * 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 + */ + virtual QIcon categoryIcon(const QString& category) const; + + /** * The nominal speed of the runner. * @see setSpeed */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/data/servicetypes/plasma-runner.desktop new/krunner-5.0.0/src/data/servicetypes/plasma-runner.desktop --- old/krunner-4.100.0/src/data/servicetypes/plasma-runner.desktop 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/data/servicetypes/plasma-runner.desktop 2014-07-01 20:18:20.000000000 +0200 @@ -9,6 +9,7 @@ Comment[cs]=Modul KRunneru Comment[da]=KRunner-plugin Comment[de]=KRunner-Modul +Comment[en_GB]=KRunner plugin Comment[es]=Complemento para KRunner Comment[fi]=KRunner-liitännäinen Comment[fr]=Module externe de KRunner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/private/runnerjobs.cpp new/krunner-5.0.0/src/private/runnerjobs.cpp --- old/krunner-4.100.0/src/private/runnerjobs.cpp 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/private/runnerjobs.cpp 2014-07-01 20:18:20.000000000 +0200 @@ -50,7 +50,7 @@ if (QTimer *t = aJob->delayTimer()) { // If the timer is active, the required delay has not been reached //qDebug() << "delayed timer" << aJob->runner()->name() << !t->isActive(); - return !t->isActive(); + return !t->isActive(); // DATA RACE! (with QTimer start/stop from runnermanager.cpp) } return true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/runnercontext.cpp new/krunner-5.0.0/src/runnercontext.cpp --- old/krunner-4.100.0/src/runnercontext.cpp 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/runnercontext.cpp 2014-07-01 20:18:20.000000000 +0200 @@ -257,6 +257,7 @@ QHash<QString, int> launchCounts; QString term; QString mimeType; + QStringList enabledCategories; RunnerContext::Type type; RunnerContext * q; static RunnerContext s_dummyContext; @@ -301,6 +302,7 @@ void RunnerContext::reset() { + LOCK_FOR_WRITE(d); // We will detach if we are a copy of someone. But we will reset // if we are the 'main' context others copied from. Resetting // one RunnerContext makes all the copies obsolete. @@ -308,6 +310,7 @@ // We need to mark the q pointer of the detached RunnerContextPrivate // as dirty on detach to avoid receiving results for old queries d->invalidate(); + UNLOCK(d); d.detach(); @@ -351,6 +354,16 @@ return d->term; } +void RunnerContext::setEnabledCategories(const QStringList& categories) +{ + d->enabledCategories = categories; +} + +QStringList RunnerContext::enabledCategories() const +{ + return d->enabledCategories; +} + RunnerContext::Type RunnerContext::type() const { return d->type; @@ -364,7 +377,10 @@ bool RunnerContext::isValid() const { // if our qptr is dirty, we aren't useful anymore - return (d->q != &(d->s_dummyContext)); + LOCK_FOR_READ(d) + const bool valid = (d->q != &(d->s_dummyContext)); + UNLOCK(d) + return valid; } bool RunnerContext::addMatches(const QList<QueryMatch> &matches) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/runnercontext.h new/krunner-5.0.0/src/runnercontext.h --- old/krunner-4.100.0/src/runnercontext.h 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/runnercontext.h 2014-07-01 20:18:20.000000000 +0200 @@ -101,6 +101,20 @@ Type type() const; /** + * A list of categories of which results should be returned. + * This list is typically populated from the AbstractRunner::categories + * function. + */ + QStringList enabledCategories() const; + + /** + * Sets the list of enabled categories. Runners can use this list + * to optimize themselves by only returning results from the enabled + * categories + */ + void setEnabledCategories(const QStringList &categories); + + /** * The mimetype that the search term refers to, if discoverable. * * @return QString() if the mimetype can not be determined, otherwise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/runnermanager.cpp new/krunner-5.0.0/src/runnermanager.cpp --- old/krunner-4.100.0/src/runnermanager.cpp 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/runnermanager.cpp 2014-07-01 20:18:20.000000000 +0200 @@ -113,6 +113,7 @@ const int cap = qMax(2, numThreads/2); DefaultRunnerPolicy::instance().setCap(cap); + enabledCategories = config.readEntry("enabledCategories", QStringList()); context.restore(config); } @@ -181,6 +182,7 @@ advertiseSingleRunnerIds.clear(); + QStringList allCategories; QSet<AbstractRunner *> deadRunners; QMutableListIterator<KPluginInfo> it(offers); while (it.hasNext()) { @@ -207,11 +209,30 @@ //qDebug() << loadAll << description.isPluginEnabled() << noWhiteList << whiteList.contains(runnerName); if (selected) { + AbstractRunner *runner = 0; if (!loaded) { - AbstractRunner *runner = loadInstalledRunner(description.service()); + runner = loadInstalledRunner(description.service()); + } else { + runner = runners.value(runnerName); + } + + if (runner) { + const QStringList categories = runner->categories(); + allCategories << categories; + + bool allCategoriesDisabled = true; + Q_FOREACH (const QString &cat, categories) { + if (enabledCategories.contains(cat)) { + allCategoriesDisabled = false; + break; + } + } - if (runner) { + if (enabledCategories.isEmpty() || !allCategoriesDisabled) { runners.insert(runnerName, runner); + } else { + runners.remove(runnerName); + deadRunners.insert(runner); } } } else if (loaded) { @@ -223,6 +244,10 @@ } } + if (enabledCategories.isEmpty()) { + enabledCategories = allCategories; + } + if (!deadRunners.isEmpty()) { QSet<QSharedPointer<FindMatchesJob> > deadJobs; auto it = searchJobs.begin(); @@ -422,6 +447,7 @@ QSet<QSharedPointer<FindMatchesJob> > searchJobs; QSet<QSharedPointer<FindMatchesJob> > oldSearchJobs; KConfigGroup conf; + QStringList enabledCategories; QString singleModeRunnerId; bool loadAll : 1; bool prepped : 1; @@ -466,6 +492,7 @@ void RunnerManager::reloadConfiguration() { + KSharedConfig::openConfig()->reparseConfiguration(); d->loadConfiguration(); d->loadRunners(); } @@ -481,12 +508,37 @@ } } +void RunnerManager::setEnabledCategories(const QStringList& categories) +{ + KConfigGroup config = d->configGroup(); + config.writeEntry("enabledCategories", categories); + + d->enabledCategories = categories; + + if (!d->runners.isEmpty()) { + d->loadRunners(); + } +} + QStringList RunnerManager::allowedRunners() const { KConfigGroup config = d->configGroup(); return config.readEntry("pluginWhiteList", QStringList()); } +QStringList RunnerManager::enabledCategories() const +{ + KConfigGroup config = d->configGroup(); + QStringList list = config.readEntry("enabledCategories", QStringList()); + if (list.isEmpty()) { + Q_FOREACH (AbstractRunner* runner, d->runners) { + list << runner->categories(); + } + } + + return list; +} + void RunnerManager::loadRunner(const KService::Ptr service) { KPluginInfo description(service); @@ -743,6 +795,7 @@ reset(); // qDebug() << "runners searching for" << term << "on" << runnerName; d->context.setQuery(term); + d->context.setEnabledCategories(d->enabledCategories); QHash<QString, AbstractRunner*> runable; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/krunner-4.100.0/src/runnermanager.h new/krunner-5.0.0/src/runnermanager.h --- old/krunner-4.100.0/src/runnermanager.h 2014-06-01 12:42:26.000000000 +0200 +++ new/krunner-5.0.0/src/runnermanager.h 2014-07-01 20:18:20.000000000 +0200 @@ -165,6 +165,13 @@ void setAllowedRunners(const QStringList &runners); /** + * 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. + */ + void setEnabledCategories(const QStringList &categories); + + /** * Attempts to add the AbstractRunner plugin represented * by the KService passed in. Usually one can simply let * the configuration of plugins handle loading Runner plugins, @@ -194,6 +201,11 @@ QStringList allowedRunners() const; /** + * @return the list of enabled categories + */ + QStringList enabledCategories() const; + + /** * @return mime data of the specified match * @since 4.5 */ -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
