[kde-doc-english] [krusader/plasma] /: Clean up the "bookmark current" action

Simon Persson simon.persson at mykolab.com
Tue Jul 7 10:32:57 UTC 2015


Git commit 7be83bb6c136b4f797487652e4ed5dd9d40bb885 by Simon Persson.
Committed on 07/07/2015 at 10:29.
Pushed by persson into branch 'plasma'.

Clean up the "bookmark current" action

First, rename it to "add bookmark" as I think that is clearer, using "bookmark" as a verb is not so common. Also no need to say "current" since there is no other action for bookmarking something else. The current location will be default for the new bookmark, yes, but that is normal and expected.. no need to point out.
Then there were two slots, one in KrBookmarkHandler and one in KRslots, for adding a bookmark. I just kept one of them.
Then there were two actions, just kept one of them. This way the active shortcut is displayed in the menu now, user-visible improvement!
Also update the keyboard shortcuts listed in documentation, as I had forgotten to do that before.

M  +2    -2    doc/bookmarks.docbook
M  +3    -16   doc/keyboard-commands.docbook
M  +2    -8    krusader/BookMan/krbookmarkhandler.cpp
M  +0    -1    krusader/BookMan/krbookmarkhandler.h
M  +2    -2    krusader/kractions.cpp
M  +1    -1    krusader/kractions.h
M  +1    -6    krusader/krslots.cpp
M  +0    -1    krusader/krslots.h

http://commits.kde.org/krusader/7be83bb6c136b4f797487652e4ed5dd9d40bb885

diff --git a/doc/bookmarks.docbook b/doc/bookmarks.docbook
index 9032a9e..4e795fc 100644
--- a/doc/bookmarks.docbook
+++ b/doc/bookmarks.docbook
@@ -82,8 +82,8 @@
     <para>To use your bookmarks, click the 
     <guibutton>BookMan II</guibutton> button and choose a bookmark.
     You may also use the <link linkend="key_bindings">Key-Bindings</link>: 
-    <keycombo action="simul">&Ctrl;&Shift;
-    <keycap>D</keycap></keycombo> to bookmark the current item, 
+    <keycombo action="simul">&Ctrl;
+    <keycap>B</keycap></keycombo> to bookmark the current item,
     <keycombo action="simul">&Alt;
     <keycap>right/left arrow</keycap></keycombo> to 
     open right/left panel bookmarks list and
diff --git a/doc/keyboard-commands.docbook b/doc/keyboard-commands.docbook
index 108d48d..0605fb6 100644
--- a/doc/keyboard-commands.docbook
+++ b/doc/keyboard-commands.docbook
@@ -678,7 +678,9 @@
               </para>
             </entry>
             <entry>
-              <para><link linkend="splitter">Combine files</link>.</para>
+              <para>
+                <link linkend="bookman">Add bookmark for the current item.</link>
+              </para>
             </entry>
           </row>
           <row>
@@ -1093,21 +1095,6 @@
               <para>
                 <keycombo action="simul">
                 &Ctrl;&Shift;
-                <keycap>D</keycap></keycombo>
-              </para>
-            </entry>
-            <entry>
-              <para>
-                <link linkend="bookman">Bookmark current
-                item.</link>
-              </para>
-            </entry>
-          </row>
-          <row>
-            <entry>
-              <para>
-                <keycombo action="simul">
-                &Ctrl;&Shift;
                 <keycap>F</keycap></keycombo>
               </para>
             </entry>
diff --git a/krusader/BookMan/krbookmarkhandler.cpp b/krusader/BookMan/krbookmarkhandler.cpp
index 760cf1c..b8e209b 100644
--- a/krusader/BookMan/krbookmarkhandler.cpp
+++ b/krusader/BookMan/krbookmarkhandler.cpp
@@ -73,11 +73,6 @@ KrBookmarkHandler::~KrBookmarkHandler()
     delete _privateCollection;
 }
 
