X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/429427767bc6340ac8aafea3736b575ddcf186b4..bd47eb2e6d:/src/panels/places/placespanel.cpp diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 17367b865..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,12 +202,15 @@ 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(); } - editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit...")); + if (!isDevice) { + editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit...")); + } QAction* removeAction = 0; if (!isDevice && !item->isSystemItem()) { @@ -230,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); }