┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-04-10 18:32:53 +0200
committerPeter Penz <[email protected]>2011-04-10 18:36:24 +0200
commit426aac2eab61b0d0da84dfa08c62725b5889b31a (patch)
tree5d4c8fb5c533b5b3238fa80eed712db5730a0200
parent2baa9ec45a3e7e169e73ee74c74c0954702ab882 (diff)
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
-rw-r--r--src/dolphinpart.cpp13
-rw-r--r--src/dolphinpart.h5
2 files changed, 17 insertions, 1 deletions
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 <KLocale>
#include <KMessageBox>
#include <KPluginFactory>
+#include <KRun>
#include <KToggleAction>
#include <KIO/NetAccess>
#include <KToolInvocation>
@@ -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
@@ -193,6 +193,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.
*/
void updateNewMenu();