]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
behavior change -> New Window opens with same URL
[dolphin.git] / src / dolphinmainwindow.cpp
index 185db71936e207aceb50c2407d4e810f07c1a579..a163ef7fd03d07c354b0c928610b0626a972f588 100644 (file)
@@ -290,7 +290,7 @@ void DolphinMainWindow::updateFilterBarAction(bool show)
 
 void DolphinMainWindow::openNewMainWindow()
 {
-    KRun::run(QStringLiteral("dolphin %u"), QList<QUrl>(), this);
+    Dolphin::openNewWindow({m_activeViewContainer->url()}, this);
 }
 
 void DolphinMainWindow::openNewActivatedTab()
@@ -331,7 +331,7 @@ void DolphinMainWindow::openInNewWindow()
     }
 
     if (!newWindowUrl.isEmpty()) {
-        KRun::run(QStringLiteral("dolphin %u"), {newWindowUrl}, this);
+        Dolphin::openNewWindow({newWindowUrl}, this);
     }
 }
 
@@ -552,9 +552,9 @@ void DolphinMainWindow::disableStopAction()
     actionCollection()->action(QStringLiteral("stop"))->setEnabled(false);
 }
 
-void DolphinMainWindow::showFilterBar(bool show)
+void DolphinMainWindow::showFilterBar()
 {
-    m_activeViewContainer->setFilterBarVisible(show);
+    m_activeViewContainer->setFilterBarVisible(true);
 }
 
 void DolphinMainWindow::toggleEditLocation()
@@ -772,11 +772,9 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
         changeUrl(KIO::upUrl(item.url()));
         break;
 
-    case DolphinContextMenu::OpenParentFolderInNewWindow: {
-
-        KRun::run(QStringLiteral("dolphin %u"), {KIO::upUrl(item.url())}, this);
+    case DolphinContextMenu::OpenParentFolderInNewWindow:
+        Dolphin::openNewWindow({KIO::upUrl(item.url())}, this);
         break;
-    }
 
     case DolphinContextMenu::OpenParentFolderInNewTab:
         openNewTab(KIO::upUrl(item.url()));
@@ -1017,12 +1015,8 @@ void DolphinMainWindow::setupActions()
                           SLOT(undo()),
                           actionCollection());
 
-    // need to remove shift+del from cut action, else the shortcut for deletejob
-    // doesn't work
-    QAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
-    auto cutShortcuts = cut->shortcuts();
-    cutShortcuts.removeAll(QKeySequence(Qt::SHIFT | Qt::Key_Delete));
-    actionCollection()->setDefaultShortcuts(cut, cutShortcuts);
+
+    KStandardAction::cut(this, SLOT(cut()), actionCollection());
     KStandardAction::copy(this, SLOT(copy()), actionCollection());
     QAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
     // The text of the paste-action is modified dynamically by Dolphin
@@ -1110,7 +1104,7 @@ void DolphinMainWindow::setupActions()
     KStandardAction::home(this, SLOT(goHome()), actionCollection());
 
     // setup 'Tools' menu
-    KToggleAction* showFilterBar = actionCollection()->add<KToggleAction>(QStringLiteral("show_filter_bar"));
+    QAction* showFilterBar = actionCollection()->addAction(QStringLiteral("show_filter_bar"));
     showFilterBar->setText(i18nc("@action:inmenu Tools", "Show Filter Bar"));
     showFilterBar->setIcon(QIcon::fromTheme(QStringLiteral("view-filter")));
     actionCollection()->setDefaultShortcut(showFilterBar, Qt::CTRL | Qt::Key_I);
@@ -1318,7 +1312,7 @@ void DolphinMainWindow::updateEditActions()
         KActionCollection* col = actionCollection();
         QAction* renameAction      = col->action(QStringLiteral("rename"));
         QAction* moveToTrashAction = col->action(QStringLiteral("move_to_trash"));
-        QAction* deleteAction      = col->action(QStringLiteral("delete"));
+        QAction* deleteAction      = col->action(KStandardAction::name(KStandardAction::DeleteFile));
         QAction* cutAction         = col->action(KStandardAction::name(KStandardAction::Cut));
         QAction* deleteWithTrashShortcut = col->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler