- addOpenWithActions(fileItemActions);
-
- openParentAction = new QAction(QIcon::fromTheme(QStringLiteral("document-open-folder")),
- i18nc("@action:inmenu",
- "Open Path"),
- this);
- addAction(openParentAction);
-
- openParentInNewWindowAction = new QAction(QIcon::fromTheme(QStringLiteral("window-new")),
- i18nc("@action:inmenu",
- "Open Path in New Window"),
- this);
- addAction(openParentInNewWindowAction);
-
- openParentInNewTabAction = new QAction(QIcon::fromTheme(QStringLiteral("tab-new")),
- i18nc("@action:inmenu",
- "Open Path in New Tab"),
- this);
- addAction(openParentInNewTabAction);
+ addOpenWithActions();
+
+ addAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18nc("@action:inmenu", "Open Path"), [this]() {
+ m_mainWindow->changeUrl(KIO::upUrl(m_fileInfo.url()));
+ m_mainWindow->activeViewContainer()->view()->markUrlsAsSelected({m_fileInfo.url()});
+ m_mainWindow->activeViewContainer()->view()->markUrlAsCurrent(m_fileInfo.url());
+ });
+
+ addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("@action:inmenu", "Open Path in New Window"), [this]() {
+ Dolphin::openNewWindow({m_fileInfo.url()}, m_mainWindow, Dolphin::OpenNewWindowFlag::Select);
+ });
+
+ addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@action:inmenu", "Open Path in New Tab"), [this]() {
+ m_mainWindow->openNewTab(KIO::upUrl(m_fileInfo.url()));
+ });