diff options
| author | Nathaniel Graham <[email protected]> | 2017-09-11 22:03:21 +0200 |
|---|---|---|
| committer | Albert Astals Cid <[email protected]> | 2017-09-11 22:04:22 +0200 |
| commit | 2b2bab4049d948cb0f8319ba7d4d8d35debb1388 (patch) | |
| tree | 23fe84e3684bd72746e9a65c0bf80cd10b4fb9e1 /src/panels/places/placespanel.cpp | |
| parent | 4c1df50d522a09577274e19a8fe66bd865f3a2da (diff) | |
Add "Open in New Window to Dolphin's places context menu
Summary:
BUG: 384352
Add an "Open in New Window" menu item to the context menu for Dolphin's places items.
Test Plan:
Tested in up-to-date KDE Neon. Works as expected:
{F3898707}
Reviewers: #dolphin, #kde_applications, dfaure, aacid, elvisangelaccio, emmanuelp, broulik
Reviewed By: #dolphin, emmanuelp, broulik
Subscribers: alexeymin, emmanuelp, broulik, sefaeyeoglu, #dolphin
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D7690
Diffstat (limited to 'src/panels/places/placespanel.cpp')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 3c9309435..19a17be08 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -25,6 +25,7 @@ #include "dolphin_generalsettings.h" +#include "global.h" #include <KFileItem> #include "dolphindebug.h" #include <KDirNotify> @@ -192,6 +193,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) } } + QAction* openInNewWindowAction = menu.addAction(QIcon::fromTheme("window-new"), i18nc("@item:inmenu", "Open in New Window")); QAction* openInNewTabAction = menu.addAction(QIcon::fromTheme("tab-new"), i18nc("@item:inmenu", "Open in New Tab")); if (!isDevice && !isTrash) { menu.addSeparator(); @@ -232,6 +234,8 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) } else if (action == hideAction) { item->setHidden(hideAction->isChecked()); m_model->saveBookmarks(); + } else if (action == openInNewWindowAction) { + Dolphin::openNewWindow({PlacesItemModel::convertedUrl(m_model->data(index).value("url").toUrl())}, this); } else if (action == openInNewTabAction) { // TriggerItem does set up the storage first and then it will // emit the slotItemMiddleClicked signal, because of Qt::MiddleButton. |
