]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
Fixed issue in method naturalCompare: strings having numbers with the same amount...
[dolphin.git] / src / dolphincontextmenu.cpp
index 3be03dbecec596a178d5c9e132d8083c95d6ee15..6c4dda80ab828467373125409d24e8b26e0c824c 100644 (file)
@@ -15,7 +15,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
 #include "dolphincontextmenu.h"
@@ -38,7 +38,7 @@
 #include <assert.h>
 #include <kio/netaccess.h>
 #include <kmenu.h>
-#include <kstdaction.h>
+#include <kstandardaction.h>
 
 #include "dolphinmainwindow.h"
 #include "dolphinview.h"
@@ -91,12 +91,9 @@ void DolphinContextMenu::openViewportContextMenu()
 
     createNewMenu->insertSeparator();
 
-    QAction* action = 0;
-
-    Q3PtrListIterator<KAction> fileGrouptIt(dolphin->fileGroupActions());
-    while ((action = fileGrouptIt.current()) != 0) {
-        createNewMenu->addAction(action);
-        ++fileGrouptIt;
+    QLinkedListIterator<QAction*> fileGrouptIt(dolphin->fileGroupActions());
+    while (fileGrouptIt.hasNext()) {
+        createNewMenu->addAction(fileGrouptIt.next());
     }
 
     // TODO: not used yet. See documentation of Dolphin::linkGroupActions()
@@ -122,7 +119,7 @@ void DolphinContextMenu::openViewportContextMenu()
     popup->insertItem(SmallIcon("filenew"), i18n("Create New"), createNewMenu);
     popup->insertSeparator();
 
-    QAction* pasteAction = dolphin->actionCollection()->action(KStdAction::stdName(KStdAction::Paste));
+    QAction* pasteAction = dolphin->actionCollection()->action(KStandardAction::stdName(KStandardAction::Paste));
     popup->addAction(pasteAction);
 
     // setup 'View Mode' menu
@@ -180,12 +177,13 @@ void DolphinContextMenu::openItemContextMenu()
     const KUrl::List urls = m_dolphinView->selectedUrls();
 
     // insert 'Cut', 'Copy' and 'Paste'
-    const KStdAction::StdAction actionNames[] = { KStdAction::Cut, KStdAction::Copy, KStdAction::Paste };
-    const int count = sizeof(actionNames) / sizeof(KStdAction::StdAction);
+    const KStandardAction::StandardAction actionNames[] = { KStandardAction::Cut, KStandardAction::Copy, KStandardAction::Paste };
+    const int count = sizeof(actionNames) / sizeof(KStandardAction::StandardAction);
     for (int i = 0; i < count; ++i) {
-        QAction* action = dolphin->actionCollection()->action(KStdAction::stdName(actionNames[i]));
-        if (action)
+        QAction* action = dolphin->actionCollection()->action(KStandardAction::stdName(actionNames[i]));
+        if (action != 0) {
             popup->addAction(action);
+        }
     }
     popup->insertSeparator();
 
@@ -207,7 +205,7 @@ void DolphinContextMenu::openItemContextMenu()
     // insert 'Bookmark this folder...' entry
     // urls is a list of selected items, so insert boolmark menu if
     // urls contains only one item, i.e. no multiple selection made
-    QAction *bookmarkAction = 0;
+    QActionbookmarkAction = 0;
     if (m_fileInfo->isDir() && (urls.count() == 1)) {
         bookmarkAction = popup->addAction(i18n("Bookmark this folder"));
     }
@@ -300,8 +298,8 @@ QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
                 // will be skipped here.
                 const QString appName((*it)->name());
                 if (!containsEntry(openWithMenu, appName)) {
-                    QAction *action = openWithMenu->addAction((*it)->pixmap(K3Icon::Small),
-                                                              appName);
+                    const KIcon icon((*it)->icon());
+                    QAction *action = openWithMenu->addAction(icon, appName);
                     openWithVector.append(*it);
                     openWithActions << action;
                 }