X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d567bc3aea444ff3bc70e4180faaaa1f124be93b..de4ffa3322c8d919ebdb0cdb51115bace8aa8d11:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 3be03dbec..6c4dda80a 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -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 #include #include -#include +#include #include "dolphinmainwindow.h" #include "dolphinview.h" @@ -91,12 +91,9 @@ void DolphinContextMenu::openViewportContextMenu() createNewMenu->insertSeparator(); - QAction* action = 0; - - Q3PtrListIterator fileGrouptIt(dolphin->fileGroupActions()); - while ((action = fileGrouptIt.current()) != 0) { - createNewMenu->addAction(action); - ++fileGrouptIt; + QLinkedListIterator 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; + QAction* bookmarkAction = 0; if (m_fileInfo->isDir() && (urls.count() == 1)) { bookmarkAction = popup->addAction(i18n("Bookmark this folder")); } @@ -300,8 +298,8 @@ QList 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; }