From 2bce082049cf757709237daa7636d3e9109baa60 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 30 Mar 2007 04:51:06 +0000 Subject: [PATCH] fixed "duplicate items issue" for the column view (don't invoke KDirLister::openUrl() twice for directories that have been loaded already) svn path=/trunk/KDE/kdebase/apps/; revision=647979 --- src/dolphinview.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 030a6abae..8a102c94f 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -841,17 +841,29 @@ void DolphinView::startDirLister(const KUrl& url, bool reload) m_blockContentsMovedSignal = true; m_dirLister->stop(); + bool openDir = true; 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; + if (m_dirLister->directories().contains(url)) { + // The dir lister contains the directory already, so + // KDirLister::openUrl() may not been invoked twice. + m_dirLister->updateDirectory(url); + openDir = false; } + else { + 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; + } + } + } + + if (openDir) { + m_dirLister->openUrl(url, keepOldDirs, reload); } - m_dirLister->openUrl(url, keepOldDirs, reload); } QString DolphinView::defaultStatusBarText() const -- 2.47.3