]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/treeviewsidebarpage.cpp
Ported to KBookmarkManager::closestBookmark - which even solves another TODO about...
[dolphin.git] / src / treeviewsidebarpage.cpp
index 19feb58745b5290a86dbf3dae6581723af4d8d1a..523e21a7820206ec77024e6171973c60292b2944 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "treeviewsidebarpage.h"
 
-#include "bookmarkselector.h"
+#include "kbookmarkmanager.h"
 #include "dolphinmainwindow.h"
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphinview.h"
@@ -34,6 +34,7 @@
 #include <QItemSelectionModel>
 #include <QTreeView>
 #include <QVBoxLayout>
+#include "dolphinsettings.h"
 
 // TODO: currently when using a proxy model the strange effect occurs
 // that items get duplicated. Activate the following define to have the proxy
@@ -98,7 +99,8 @@ void TreeViewSidebarPage::setUrl(const KUrl& url)
     m_url = url;
 
     // adjust the root of the tree to the base bookmark
-    const KUrl baseUrl = BookmarkSelector::baseBookmark(url).url();
+    KBookmarkManager* bookmarkManager = DolphinSettings::instance().bookmarkManager();
+    const KUrl baseUrl = bookmarkManager->root().closestBookmark(url).url();
     if (m_dirLister->url() != baseUrl) {
         m_dirLister->stop();
         m_dirLister->openUrl(baseUrl);