]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Readd KFind shortcut for the Dolphin KPart
authorPeter Penz <peter.penz19@gmail.com>
Sun, 10 Apr 2011 16:32:53 +0000 (18:32 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 10 Apr 2011 16:36:24 +0000 (18:36 +0200)
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
src/dolphinpart.h

index c861e1d2bbec8af4c74058ab83ebadde13a3de51..2990435953e0dd47f3e707146b64d7a06631d597 100644 (file)
@@ -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 :
index 097753a1a5a22e43611e9771a7064ec33650a69f..17650469ded7cd0083545219cc4c1f6f06497cec 100644 (file)
@@ -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.
      */