]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/21.08'
authorNate Graham <nate@kde.org>
Tue, 28 Sep 2021 19:57:14 +0000 (13:57 -0600)
committerNate Graham <nate@kde.org>
Tue, 28 Sep 2021 19:57:14 +0000 (13:57 -0600)
1  2 
src/dolphinmainwindow.cpp

index e0d6c472573655b6f3387bfc82675f8eaf224025,3966a08fe3221b558d1b7947178fae26ee39825a..ec15bb978a0b012d57feaf9abdcaa45018bf9fd3
  #include <KStandardAction>
  #include <KStartupInfo>
  #include <KSycoca>
 +#include <KTerminalLauncherJob>
  #include <KToggleAction>
  #include <KToolBar>
  #include <KToolBarPopupAction>
 -#include <KToolInvocation>
  #include <KUrlComboBox>
  #include <KUrlNavigator>
  #include <KWindowSystem>
@@@ -211,9 -211,14 +211,12 @@@ DolphinMainWindow::DolphinMainWindow() 
      QTimer::singleShot(0, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction);
  
      m_fileItemActions.setParentWidget(this);
 -#if KIO_VERSION >= QT_VERSION_CHECK(5, 82, 0)
      connect(&m_fileItemActions, &KFileItemActions::error, this, [this](const QString &errorMessage) {
          showErrorMessage(errorMessage);
      });
 -#endif
+     connect(GeneralSettings::self(), &GeneralSettings::splitViewChanged,
+             this, &DolphinMainWindow::slotSplitViewChanged);
  }
  
  DolphinMainWindow::~DolphinMainWindow()
@@@ -437,6 -442,12 +440,12 @@@ void DolphinMainWindow::openNewTab(cons
      m_tabWidget->openNewTab(url, QUrl());
  }
  
+ void DolphinMainWindow::slotSplitViewChanged()
+ {
+     m_tabWidget->currentTabPage()->setSplitViewEnabled(GeneralSettings::splitView(), WithAnimation);
+     updateSplitAction();
+ }
  void DolphinMainWindow::openInNewTab()
  {
      const KFileItemList& list = m_activeViewContainer->view()->selectedItems();
@@@ -1037,9 -1048,7 +1046,9 @@@ void DolphinMainWindow::openTerminal(
      const QUrl url = m_activeViewContainer->url();
  
      if (url.isLocalFile()) {
 -        KToolInvocation::invokeTerminal(QString(), {}, url.toLocalFile());
 +        auto job = new KTerminalLauncherJob(QString());
 +        job->setWorkingDirectory(url.toLocalFile());
 +        job->start();
          return;
      }
  
                  statUrl = job->mostLocalUrl();
              }
  
 -            KToolInvocation::invokeTerminal(QString(), {}, statUrl.isLocalFile() ? statUrl.toLocalFile() : QDir::homePath());
 +            auto job = new KTerminalLauncherJob(QString());
 +            job->setWorkingDirectory(statUrl.isLocalFile() ? statUrl.toLocalFile() : QDir::homePath());
 +            job->start();
          });
  
          return;
      }
  
      // Nothing worked, just use $HOME
 -    KToolInvocation::invokeTerminal(QString(), {}, QDir::homePath());
 +    auto job = new KTerminalLauncherJob(QString());
 +    job->setWorkingDirectory(QDir::homePath());
 +    job->start();
  }
  
  void DolphinMainWindow::editSettings()
@@@ -1537,8 -1542,7 +1546,8 @@@ void DolphinMainWindow::setupActions(
      stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window"));
      stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-stash")));
      stashSplit->setCheckable(false);
 -    stashSplit->setVisible(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier")));
 +    QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface();
 +    stashSplit->setVisible(sessionInterface && sessionInterface->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier")));
      connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash);
  
      KStandardAction::redisplay(this, &DolphinMainWindow::reloadView, actionCollection());
@@@ -2101,11 -2105,6 +2110,6 @@@ void DolphinMainWindow::refreshViews(
      m_tabWidget->refreshViews();
  
      if (GeneralSettings::modifiedStartupSettings()) {
-         // The startup settings have been changed by the user (see bug #254947).
-         // Synchronize the split-view setting with the active view:
-         const bool splitView = GeneralSettings::splitView();
-         m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView, WithAnimation);
-         updateSplitAction();
          updateWindowTitle();
      }