From 426aac2eab61b0d0da84dfa08c62725b5889b31a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 10 Apr 2011 18:32:53 +0200 Subject: [PATCH] Readd KFind shortcut for the Dolphin KPart When the searching has been integrated into Dolphin the "Find File..." entry had been removed from the Tools menu. Readd it into the Dolphin KPart so that it is still available for Konqueror. BUG: 270072 FIXED-IN: 4.7.0 --- src/dolphinpart.cpp | 13 ++++++++++++- src/dolphinpart.h | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index c861e1d2b..299043595 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -193,6 +194,12 @@ void DolphinPart::createActions() goActionGroup); // Tools menu + KAction* findFile = actionCollection()->addAction("find_file"); + findFile->setText(i18nc("@action:inmenu Tools", "Find File...")); + findFile->setShortcut(Qt::CTRL | Qt::Key_F); + findFile->setIcon(KIcon("edit-find")); + connect(findFile, SIGNAL(triggered()), this, SLOT(slotFindFile())); + if (KAuthorized::authorizeKAction("shell_access")) { KAction* action = actionCollection()->addAction("open_terminal"); action->setIcon(KIcon("utilities-terminal")); @@ -200,7 +207,6 @@ void DolphinPart::createActions() connect(action, SIGNAL(triggered()), SLOT(slotOpenTerminal())); action->setShortcut(Qt::Key_F4); } - } void DolphinPart::createGoAction(const char* name, const char* iconName, @@ -516,6 +522,11 @@ void DolphinPart::slotOpenTerminal() KToolInvocation::invokeTerminal(QString(), dir); } +void DolphinPart::slotFindFile() +{ + KRun::run("kfind", url(), widget()); +} + void DolphinPart::updateNewMenu() { // As requested by KNewFileMenu : diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 097753a1a..17650469d 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -192,6 +192,11 @@ private Q_SLOTS: */ void slotOpenTerminal(); + /** + * Open KFind with the current path. + */ + void slotFindFile(); + /** * Updates the 'Create New...' sub menu, just before it's shown. */ -- 2.47.3