mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
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
This commit is contained in:
parent
c5534a5f93
commit
b67c098347
|
@ -55,6 +55,7 @@ DolphinSortFilterProxyModel::DolphinSortFilterProxyModel(QObject* parent) :
|
||||||
// sort by the user visible string for now
|
// sort by the user visible string for now
|
||||||
setSortRole(Qt::DisplayRole);
|
setSortRole(Qt::DisplayRole);
|
||||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
sort(KDirModel::Name, Qt::Ascending);
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
|
DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
|
||||||
|
|
|
@ -841,12 +841,15 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
|
||||||
m_blockContentsMovedSignal = true;
|
m_blockContentsMovedSignal = true;
|
||||||
m_dirLister->stop();
|
m_dirLister->stop();
|
||||||
|
|
||||||
bool keepOldDirs = isColumnViewActive();
|
bool keepOldDirs = isColumnViewActive() && !reload;
|
||||||
if (keepOldDirs && !m_dirLister->url().isParentOf(url)) {
|
if (keepOldDirs) {
|
||||||
// The current URL is not a child of the dir lister
|
const KUrl& dirListerUrl = m_dirLister->url();
|
||||||
// URL. This may happen when e. g. a bookmark has been selected
|
if ((dirListerUrl == url) || !m_dirLister->url().isParentOf(url)) {
|
||||||
// and hence the view must be reset.
|
// The current URL is not a child of the dir lister
|
||||||
keepOldDirs = false;
|
// 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);
|
m_dirLister->openUrl(url, keepOldDirs, reload);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue