Commit cc1bf962 authored by Peter Penz's avatar Peter Penz
Browse files

Minimize the duplicate items problem when using a proxy model and letting...

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
parent 87e5e24c
......@@ -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()
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment