┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-27 21:43:47 +0000
committerPeter Penz <[email protected]>2007-03-27 21:43:47 +0000
commitb67c098347268f87a911c8a9bf2f9b13a2d13caf (patch)
treeb516ac8bd093c34d5468cf97c9d91b1c3e9f5c32 /src
parentc5534a5f93c51180849ff269aa9a792938ddcd2f (diff)
Minimize the duplicate items problem when using a proxy model and letting KDirLister keep its old directories.
svn path=/trunk/KDE/kdebase/apps/; revision=647294
Diffstat (limited to 'src')
-rw-r--r--src/dolphinsortfilterproxymodel.cpp1
-rw-r--r--src/dolphinview.cpp15
2 files changed, 10 insertions, 6 deletions
diff --git a/src/dolphinsortfilterproxymodel.cpp b/src/dolphinsortfilterproxymodel.cpp
index 9374a40ad..b81f1800f 100644
--- a/src/dolphinsortfilterproxymodel.cpp
+++ b/src/dolphinsortfilterproxymodel.cpp
@@ -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()
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 519189e9a..030a6abae 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -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);
}