]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/treeviewsidebarpage.h
Create a SidebarTreeView which will include support for drag & drop in later releases...
[dolphin.git] / src / treeviewsidebarpage.h
index 045586bccf2edbb37b84850c9d1c29a2876d299b..9810908558e55140f29a2ed2d7e251dff78a6fda 100644 (file)
 #ifndef TREEVIEWSIDEBARPAGE_H
 #define TREEVIEWSIDEBARPAGE_H
 
+#include <kurl.h>
 #include <sidebarpage.h>
 
 class KDirLister;
 class KDirModel;
 class KUrl;
 
+class DolphinSortFilterProxyModel;
+class SidebarTreeView;
 class QModelIndex;
-class QTreeView;
 
 /**
- * @brief
+ * @brief Shows a tree view of the directories starting from
+ *        the currently selected bookmark.
+ *
+ * The tree view is always synchronized with the currently active view
+ * from the main window.
  */
 class TreeViewSidebarPage : public SidebarPage
 {
@@ -55,10 +61,17 @@ private slots:
     void updateSelection(const KUrl& url);
 
     /**
-     * Updates the URL of the active view to the URL
+     * Expands the tree in a way that the item with the URL m_selectedUrl
+     * gets visible. Is called by TreeViewSidebarPage::updateSelection()
+     * if the dir lister has been completed.
+     */
+    void expandSelectionParent();
+
+    /**
+     * Updates the active view to the URL
      * which is given by the item with the index \a index.
      */
-    void updateViewUrl(const QModelIndex& index);
+    void updateActiveView(const QModelIndex& index);
 
 private:
     /**
@@ -70,7 +83,9 @@ private:
 private:
     KDirLister* m_dirLister;
     KDirModel* m_dirModel;
-    QTreeView* m_treeView;
+    DolphinSortFilterProxyModel* m_proxyModel;
+    SidebarTreeView* m_treeView;
+    KUrl m_selectedUrl;
 };
 
 #endif // BOOKMARKSSIDEBARPAGE_H