Port-to-KTerminalLauncherJob.patch backport

epel9
Rex Dieter 3 years ago
parent 002be63281
commit d68365e690

@ -0,0 +1,97 @@
From 27bfcde4efaf936243fc41e4a61d0cac32105ef6 Mon Sep 17 00:00:00 2001
From: Nate Graham <nate@kde.org>
Date: Tue, 31 Aug 2021 09:09:14 -0600
Subject: [PATCH 38/38] Port to KTerminalLauncherJob
Dolphin still uses KToolInvocation::invokeTerminal() which is
deprecated and requires KInit. However Dolphin was ported away from
requiring it in other ways, so it is now possible to have Dolphin
running but not KInit, which breaks the "Open in Terminal"
functionality.
Using KTerminalLauncherJob fixes this. It was introduced in Frameworks
5.83, so the CMake dependency version is accordingly increased.
BUG: 441072
FIXED-IN: 21.12
---
CMakeLists.txt | 2 +-
src/dolphinmainwindow.cpp | 14 ++++++++++----
src/dolphinpart.cpp | 6 ++++--
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 62e347032..f3a5e3b4e 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -56,10 +56,10 @@
#include <KStandardAction>
#include <KStartupInfo>
#include <KSycoca>
+#include <KTerminalLauncherJob>
#include <KToggleAction>
#include <KToolBar>
#include <KToolBarPopupAction>
-#include <KToolInvocation>
#include <KUrlComboBox>
#include <KUrlNavigator>
#include <KWindowSystem>
@@ -1033,7 +1033,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;
}
@@ -1047,14 +1049,18 @@ void DolphinMainWindow::openTerminal()
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()
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 9c551d67a..8d528f418 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -32,7 +32,7 @@
#include <KPluginFactory>
#include <KIO/CommandLauncherJob>
#include <KSharedConfig>
-#include <KToolInvocation>
+#include <KTerminalLauncherJob>
#include <QActionGroup>
#include <QApplication>
@@ -567,7 +567,9 @@ QString DolphinPart::localFilePathOrHome() const
void DolphinPart::slotOpenTerminal()
{
- KToolInvocation::invokeTerminal(QString(), {}, localFilePathOrHome());
+ auto job = new KTerminalLauncherJob(QString());
+ job->setWorkingDirectory(localFilePathOrHome());
+ job->start();
}
void DolphinPart::slotFindFile()
--
2.31.1

@ -13,7 +13,7 @@
Name: dolphin
Summary: KDE File Manager
Version: 21.08.1
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
URL: https://invent.kde.org/system/dolphin
@ -27,6 +27,7 @@ URL: https://invent.kde.org/system/dolphin
Source0: http://download.kde.org/%{stable}/release-service/%{version}/src/%{name}-%{version}.tar.xz
## upstream patches (master)
Patch38: 0038-Port-to-KTerminalLauncherJob.patch
# for %%check
BuildRequires: desktop-file-utils
@ -174,6 +175,9 @@ make test ARGS="--output-on-failure --timeout 10" -C %{_target_platform} ||:
%changelog
* Wed Sep 01 2021 Rex Dieter <rdieter@fedoraproject.org> - 21.08.1-2
- Port-to-KTerminalLauncherJob.patch backport
* Wed Sep 01 2021 Rex Dieter <rdieter@fedoraproject.org> - 21.08.1-1
- 21.08.1

Loading…
Cancel
Save