X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/72ddf319b6dfbd117dee69d3f1eba964b5fb7f22..bd47eb2e6d:/src/panels/places/placespanel.cpp diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 3c9309435..0ce6d69a5 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 #include "dolphindebug.h" #include @@ -71,6 +72,11 @@ PlacesPanel::~PlacesPanel() { } +void PlacesPanel::proceedWithTearDown() +{ + m_model->proceedWithTearDown(); +} + bool PlacesPanel::urlChanged() { if (!url().isValid() || url().scheme().contains(QStringLiteral("search"))) { @@ -109,6 +115,10 @@ void PlacesPanel::showEvent(QShowEvent* event) m_model->setGroupedSorting(true); connect(m_model, &PlacesItemModel::errorMessage, this, &PlacesPanel::errorMessage); + connect(m_model, &PlacesItemModel::storageTearDownRequested, + this, &PlacesPanel::storageTearDownRequested); + connect(m_model, &PlacesItemModel::storageTearDownExternallyRequested, + this, &PlacesPanel::storageTearDownExternallyRequested); m_view = new PlacesView(); m_view->setWidgetCreator(new KItemListWidgetCreator()); @@ -192,6 +202,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,12 +243,14 @@ 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. triggerItem(index, Qt::MiddleButton); } else if (action == teardownAction) { - m_model->requestTeardown(index); + m_model->requestTearDown(index); } else if (action == ejectAction) { m_model->requestEject(index); }