diff --git a/.gitignore b/.gitignore index ea58dd6..953e0e8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /kde-baseapps-4.9.1.tar.xz /kde-baseapps-4.9.2.tar.xz /kde-baseapps-4.9.3.tar.xz +/kde-baseapps-4.9.4.tar.xz diff --git a/kde-baseapps-dolphin-solid-optimizations.patch b/kde-baseapps-dolphin-solid-optimizations.patch new file mode 100644 index 0000000..4b814d9 --- /dev/null +++ b/kde-baseapps-dolphin-solid-optimizations.patch @@ -0,0 +1,128 @@ +diff --git a/dolphin/src/dolphincontextmenu.cpp b/dolphin/src/dolphincontextmenu.cpp +index bb26c7a..e706695 100644 +--- a/dolphin/src/dolphincontextmenu.cpp ++++ b/dolphin/src/dolphincontextmenu.cpp +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -402,14 +403,17 @@ void DolphinContextMenu::addShowMenuBarAction() + + bool DolphinContextMenu::placeExists(const KUrl& url) const + { +- PlacesItemModel model; ++ const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml"); ++ KBookmarkManager* manager = KBookmarkManager::managerForFile(file, "kfilePlaces"); ++ KBookmarkGroup group = manager->root(); + +- const int count = model.count(); +- for (int i = 0; i < count; ++i) { +- const KUrl placeUrl = model.placesItem(i)->url(); +- if (placeUrl.equals(url, KUrl::CompareWithoutTrailingSlash)) { +- return true; +- } ++ KBookmark bookmark = group.first(); ++ while (!bookmark.isNull()) { ++ if (bookmark.url().equals(url, KUrl::CompareWithoutTrailingSlash)) { ++ return true; ++ } ++ ++ bookmark = group.next(bookmark); + } + + return false; +diff --git a/dolphin/src/panels/places/placesitemmodel.cpp b/dolphin/src/panels/places/placesitemmodel.cpp +index 1789f18..b352712 100644 +--- a/dolphin/src/panels/places/placesitemmodel.cpp ++++ b/dolphin/src/panels/places/placesitemmodel.cpp +@@ -41,6 +41,8 @@ + #include + #include + ++#include ++ + #include + #include + #include +@@ -76,8 +78,6 @@ PlacesItemModel::PlacesItemModel(QObject* parent) : + KStandardItemModel(parent), + m_fileIndexingEnabled(false), + m_hiddenItemsShown(false), +- m_availableDevices(), +- m_predicate(), + m_bookmarkManager(0), + m_systemBookmarks(), + m_systemBookmarksIndexes(), +@@ -556,7 +556,7 @@ void PlacesItemModel::slotDeviceAdded(const QString& udi) + { + const Solid::Device device(udi); + +- if (!m_predicate.matches(device)) { ++ if (!KFilePlacesDeviceCache::self()->predicate().matches(device)) { + return; + } + +@@ -567,10 +567,6 @@ void PlacesItemModel::slotDeviceAdded(const QString& udi) + + void PlacesItemModel::slotDeviceRemoved(const QString& udi) + { +- if (!m_availableDevices.contains(udi)) { +- return; +- } +- + for (int i = 0; i < m_bookmarkedItems.count(); ++i) { + PlacesItem* item = m_bookmarkedItems[i]; + if (item && item->udi() == udi) { +@@ -953,30 +949,13 @@ void PlacesItemModel::createSystemBookmarks() + + void PlacesItemModel::initializeAvailableDevices() + { +- QString predicate("[[[[ StorageVolume.ignored == false AND [ StorageVolume.usage == 'FileSystem' OR StorageVolume.usage == 'Encrypted' ]]" +- " OR " +- "[ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ]]" +- " OR " +- "OpticalDisc.availableContent & 'Audio' ]" +- " OR " +- "StorageAccess.ignored == false ]"); +- +- +- if (KProtocolInfo::isKnownProtocol("mtp")) { +- predicate.prepend("["); +- predicate.append(" OR PortableMediaPlayer.supportedProtocols == 'mtp']"); +- } +- +- m_predicate = Solid::Predicate::fromString(predicate); +- Q_ASSERT(m_predicate.isValid()); +- +- Solid::DeviceNotifier* notifier = Solid::DeviceNotifier::instance(); +- connect(notifier, SIGNAL(deviceAdded(QString)), this, SLOT(slotDeviceAdded(QString))); +- connect(notifier, SIGNAL(deviceRemoved(QString)), this, SLOT(slotDeviceRemoved(QString))); ++ KFilePlacesDeviceCache* placesCache = KFilePlacesDeviceCache::self(); ++ connect(placesCache, SIGNAL(deviceAdded(QString)), SLOT(slotDeviceAdded(QString))); ++ connect(placesCache, SIGNAL(deviceRemoved(QString)), SLOT(slotDeviceRemoved(QString))); + +- const QList& deviceList = Solid::Device::listFromQuery(m_predicate); +- foreach (const Solid::Device& device, deviceList) { +- m_availableDevices << device.udi(); ++ const QSet &devices = placesCache->devices(); ++ foreach (const QString& device, devices) { ++ slotDeviceAdded(device); + } + } + +diff --git a/dolphin/src/panels/places/placesitemmodel.h b/dolphin/src/panels/places/placesitemmodel.h +index 463e564..fc513be 100644 +--- a/dolphin/src/panels/places/placesitemmodel.h ++++ b/dolphin/src/panels/places/placesitemmodel.h +@@ -267,7 +267,6 @@ private: + bool m_hiddenItemsShown; + + QSet m_availableDevices; +- Solid::Predicate m_predicate; + KBookmarkManager* m_bookmarkManager; + + struct SystemBookmarkData diff --git a/kde-baseapps.spec b/kde-baseapps.spec index 0bf8ac5..f633c52 100644 --- a/kde-baseapps.spec +++ b/kde-baseapps.spec @@ -1,6 +1,6 @@ Name: kde-baseapps Summary: KDE Core Applications -Version: 4.9.3 +Version: 4.9.4 Release: 1%{?dist} License: GPLv2 @@ -31,6 +31,11 @@ Patch4: kdebase-4.3.4-bz#609039-chfn-parse.patch # as default browser in GNOME Patch5: kde-baseapps-4.9.2-konqueror-mimetyp.patch +# Use KPlacesDeviceCache and improve performance of context menu +# disable now, this patch causes new regression, backend devices are destroyed! +# the latest solid backend works fine without this patch +# Patch6: kde-baseapps-dolphin-solid-optimizations.patch + ## upstream patches %ifnarch s390 s390x @@ -119,6 +124,7 @@ Requires: kdelibs4-devel %patch3 -p2 -b .kde#228593 %patch4 -p2 -b .bz#631481 %patch5 -p1 -b .mimetyp.patch +#patch6 -p1 -b .dolphin-solid %build @@ -270,6 +276,12 @@ fi %changelog +* Mon Dec 03 2012 Than Ngo - 4.9.4-1 +- 4.9.4 + +* Thu Nov 29 2012 Dan Vrátil - 4.9.3-2 +- Dolphin Solid optimizations + * Sat Nov 03 2012 Rex Dieter - 4.9.3-1 - 4.9.3 diff --git a/sources b/sources index 67f6e15..810414a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a5782bc15ffd720fedce48e7538db5d7 kde-baseapps-4.9.3.tar.xz +a8fb5329986598d155e9861ea638da65 kde-baseapps-4.9.4.tar.xz