┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/places
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2023-09-10 15:24:39 +0200
committerMéven Car <[email protected]>2023-09-10 15:24:39 +0200
commit4cbeb81b2b8e2d37c93cda4d88787e08e0658291 (patch)
tree013a28405e8011fd5a5a5c514aaf3daa395a42b1 /src/panels/places
parent0ed26df6a9074b71ae247017e1080b2285b73438 (diff)
parent5c33e0211ff09f37adb5b48c59cf15b67c0059dc (diff)
Merge remote-tracking branch 'origin/master' into kf6
Diffstat (limited to 'src/panels/places')
-rw-r--r--src/panels/places/placespanel.cpp10
-rw-r--r--src/panels/places/placespanel.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp
index 8b245f0e7..8bdb18ba2 100644
--- a/src/panels/places/placespanel.cpp
+++ b/src/panels/places/placespanel.cpp
@@ -47,6 +47,15 @@ PlacesPanel::PlacesPanel(QWidget *parent)
connect(m_configureTrashAction, &QAction::triggered, this, &PlacesPanel::slotConfigureTrash);
addAction(m_configureTrashAction);
+ m_openInSplitView = new QAction(QIcon::fromTheme(QStringLiteral("view-right-new")), i18nc("@action:inmenu", "Open in Split View"));
+ m_openInSplitView->setPriority(QAction::HighPriority);
+ connect(m_openInSplitView, &QAction::triggered, this, [this]() {
+ const QUrl url = currentIndex().data(KFilePlacesModel::UrlRole).toUrl();
+ Q_EMIT openInSplitViewRequested(url);
+ });
+
+ addAction(m_openInSplitView);
+
connect(this, &PlacesPanel::contextMenuAboutToShow, this, &PlacesPanel::slotContextMenuAboutToShow);
connect(this, &PlacesPanel::iconSizeChanged, this, [](const QSize &newSize) {
@@ -188,6 +197,7 @@ void PlacesPanel::slotContextMenuAboutToShow(const QModelIndex &index, QMenu *me
const Solid::Device device = placesModel->deviceForIndex(index);
m_configureTrashAction->setVisible(url.scheme() == QLatin1String("trash"));
+ m_openInSplitView->setVisible(url.isValid());
// show customContextMenuActions only on the view's context menu
if (!url.isValid() && !device.isValid()) {
diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h
index 2eb309483..cbd5fc224 100644
--- a/src/panels/places/placespanel.h
+++ b/src/panels/places/placespanel.h
@@ -51,6 +51,7 @@ Q_SIGNALS:
void storageTearDownRequested(const QString &mountPath);
void storageTearDownExternallyRequested(const QString &mountPath);
void storageTearDownSuccessful();
+ void openInSplitViewRequested(const QUrl &url);
protected:
void showEvent(QShowEvent *event) override;
@@ -75,6 +76,7 @@ private:
QPersistentModelIndex m_indexToTearDown;
QAction *m_configureTrashAction;
+ QAction *m_openInSplitView;
QAction *m_lockPanelsAction;
};