From: Nate Graham Date: Tue, 28 Sep 2021 19:57:14 +0000 (-0600) Subject: Merge branch 'release/21.08' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/0c44dfe2b1c143fae323b9ff4bd415cdd69c1086?hp=-c Merge branch 'release/21.08' --- 0c44dfe2b1c143fae323b9ff4bd415cdd69c1086 diff --combined src/dolphinmainwindow.cpp index e0d6c4725,3966a08fe..ec15bb978 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -56,10 -56,10 +56,10 @@@ #include #include #include +#include #include #include #include -#include #include #include #include @@@ -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; } @@@ -1053,18 -1062,14 +1062,18 @@@ 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(); }