Hello community, here is the log from the commit of package kservice for openSUSE:Factory checked in at 2015-03-16 09:28:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kservice (Old) and /work/SRC/openSUSE:Factory/.kservice.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kservice" Changes: -------- --- /work/SRC/openSUSE:Factory/kservice/kservice.changes 2015-02-16 17:32:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kservice.new/kservice.changes 2015-03-16 09:28:15.000000000 +0100 @@ -1,0 +2,8 @@ +Sat Mar 7 16:58:37 UTC 2015 - hrvoje.sen...@gmail.com + +- Update to 5.8.0 + * KPluginInfo: support stringlists as properties + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.8.0.php + +------------------------------------------------------------------- Old: ---- kservice-5.7.0.tar.xz New: ---- kservice-5.8.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kservice.spec ++++++ --- /var/tmp/diff_new_pack.kKqWGe/_old 2015-03-16 09:28:16.000000000 +0100 +++ /var/tmp/diff_new_pack.kKqWGe/_new 2015-03-16 09:28:16.000000000 +0100 @@ -16,13 +16,13 @@ # -%define _tar_path 5.7 +%define _tar_path 5.8 Name: kservice Version: %{_tar_path}.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.7.0 +BuildRequires: extra-cmake-modules >= 1.8.0 BuildRequires: fdupes BuildRequires: kconfig-devel >= %{kf5_version} BuildRequires: kcoreaddons-devel >= %{kf5_version} ++++++ kservice-5.7.0.tar.xz -> kservice-5.8.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.7.0/CMakeLists.txt new/kservice-5.8.0/CMakeLists.txt --- old/kservice-5.7.0/CMakeLists.txt 2015-02-08 16:24:25.000000000 +0100 +++ new/kservice-5.8.0/CMakeLists.txt 2015-03-07 15:49:54.000000000 +0100 @@ -4,7 +4,7 @@ project(KService) # ECM setup -find_package(ECM 1.7.0 REQUIRED NO_MODULE) +find_package(ECM 1.8.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ) include(KDEInstallDirs) @@ -15,8 +15,8 @@ include(FeatureSummary) include(GenerateExportHeader) -set(KF5_VERSION "5.7.0") # handled by release scripts -set(KF5_DEP_VERSION "5.7.0") # handled by release scripts +set(KF5_VERSION "5.8.0") # handled by release scripts +set(KF5_DEP_VERSION "5.8.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KSERVICE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.7.0/autotests/fakeplugin.desktop new/kservice-5.8.0/autotests/fakeplugin.desktop --- old/kservice-5.7.0/autotests/fakeplugin.desktop 2015-02-08 16:24:25.000000000 +0100 +++ new/kservice-5.8.0/autotests/fakeplugin.desktop 2015-03-07 15:49:54.000000000 +0100 @@ -103,37 +103,49 @@ Keywords=word1;word2 Keywords[ca]=paraula1;paraula2 Keywords[da]=ord1;ord2 +Keywords[en_GB]=word1;word2 Keywords[es]=palabra1;palabra2 Keywords[fi]=sana1;sana2 +Keywords[it]=parola1;parola2 Keywords[nl]=woord1;woord2 Keywords[pl]=słowo1;słowo2 Keywords[pt]=palavra1;palavra2 Keywords[pt_BR]=palavra1;palavra2 +Keywords[ru]=слово1;слово2 Keywords[sk]=word1;word2 Keywords[sr]=реч1;реч2; Keywords[sr@ijekavian]=реч1;реч2; Keywords[sr@ijekavianlatin]=reč1;reč2; Keywords[sr@latin]=reč1;reč2; Keywords[sv]=ord1;ord2 +Keywords[tr]=kelime1;kelime2 Keywords[uk]=слово1;слово2;word1;word2 Keywords[x-test]=xxword1xx;xxword2xx +Keywords[zh_CN]=word1;word2 +Keywords[zh_TW]=單字1:單字2 #this one is comma separated X-KDE-Keywords=word3,word4 X-KDE-Keywords[ca]=paraula3,paraula4 X-KDE-Keywords[da]=ord3,ord4 +X-KDE-Keywords[en_GB]=word3,word4 X-KDE-Keywords[es]=palabra3,palabra4 X-KDE-Keywords[fi]=sana3,sana4 +X-KDE-Keywords[it]=parola3,parola4 X-KDE-Keywords[nl]=woord3,woord4 X-KDE-Keywords[pl]=słowo3,słowo4 X-KDE-Keywords[pt]=palavra3,palavra4 -X-KDE-Keywords[pt_BR]=palavra3;palavra4 +X-KDE-Keywords[pt_BR]=palavra3,palavra4 +X-KDE-Keywords[ru]=слово3,слово4 X-KDE-Keywords[sk]=word3,word4 X-KDE-Keywords[sr]=реч3,реч4 X-KDE-Keywords[sr@ijekavian]=реч3,реч4 X-KDE-Keywords[sr@ijekavianlatin]=reč3,reč4 X-KDE-Keywords[sr@latin]=reč3,reč4 X-KDE-Keywords[sv]=ord3,ord4 +X-KDE-Keywords[tr]=kelime3,kelime4 X-KDE-Keywords[uk]=слово3,слово4,word3,word4 X-KDE-Keywords[x-test]=xxword3xx,xxword4xx +X-KDE-Keywords[zh_CN]=word3,word4 +X-KDE-Keywords[zh_TW]=單字3:單字4 MimeType=text/plain;image/png diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.7.0/autotests/kservicetest.cpp new/kservice-5.8.0/autotests/kservicetest.cpp --- old/kservice-5.7.0/autotests/kservicetest.cpp 2015-02-08 16:24:25.000000000 +0100 +++ new/kservice-5.8.0/autotests/kservicetest.cpp 2015-03-07 15:49:54.000000000 +0100 @@ -31,6 +31,8 @@ #include <kservicetypetrader.h> #include <kservicetype.h> #include <kservicetypeprofile.h> +#include <kpluginmetadata.h> +#include <kplugininfo.h> #include <qfile.h> #include <qprocess.h> @@ -118,6 +120,7 @@ group.writeEntry("X-KDE-Library", "fakepart2"); group.writeEntry("X-KDE-ServiceTypes", "FakeBasePart"); group.writeEntry("MimeType", "text/plain;"); + group.writeEntry("X-KDE-TestList", QStringList() << "item1" << "item2"); } const QString preferredPart = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "preferredpart.desktop"; @@ -201,6 +204,9 @@ group.writeEntry("Comment", "Fake Base Part"); group.writeEntry("Type", "ServiceType"); group.writeEntry("X-KDE-ServiceType", "FakeBasePart"); + + KConfigGroup listGroup(&file, "PropertyDef::X-KDE-TestList"); + listGroup.writeEntry("Type", "QStringList"); } // fakederivedpart: a servicetype deriving from FakeBasePart (like ReadWritePart derives from ReadOnlyPart) @@ -790,3 +796,9 @@ QVERIFY(!iplugin.factory()); } +void KServiceTest::testKPluginInfoQuery() +{ + KPluginInfo info(KPluginMetaData(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "fakepart2.desktop")); + + QCOMPARE(info.property("X-KDE-TestList").value<QStringList>().size(), 2); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.7.0/autotests/kservicetest.h new/kservice-5.8.0/autotests/kservicetest.h --- old/kservice-5.7.0/autotests/kservicetest.h 2015-02-08 16:24:25.000000000 +0100 +++ new/kservice-5.8.0/autotests/kservicetest.h 2015-03-07 15:49:54.000000000 +0100 @@ -48,6 +48,7 @@ void testReaderThreads(); void testThreads(); void testOperatorKPluginName(); + void testKPluginInfoQuery(); private: void createFakeService(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.7.0/autotests/ksycocadicttest.cpp new/kservice-5.8.0/autotests/ksycocadicttest.cpp --- old/kservice-5.7.0/autotests/ksycocadicttest.cpp 2015-02-08 16:24:25.000000000 +0100 +++ new/kservice-5.8.0/autotests/ksycocadicttest.cpp 2015-03-07 15:49:54.000000000 +0100 @@ -38,20 +38,21 @@ QStandardPaths::enableTestMode(true); kservice_require_kded = false; - // fakeplugintype: a servicetype + // dicttestplugintype: a servicetype bool mustUpdateKSycoca = false; - if (!KSycoca::isAvailable() || !KServiceType::serviceType("FakePluginType")) { + if (!KSycoca::isAvailable() || !KServiceType::serviceType("DictTestPluginType")) { mustUpdateKSycoca = true; } - const QString fakePluginType = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservicetypes5/") + "fakeplugintype.desktop"; - if (!QFile::exists(fakePluginType)) { + const QString dictTestPluginType = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservicetypes5/") + "dicttestplugintype.desktop"; + if (!QFile::exists(dictTestPluginType)) { mustUpdateKSycoca = true; - KDesktopFile file(fakePluginType); + KDesktopFile file(dictTestPluginType); KConfigGroup group = file.desktopGroup(); group.writeEntry("Comment", "Fake Text Plugin"); group.writeEntry("Type", "ServiceType"); - group.writeEntry("X-KDE-ServiceType", "FakePluginType"); + group.writeEntry("X-KDE-ServiceType", "DictTestPluginType"); file.group("PropertyDef::X-KDE-Version").writeEntry("Type", "double"); // like in ktexteditorplugin.desktop + qDebug() << "Just created" << dictTestPluginType; } if (mustUpdateKSycoca) { runKBuildSycoca(); @@ -76,6 +77,7 @@ void KSycocaDictTest::runKBuildSycoca() { + QSignalSpy spy(KSycoca::self(), SIGNAL(databaseChanged(QStringList))); QProcess proc; const QString kbuildsycoca = QStandardPaths::findExecutable(KBUILDSYCOCA_EXENAME); QVERIFY(!kbuildsycoca.isEmpty()); @@ -84,13 +86,13 @@ proc.setProcessChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output proc.start(kbuildsycoca, args); - //qDebug() << "waiting for signal"; - //QSignalSpy spy(KSycoca::self(), SIGNAL(databaseChanged(QStringList))); - //QVERIFY(spy.wait(10000)); - //qDebug() << "got signal"; - proc.waitForFinished(); QCOMPARE(proc.exitStatus(), QProcess::NormalExit); + + qDebug() << "waiting for signal"; + QVERIFY(spy.wait(10000)); + qDebug() << "got signal"; + } // Standard use of KSycocaDict: mapping entry name to entry @@ -99,7 +101,7 @@ QVERIFY(KSycoca::isAvailable()); QStringList serviceTypes; - serviceTypes << "FakePluginType" + serviceTypes << "DictTestPluginType" << "KUriFilter/Plugin" << "KDataTool" << "KCModule" @@ -125,8 +127,8 @@ { add(dict, str, str); } - dict.remove("FakePluginType"); // just to test remove - add(dict, "FakePluginType", "FakePluginType"); + dict.remove("DictTestPluginType"); // just to test remove + add(dict, "DictTestPluginType", "DictTestPluginType"); QCOMPARE((int)dict.count(), serviceTypes.count()); QDataStream saveStream(&buffer, QIODevice::WriteOnly); dict.save(saveStream); @@ -134,9 +136,9 @@ QDataStream stream(buffer); KSycocaDict loadingDict(&stream, 0); - int offset = loadingDict.find_string("FakePluginType"); + int offset = loadingDict.find_string("DictTestPluginType"); QVERIFY(offset > 0); - QCOMPARE(offset, KServiceType::serviceType("FakePluginType")->offset()); + QCOMPARE(offset, KServiceType::serviceType("DictTestPluginType")->offset()); foreach (const QString &str, serviceTypes) { int offset = loadingDict.find_string(str); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kservice-5.7.0/src/services/kplugininfo.cpp new/kservice-5.8.0/src/services/kplugininfo.cpp --- old/kservice-5.7.0/src/services/kplugininfo.cpp 2015-02-08 16:24:25.000000000 +0100 +++ new/kservice-5.8.0/src/services/kplugininfo.cpp 2015-03-07 15:49:54.000000000 +0100 @@ -91,6 +91,9 @@ , kcmservicesCached(false) {} + QStringList deserializeList(const QString &data); + + bool hidden : 1; bool pluginenabled : 1; mutable bool kcmservicesCached : 1; @@ -104,6 +107,38 @@ void setMetaData(const KPluginMetaData &md, bool warnOnOldStyle); }; +//This comes from KConfigGroupPrivate::deserializeList() +QStringList KPluginInfoPrivate::deserializeList(const QString &data) +{ + if (data.isEmpty()) { + return QStringList(); + } + if (data == QLatin1String("\\0")) { + return QStringList(QString()); + } + QStringList value; + QString val; + val.reserve(data.size()); + bool quoted = false; + for (int p = 0; p < data.length(); p++) { + if (quoted) { + val += data[p]; + quoted = false; + } else if (data[p].unicode() == '\\') { + quoted = true; + } else if (data[p].unicode() == ',' || data[p].unicode() == ';') { + val.squeeze(); // release any unused memory + value.append(val); + val.clear(); + val.reserve(data.size() - p); + } else { + val += data[p]; + } + } + value.append(val); + return value; +} + // maps the KService, QVariant and KDesktopFile keys to the new KPluginMetaData keys template<typename T, typename Func> static QJsonObject mapToJsonKPluginKey(const QString &name, const QString &description, @@ -211,7 +246,6 @@ return; } - qDebug() << "fname" << file.fileName(); d->setMetaData(KPluginMetaData(file.fileName()), true); if (!d->metaData.isValid()) { qWarning() << "Failed to read metadata from .desktop file" << file.fileName(); @@ -531,8 +565,25 @@ } QVariant result = d->metaData.rawData().value(key).toVariant(); if (result.isValid()) { + const QVariant::Type t = KServiceTypeFactory::self()->findPropertyTypeByName(key); + + //special case if we want a stringlist: split values by ',' or ';' and construct the list + if (t == QVariant::StringList) { + if (result.canConvert<QString>()) { + result = d->deserializeList(result.toString()); + } else if (result.canConvert<QVariantList>()) { + QVariantList list = result.toList(); + QStringList newResult; + foreach (const QVariant &value, list) { + newResult += value.toString(); + } + result = newResult; + } else + qWarning() << "Cannot interpret" << result << "into a string list"; + } return result; } + // If the key was not found check compatibility for old key names and print a warning // These warnings should only happen if JSON was generated with kcoreaddons_desktop_to_json // but the application uses KPluginTrader::query() instead of KPluginLoader::findPlugins() -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org