]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Fix crash during shutdown
[dolphin.git] / src / dolphinmainwindow.cpp
index ea19468f93277ec738cc1d9ce1b59ad96f6038bd..3e4a60571f494a19183cfc9c5b1f6fd90ba2ef57 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "dolphinmainwindow.h"
 
+#include "config-terminal.h"
 #include "global.h"
 #include "dolphindockwidget.h"
 #include "dolphincontextmenu.h"
@@ -327,7 +328,7 @@ void DolphinMainWindow::openInNewTab()
     foreach (const KFileItem& item, list) {
         const QUrl& url = DolphinView::openItemAsFolderUrl(item);
         if (!url.isEmpty()) {
-            openNewTab(url);
+            m_tabWidget->openNewTab(url, QUrl(), DolphinTabWidget::AfterCurrentTab);
             tabCreated = true;
         }
     }
@@ -335,7 +336,7 @@ void DolphinMainWindow::openInNewTab()
     // if no new tab has been created from the selection
     // open the current directory in a new tab
     if (!tabCreated) {
-        openNewTab(m_activeViewContainer->url());
+        m_tabWidget->openNewTab(m_activeViewContainer->url(), QUrl(), DolphinTabWidget::AfterCurrentTab);
     }
 }
 
@@ -1213,7 +1214,7 @@ void DolphinMainWindow::setupActions()
     compareFiles->setEnabled(false);
     connect(compareFiles, &QAction::triggered, this, &DolphinMainWindow::compareFiles);
 
-#ifndef Q_OS_WIN
+#ifdef HAVE_TERMINAL
     if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal"));
         openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal"));
@@ -1332,7 +1333,7 @@ void DolphinMainWindow::setupDockWidgets()
             this, &DolphinMainWindow::showErrorMessage);
 
     // Setup "Terminal"
-#ifndef Q_OS_WIN
+#ifdef HAVE_TERMINAL
     if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
         terminalDock->setLocked(lock);
@@ -1605,7 +1606,7 @@ void DolphinMainWindow::updateSplitAction()
     QAction* splitAction = actionCollection()->action(QStringLiteral("split_view"));
     const DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
     if (tabPage->splitViewEnabled()) {
-        if (tabPage->primaryViewActive()) {
+        if (GeneralSettings::closeActiveSplitView() ? tabPage->primaryViewActive() : !tabPage->primaryViewActive()) {
             splitAction->setText(i18nc("@action:intoolbar Close left view", "Close"));
             splitAction->setToolTip(i18nc("@info", "Close left view"));
             splitAction->setIcon(QIcon::fromTheme(QStringLiteral("view-left-close")));