-void KrBookmarkHandler::slotBookmarkCurrent()
-{
-    bookmarkCurrent(ACTIVE_PANEL->virtualPath());
-}
-
 void KrBookmarkHandler::bookmarkCurrent(QUrl url)
 {
     QPointer<KrAddBookmarkDlg> dlg = new KrAddBookmarkDlg(_mainWindow->widget(), url);
@@ -434,9 +429,8 @@ void KrBookmarkHandler::buildMenu(KrBookmark *parent, QMenu *menu)
         if (!hasJumpback)
             menu->addSeparator();
 
-        QAction *bmAddAct = menu->addAction(krLoader->loadIcon("bookmark-new", KIconLoader::Small),
-                                            i18n("Bookmark Current"), this, SLOT(slotBookmarkCurrent()));
-        _specialBookmarks.append(bmAddAct);
+        menu->addAction(KrActions::actAddBookmark);
+        _specialBookmarks.append(KrActions::actAddBookmark);
         QAction *bmAct = menu->addAction(krLoader->loadIcon("bookmarks", KIconLoader::Small),
                                          i18n("Manage Bookmarks"), manager, SLOT(slotEditBookmarks()));
         _specialBookmarks.append(bmAct);
diff --git a/krusader/BookMan/krbookmarkhandler.h b/krusader/BookMan/krbookmarkhandler.h
index 61885ec..7555489 100644
--- a/krusader/BookMan/krbookmarkhandler.h
+++ b/krusader/BookMan/krbookmarkhandler.h
@@ -65,7 +65,6 @@ protected:
     void removeReferences(KrBookmark *root, KrBookmark *bmToRemove);
 
 protected slots:
-    void slotBookmarkCurrent();
     void bookmarksChanged(const QString&, const QString&);
     void slotActivated(const QUrl &url);
 
diff --git a/krusader/kractions.cpp b/krusader/kractions.cpp
index 4d38027..d197cdf 100644
--- a/krusader/kractions.cpp
+++ b/krusader/kractions.cpp
@@ -66,7 +66,7 @@ QAction *KrActions::actSwapSides = 0;
 QAction *KrActions::actFind = 0;
 QAction *KrActions::actLocate = 0;
 QAction *KrActions::actSwitchFullScreenTE = 0;
-//QAction *KrActions::actAddBookmark = 0;
+QAction *KrActions::actAddBookmark = 0;
 QAction *KrActions::actSavePosition = 0;
 QAction *KrActions::actSelectColorMask = 0;
 QAction *KrActions::actOpenLeftBm = 0;
@@ -280,7 +280,7 @@ void KrActions::setupActions(Krusader *krusaderApp)
     NEW_KACTION(actCompare, i18n("Compare b&y Content..."), "document-multiple", 0, SLOTS, SLOT(compareContent()), "compare");
     NEW_KACTION(actMultiRename, i18n("Multi &Rename..."), "krename", Qt::SHIFT + Qt::Key_F9, SLOTS, SLOT(multiRename()), "multirename");
 
-    NEW_KACTION(tmp, i18n("Bookmark Current"), 0, KStandardShortcut::addBookmark(), SLOTS, SLOT(bookmarkCurrent()), "bookmark current");
+    NEW_KACTION(actAddBookmark, i18n("Add Bookmark"), "bookmark-new", KStandardShortcut::addBookmark(), SLOTS, SLOT(addBookmark()), "add bookmark");
     NEW_KACTION(actVerticalMode, i18n("Vertical Mode"), "view-split-top-bottom", Qt::ALT + Qt::CTRL + Qt::Key_R, MAIN_VIEW, SLOT(toggleVerticalMode()), "toggle vertical mode");
 #if 0
     actUserMenu = new QAction(i18n("User Menu"), ALT + Qt::Key_QuoteLeft, SLOTS,
diff --git a/krusader/kractions.h b/krusader/kractions.h
index 4a97570..3601e11 100644
--- a/krusader/kractions.h
+++ b/krusader/kractions.h
@@ -53,7 +53,7 @@ public:
     static QAction *actMountMan, *actNewTool, *actSwapPanels, *actSwapSides;
     static QAction *actKonfigurator, *actToolsSetup, *actFind;
     static QAction *actRemoteEncoding;
-    static QAction *actSelectColorMask, *actMultiRename, *actOpenLeftBm, *actOpenRightBm;
+    static QAction *actSelectColorMask, *actMultiRename, *actOpenLeftBm, *actOpenRightBm, *actAddBookmark;
     static QAction *actSplit, *actQueueManager;
     static QAction *actCombine;
     static QAction *actUserMenu;
diff --git a/krusader/krslots.cpp b/krusader/krslots.cpp
index 98d4551..665b27d 100644
--- a/krusader/krslots.cpp
+++ b/krusader/krslots.cpp
@@ -252,11 +252,6 @@ void KRslots::compareContent(QUrl url1, QUrl url2)
         KMessageBox::error(0, i18n("Error executing %1.", diffProg));
 }
 
-void KRslots::addBookmark()
-{
-    // TODO: this no longer works!
-}
-
 // GUI toggle slots
 void KRslots::toggleFnkeys()
 {
@@ -791,7 +786,7 @@ void KRslots::jsConsole()
 #endif
 }
 
-void KRslots::bookmarkCurrent()
+void KRslots::addBookmark()
 {
     krBookMan->bookmarkCurrent(ACTIVE_PANEL->virtualPath());
 }
diff --git a/krusader/krslots.h b/krusader/krslots.h
index 4bc59c4..9e54fdc 100644
--- a/krusader/krslots.h
+++ b/krusader/krslots.h
@@ -109,7 +109,6 @@ public slots:
     void toggleFnkeys();
     void toggleCmdline();
     void multiRename();
-    void bookmarkCurrent();
     void cmdlinePopup();
     void slotSplit();
     void slotCombine();



More information about the kde-doc-english mailing list