Hello community, here is the log from the commit of package kdelibs4 for openSUSE:Factory checked in at 2013-10-19 11:11:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdelibs4 (Old) and /work/SRC/openSUSE:Factory/.kdelibs4.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdelibs4" Changes: -------- --- /work/SRC/openSUSE:Factory/kdelibs4/kdelibs4-apidocs.changes 2013-10-03 15:54:06.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kdelibs4.new/kdelibs4-apidocs.changes 2013-10-19 11:15:56.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Oct 18 15:40:44 UTC 2013 - hrvoje.sen...@gmail.com + +- Added 0001-Fix-association-with-derived-mimetype-again.patch, fixes + remaining issues in mimetype handling, see e.g. kde#324502 + +------------------------------------------------------------------- kdelibs4.changes: same change New: ---- 0001-Fix-association-with-derived-mimetype-again.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdelibs4.spec ++++++ --- /var/tmp/diff_new_pack.J93iYU/_old 2013-10-19 11:16:11.000000000 +0200 +++ /var/tmp/diff_new_pack.J93iYU/_new 2013-10-19 11:16:11.000000000 +0200 @@ -108,6 +108,8 @@ # when e.g. starting dolphin from CLI # NOTE patch is from master, aka 4.12 branch Patch1000: 0001-verbose.patch +# PATCH-FIX-UPSTREAM 0001-Fix-association-with-derived-mimetype-again.patch -- fixup for resolving kde#321706. resolves kde#324502 +Patch2000: 0001-Fix-association-with-derived-mimetype-again.patch PreReq: permissions Requires: soprano >= %( echo `rpm -q --queryformat '%{VERSION}' libsoprano-devel`) Recommends: strigi >= %( echo `rpm -q --queryformat '%{VERSION}' strigi-devel`) @@ -173,6 +175,7 @@ %patch10 %patch11 -p1 %patch1000 -p1 +%patch2000 -p1 %build EXTRA_FLAGS="-DLIB_INSTALL_DIR=%{_kde4_libdir} \ ++++++ 0001-Fix-association-with-derived-mimetype-again.patch ++++++ >From f723e2e7d36b597c5262bf63dde380d89ec6bfcb Mon Sep 17 00:00:00 2001 From: David Faure <fa...@kde.org> Date: Fri, 18 Oct 2013 09:44:17 +0200 Subject: [PATCH 1/1] Fix association-with-derived-mimetype again. 871cccc8a88a made it impossible to re-order file type associations. 7f42bf253009 fixed that, but changed the value of KService::mimeTypes(), which broke okular. This new fix works the same way, but only inside kbuildsycoca when it processes the mimetypes. The value of KService::mimeTypes() is now restored to be exactly what's in the desktop file. CCBUG: 321706 FIXED-IN: 4.11.3 --- kdecore/services/kservice.cpp | 45 +++++++++--------------------------------- kdecore/tests/kservicetest.cpp | 7 ++++--- kded/kbuildservicefactory.cpp | 11 ++++++++++- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/kdecore/services/kservice.cpp b/kdecore/services/kservice.cpp index d7945bf..8e81929 100644 --- a/kdecore/services/kservice.cpp +++ b/kdecore/services/kservice.cpp @@ -227,44 +227,17 @@ void KServicePrivate::init( const KDesktopFile *config, KService* q ) << "has an empty mimetype!"; continue; } - - // The following searches through the list for duplicate, inherited mimetypes - // For example, if application/rtf and text/plain are both listed application/rtf is removed - // since it is inherited from text/plain - // This is a reworked fix for revision 871cccc8a88a600c8f850a020d44bfc5f5858caa - bool shouldAdd = true; - KMimeType::Ptr mimeType1 = KMimeTypeRepository::self()->findMimeTypeByName(st); - if (mimeType1) { - foreach(const QString mime2, lstServiceTypes) { - // Don't compare the mimetype with itself - if (st == mime2) { - continue; - } - - // is checks for inheritance and aliases, so this should suffice - if (mimeType1->is(mime2)) { - shouldAdd = false; - break; - } + int initialPreference = m_initialPreference; + if ( st_it.hasNext() ) { + // TODO better syntax - separate group with mimetype=number entries? + bool isNumber; + const int val = st_it.peekNext().toInt(&isNumber); + if (isNumber) { + initialPreference = val; + st_it.next(); } } - - // Only add unique mimetypes - if (shouldAdd) { - int initialPreference = m_initialPreference; - if (st_it.hasNext()) { - // TODO better syntax - separate group with mimetype=number entries? - bool isNumber; - const int val = st_it.peekNext().toInt(&isNumber); - if (isNumber) { - initialPreference = val; - st_it.next(); - } - } - m_serviceTypes.push_back(KService::ServiceTypeAndPreference(initialPreference, st)); - } else { - //kDebug(servicesDebugArea())<<"Not adding"<<st<<"from"<<entryPath; - } + m_serviceTypes.push_back(KService::ServiceTypeAndPreference(initialPreference, st)); } if (entryMap.contains(QLatin1String("Actions"))) { diff --git a/kdecore/tests/kservicetest.cpp b/kdecore/tests/kservicetest.cpp index 0dba8d9..7371475 100644 --- a/kdecore/tests/kservicetest.cpp +++ b/kdecore/tests/kservicetest.cpp @@ -91,7 +91,7 @@ void KServiceTest::initTestCase() group.writeEntry("X-KDE-Library", "fakepart"); group.writeEntry("X-KDE-Protocols", "http,ftp"); group.writeEntry("X-KDE-ServiceTypes", "KParts/ReadOnlyPart,Browser/View,KParts/ReadWritePart"); - group.writeEntry("MimeType", "text/plain;"); + group.writeEntry("MimeType", "text/plain;text/html;"); } // faketextplugin: a ktexteditor plugin @@ -168,6 +168,7 @@ void KServiceTest::testProperty() KService::Ptr fakePart = KService::serviceByDesktopPath("fakepart.desktop"); QVERIFY(fakePart); // see initTestCase; it should be found. QVERIFY(fakePart->propertyNames().contains("X-KDE-Protocols")); + QCOMPARE(fakePart->mimeTypes(), QStringList() << "text/plain" << "text/html"); // okular relies on subclasses being kept here const QStringList protocols = fakePart->property("X-KDE-Protocols").toStringList(); QCOMPARE(protocols, QStringList() << "http" << "ftp"); } @@ -356,7 +357,7 @@ void KServiceTest::testHasServiceType1() // with services constructed with a ful KService fakepart( fakepartPath ); QVERIFY( fakepart.hasServiceType( "KParts/ReadOnlyPart" ) ); QVERIFY( fakepart.hasServiceType( "KParts/ReadWritePart" ) ); - QCOMPARE(fakepart.mimeTypes(), QStringList() << "text/plain"); + QCOMPARE(fakepart.mimeTypes(), QStringList() << "text/plain" << "text/html"); QString faketextPluginPath = KStandardDirs::locate( "services", "faketextplugin.desktop" ); QVERIFY( !faketextPluginPath.isEmpty() ); @@ -371,7 +372,7 @@ void KServiceTest::testHasServiceType2() // with services coming from ksycoca QVERIFY( !fakepart.isNull() ); QVERIFY( fakepart->hasServiceType( "KParts/ReadOnlyPart" ) ); QVERIFY( fakepart->hasServiceType( "KParts/ReadWritePart" ) ); - QCOMPARE(fakepart->mimeTypes(), QStringList() << "text/plain"); + QCOMPARE(fakepart->mimeTypes(), QStringList() << "text/plain" << "text/html"); KService::Ptr faketextPlugin = KService::serviceByDesktopPath( "faketextplugin.desktop" ); QVERIFY( !faketextPlugin.isNull() ); diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp index 5fb091b..b4564bd 100644 --- a/kded/kbuildservicefactory.cpp +++ b/kded/kbuildservicefactory.cpp @@ -267,7 +267,16 @@ void KBuildServiceFactory::populateServiceTypes() continue; } } else { - m_offerHash.addServiceOffer(mime->name(), offer); // mime->name so that we resolve aliases + bool shouldAdd = true; + foreach (const QString &otherType, service->serviceTypes()) { + if (stName != otherType && mime->is(otherType)) { + shouldAdd = false; + } + } + if (shouldAdd) { + //kDebug(7021) << "Adding service" << service->entryPath() << "to" << mime->name(); + m_offerHash.addServiceOffer(mime->name(), offer); // mime->name so that we resolve aliases + } } } } -- 1.8.4 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org