]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Minimize the duplicate items problem when using a proxy model and letting KDirLister...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 27 Mar 2007 21:43:47 +0000 (21:43 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 27 Mar 2007 21:43:47 +0000 (21:43 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=647294

src/dolphinsortfilterproxymodel.cpp
src/dolphinview.cpp

index 9374a40ad5de57c12190d52ecdd4cdab00c45536..b81f1800f3323f71e33d0d3e67def7dfba2a127f 100644 (file)
@@ -55,6 +55,7 @@ DolphinSortFilterProxyModel::DolphinSortFilterProxyModel(QObject* parent) :
     // sort by the user visible string for now
     setSortRole(Qt::DisplayRole);
     setSortCaseSensitivity(Qt::CaseInsensitive);
+    sort(KDirModel::Name, Qt::Ascending);
 }
 
 DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
index 519189e9ad26b1acf66874b7b88e3e49db1a949a..030a6abaec8231ec8eba7e4d4b7c714fff8c71c1 100644 (file)
@@ -841,12 +841,15 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
     m_blockContentsMovedSignal = true;
     m_dirLister->stop();
 
-    bool keepOldDirs = isColumnViewActive();
-    if (keepOldDirs && !m_dirLister->url().isParentOf(url)) {
-        // The current URL is not a child of the dir lister
-        // URL. This may happen when e. g. a bookmark has been selected
-        // and hence the view must be reset.
-        keepOldDirs = false;
+    bool keepOldDirs = isColumnViewActive() && !reload;
+    if (keepOldDirs) {
+        const KUrl& dirListerUrl = m_dirLister->url();
+        if ((dirListerUrl == url) || !m_dirLister->url().isParentOf(url)) {
+            // The current URL is not a child of the dir lister
+            // URL. This may happen when e. g. a bookmark has been selected
+            // and hence the view must be reset.
+            keepOldDirs = false;
+        }
     }
     m_dirLister->openUrl(url, keepOldDirs, reload);
 }