* Mon Aug 22 2011 Kevin Kofler <Kevin@tigcc.ticalc.org> 4.7.0-4

- fix Plasma::PackageMetadata::read to match the behavior of KService
This commit is contained in:
Kevin Kofler 2011-08-22 02:11:13 +02:00
parent 2ba6013470
commit e4a0ae7113
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 7804efbf05a08d0170c24f4d6f14b661fcfb9d9e Mon Sep 17 00:00:00 2001
Message-Id: <7804efbf05a08d0170c24f4d6f14b661fcfb9d9e.1313971467.git.kevin.kofler@chello.at>
From: Kevin Kofler <kevin.kofler@chello.at>
Date: Mon, 22 Aug 2011 01:53:57 +0200
Subject: [PATCH] Bugfix: Plasma::PackageMetadata::read: Match the behavior of
KService.
---
plasma/packagemetadata.cpp | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/plasma/packagemetadata.cpp b/plasma/packagemetadata.cpp
index 59163b2..e6b47b6 100644
--- a/plasma/packagemetadata.cpp
+++ b/plasma/packagemetadata.cpp
@@ -120,8 +120,27 @@ void PackageMetadata::read(const QString &filename)
d->name = config.readEntry("Name", d->name);
d->icon = config.readEntry("Icon", d->icon);
d->description = config.readEntry("Comment", d->description);
- d->keywords = config.readEntry("Keywords", d->keywords);
- d->serviceType = config.readEntry("X-KDE-ServiceTypes", d->serviceType);
+ bool hasKeywords = config.hasKey("Keywords");
+ bool hasXKdeKeywords = config.hasKey("X-KDE-Keywords");
+ if (hasKeywords && hasXKdeKeywords) {
+ d->keywords = config.readEntry("Keywords", d->keywords);
+ d->keywords.append(config.readEntry("X-KDE-Keywords", d->keywords));
+ } else if (hasKeywords) {
+ d->keywords = config.readEntry("Keywords", d->keywords);
+ } else if (hasXKdeKeywords) {
+ d->keywords = config.readEntry("X-KDE-Keywords", d->keywords);
+ }
+ bool hasServiceTypes = config.hasKey("ServiceTypes");
+ bool hasXKdeServiceTypes = config.hasKey("X-KDE-ServiceTypes");
+ if (hasServiceTypes && hasXKdeServiceTypes) {
+ d->serviceType = config.readEntry("ServiceTypes", d->serviceType);
+ d->serviceType.append(',');
+ d->serviceType.append(config.readEntry("X-KDE-ServiceTypes", d->serviceType));
+ } else if (hasServiceTypes) {
+ d->serviceType = config.readEntry("ServiceTypes", d->serviceType);
+ } else if (hasXKdeServiceTypes) {
+ d->serviceType = config.readEntry("X-KDE-ServiceTypes", d->serviceType);
+ }
d->pluginName = config.readEntry("X-KDE-PluginInfo-Name", d->pluginName);
d->author = config.readEntry("X-KDE-PluginInfo-Author", d->author);
d->email = config.readEntry("X-KDE-PluginInfo-Email", d->email);
--
1.7.4.4

View File

@ -16,7 +16,7 @@
Summary: KDE Libraries
Version: 4.7.0
Release: 3%{?dist}
Release: 4%{?dist}
Name: kdelibs
Epoch: 6
@ -109,6 +109,9 @@ Patch41: 0002-Trigger-installation-of-missing-components-when-inst.patch
# Implement automatic scanning of source code for required data engines.
# https://git.reviewboard.kde.org/r/102350/
Patch42: 0003-Implement-automatic-scanning-of-source-code-for-requ.patch
# Bugfix: Plasma::PackageMetadata::read: Match the behavior of KService.
# https://git.reviewboard.kde.org/r/102404/
Patch43: 0004-Bugfix-Plasma-PackageMetadata-read-Match-the-behavio.patch
## upstreamable
# add gpg2 support to knewstuff, rough first try s/gpg/gpg2/
@ -309,6 +312,7 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{version}-%{release}|" kio/kio/kprotocolmanage
%patch40 -p1 -b .libplasma-pk-0001
%patch41 -p1 -b .libplasma-pk-0002
%patch42 -p1 -b .libplasma-pk-0003
%patch43 -p1 -b .libplasma-pk-0003
%endif
# upstreamable patches
@ -566,6 +570,9 @@ rm -rf %{buildroot}
%changelog
* Mon Aug 22 2011 Kevin Kofler <Kevin@tigcc.ticalc.org> 4.7.0-4
- fix Plasma::PackageMetadata::read to match the behavior of KService
* Sun Aug 21 2011 Kevin Kofler <Kevin@tigcc.ticalc.org> 4.7.0-3
- backport my GSoC 2011 patches for libplasma PackageKit integration (F17+)
- package plasma-dataengine-depextractor in -devel (F17+)