]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix possible double entries in details view
authorPeter Penz <peter.penz19@gmail.com>
Fri, 23 Dec 2011 20:10:32 +0000 (21:10 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 23 Dec 2011 20:14:28 +0000 (21:14 +0100)
The patch 30ae57ba807ecadfdef833a4895621fc330badc9 did not resolve the
issue completely: The pending items to insert must be dispatched before
checking for duplicates.

Related to this report the expanding for the remote-protocol has been
disabled.

BUG: 288521
FIXED-IN: 4.8.0

src/kitemviews/kfileitemmodel.cpp

index 3d4e653028ed0125d9c26ced450b05aec601c64f..b40865f8fee3d7d16b2199d1c09cc76274f1e0b7 100644 (file)
@@ -677,7 +677,11 @@ void KFileItemModel::slotNewItems(const KFileItemList& items)
     Q_ASSERT(!items.isEmpty());
 
     if (m_requestRole[ExpansionLevelRole] && m_rootExpansionLevel >= 0) {
-        const KFileItem item = items.first();
+        // To be able to compare whether the new items may be inserted as children
+        // of a parent item the pending items must be added to the model first.
+        dispatchPendingItemsToInsert();
+
+        KFileItem item = items.first();
 
         // If the expanding of items is enabled, the call
         // dirLister->openUrl(url, KDirLister::Keep) in KFileItemModel::setExpanded()
@@ -1171,6 +1175,7 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item)
             const QString protocol = rootUrl.protocol();
             const bool forceRootExpansionLevel = (protocol == QLatin1String("trash") ||
                                                   protocol == QLatin1String("nepomuk") ||
+                                                  protocol == QLatin1String("remote") ||
                                                   protocol.contains(QLatin1String("search")));
             if (forceRootExpansionLevel) {
                 m_rootExpansionLevel = ForceRootExpansionLevel;