+ // expand all directories until the parent directory of m_leafDir
+ const KUrl parentUrl = m_leafDir.upUrl();
+ QModelIndex dirIndex = m_dolphinModel->indexForUrl(parentUrl);
+ QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
+ m_treeView->setExpanded(proxyIndex, true);
+
+ // assure that m_leafDir gets selected
+ dirIndex = m_dolphinModel->indexForUrl(m_leafDir);
+ proxyIndex = m_proxyModel->mapFromSource(dirIndex);
+ m_treeView->scrollTo(proxyIndex);
+
+ QItemSelectionModel* selModel = m_treeView->selectionModel();
+ selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::Select);
+}
+
+
+void TreeViewSidebarPage::loadSubTree()
+{
+ QItemSelectionModel* selModel = m_treeView->selectionModel();
+ selModel->clearSelection();
+
+ if (m_leafDir.isParentOf(m_dirLister->url())) {
+ // The leaf directory is not a child of the base URL, hence
+ // no sub directory must be loaded or selected.
+ return;
+ }
+
+ const QModelIndex index = m_dolphinModel->indexForUrl(m_leafDir);