From e26ba53471ea902d18e59a4a8fc52ccdf4c7b4ea Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 3 Mar 2007 13:03:15 +0000 Subject: Assure that the root of the tree view always matchs to the bookmark shown in the URL navigator. svn path=/trunk/KDE/kdebase/apps/; revision=638825 --- src/treeviewsidebarpage.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/treeviewsidebarpage.cpp') diff --git a/src/treeviewsidebarpage.cpp b/src/treeviewsidebarpage.cpp index f57146684..32edef05e 100644 --- a/src/treeviewsidebarpage.cpp +++ b/src/treeviewsidebarpage.cpp @@ -19,6 +19,7 @@ #include "treeviewsidebarpage.h" +#include "bookmarkselector.h" #include "dolphinmainwindow.h" #include "dolphinview.h" @@ -76,12 +77,20 @@ void TreeViewSidebarPage::activeViewChanged() void TreeViewSidebarPage::updatePosition(const KUrl& url) { + KUrl baseUrl = BookmarkSelector::baseBookmark(url).url(); + if (m_dirLister->url() != baseUrl) { + m_dirLister->stop(); + m_dirLister->openUrl(baseUrl); + } + + // TODO: open sub folders to be synchronous to 'url' } void TreeViewSidebarPage::connectToActiveView() { DolphinView* view = mainWindow()->activeView(); - m_dirLister->openUrl(view->url(), true); + m_dirLister->stop(); + m_dirLister->openUrl(view->url()); connect(view, SIGNAL(urlChanged(const KUrl&)), this, SLOT(updatePosition(const KUrl&))); } -- cgit v1.3