From 7f7bea872b58b78813d99e5ef170c376ab1cc2c7 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 22 Sep 2010 20:24:49 +0000 Subject: If the context-menu is opened for a file shown as search result, offer the actions "Open Parent Folder in New Window" and "Open Parent Folder in New Tab" svn path=/trunk/KDE/kdebase/apps/; revision=1178362 --- src/dolphinmainwindow.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 9a5e5e3a8..1c1343976 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1184,7 +1184,24 @@ void DolphinMainWindow::openContextMenu(const KFileItem& item, { DolphinContextMenu contextMenu(this, item, url); contextMenu.setCustomActions(customActions); - contextMenu.open(); + const DolphinContextMenu::Command command = contextMenu.open(); + + switch (command) { + case DolphinContextMenu::OpenParentFolderInNewWindow: { + DolphinMainWindow* window = DolphinApplication::app()->createMainWindow(); + window->changeUrl(item.url().upUrl()); + window->show(); + break; + } + + case DolphinContextMenu::OpenParentFolderInNewTab: + openNewTab(item.url().upUrl()); + break; + + case DolphinContextMenu::None: + default: + break; + } } void DolphinMainWindow::init() -- cgit v1.3