+
+}
+
+void TreeViewSidebarPage::showEvent(QShowEvent* event)
+{
+ SidebarPage::showEvent(event);
+}
+
+void TreeViewSidebarPage::contextMenuEvent(QContextMenuEvent* event)
+{
+ SidebarPage::contextMenuEvent(event);
+
+ const QModelIndex index = m_treeView->indexAt(event->pos());
+ if (!index.isValid()) {
+ // only open a context menu above a directory item
+ return;
+ }
+
+ const QModelIndex dirModelIndex = m_proxyModel->mapToSource(index);
+ KFileItem* item = m_dirModel->itemForIndex(dirModelIndex);
+
+ emit changeSelection(KFileItemList());
+ TreeViewContextMenu contextMenu(this, item);
+ contextMenu.open();