Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: kde-apps/dolphin/files/, kde-apps/dolphin/
Date: Thu, 02 Sep 2021 11:55:45
Message-Id: 1630583691.8f7e326d0097bd072ed9ce9a1a5d43d059ac22ab.asturm@gentoo
1 commit: 8f7e326d0097bd072ed9ce9a1a5d43d059ac22ab
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 2 11:54:51 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 2 11:54:51 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=8f7e326d
7
8 kde-apps/dolphin: Port to KTerminalLauncherJob
9
10 See also:
11 https://mail.kde.org/pipermail/distributions/2021-September/001048.html
12
13 Upstream commit 27bfcde4efaf936243fc41e4a61d0cac32105ef6
14
15 Package-Manager: Portage-3.0.22, Repoman-3.0.3
16 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
17
18 kde-apps/dolphin/dolphin-21.08.49.9999.ebuild | 4 +
19 ...phin-21.08.1-port-to-KTerminalLauncherJob.patch | 110 +++++++++++++++++++++
20 2 files changed, 114 insertions(+)
21
22 diff --git a/kde-apps/dolphin/dolphin-21.08.49.9999.ebuild b/kde-apps/dolphin/dolphin-21.08.49.9999.ebuild
23 index b3aedd3464..883ba27bcc 100644
24 --- a/kde-apps/dolphin/dolphin-21.08.49.9999.ebuild
25 +++ b/kde-apps/dolphin/dolphin-21.08.49.9999.ebuild
26 @@ -61,6 +61,10 @@ RDEPEND="${DEPEND}
27 >=kde-apps/kio-extras-${PVCUT}:5
28 "
29
30 +PATCHES=(
31 + "${FILESDIR}/${PN}-21.08.1-port-to-KTerminalLauncherJob.patch" # KDE-bug 441072
32 +)
33 +
34 src_configure() {
35 local mycmakeargs=(
36 -DCMAKE_DISABLE_FIND_PACKAGE_PackageKitQt5=ON
37
38 diff --git a/kde-apps/dolphin/files/dolphin-21.08.1-port-to-KTerminalLauncherJob.patch b/kde-apps/dolphin/files/dolphin-21.08.1-port-to-KTerminalLauncherJob.patch
39 new file mode 100644
40 index 0000000000..2189355de6
41 --- /dev/null
42 +++ b/kde-apps/dolphin/files/dolphin-21.08.1-port-to-KTerminalLauncherJob.patch
43 @@ -0,0 +1,110 @@
44 +From 27bfcde4efaf936243fc41e4a61d0cac32105ef6 Mon Sep 17 00:00:00 2001
45 +From: Nate Graham <nate@×××.org>
46 +Date: Tue, 31 Aug 2021 09:09:14 -0600
47 +Subject: [PATCH] Port to KTerminalLauncherJob
48 +
49 +Dolphin still uses KToolInvocation::invokeTerminal() which is
50 +deprecated and requires KInit. However Dolphin was ported away from
51 +requiring it in other ways, so it is now possible to have Dolphin
52 +running but not KInit, which breaks the "Open in Terminal"
53 +functionality.
54 +
55 +Using KTerminalLauncherJob fixes this. It was introduced in Frameworks
56 +5.83, so the CMake dependency version is accordingly increased.
57 +
58 +BUG: 441072
59 +FIXED-IN: 21.12
60 +---
61 + CMakeLists.txt | 2 +-
62 + src/dolphinmainwindow.cpp | 14 ++++++++++----
63 + src/dolphinpart.cpp | 6 ++++--
64 + 3 files changed, 15 insertions(+), 7 deletions(-)
65 +
66 +diff --git a/CMakeLists.txt b/CMakeLists.txt
67 +index 7d50205bc..ec87cdecc 100644
68 +--- a/CMakeLists.txt
69 ++++ b/CMakeLists.txt
70 +@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
71 + project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
72 +
73 + set(QT_MIN_VERSION "5.15.0")
74 +-set(KF5_MIN_VERSION "5.81.0")
75 ++set(KF5_MIN_VERSION "5.83.0")
76 +
77 + set(CMAKE_CXX_STANDARD 17)
78 + set(CMAKE_CXX_STANDARD_REQUIRED ON)
79 +diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
80 +index 62e347032..f3a5e3b4e 100644
81 +--- a/src/dolphinmainwindow.cpp
82 ++++ b/src/dolphinmainwindow.cpp
83 +@@ -56,10 +56,10 @@
84 + #include <KStandardAction>
85 + #include <KStartupInfo>
86 + #include <KSycoca>
87 ++#include <KTerminalLauncherJob>
88 + #include <KToggleAction>
89 + #include <KToolBar>
90 + #include <KToolBarPopupAction>
91 +-#include <KToolInvocation>
92 + #include <KUrlComboBox>
93 + #include <KUrlNavigator>
94 + #include <KWindowSystem>
95 +@@ -1033,7 +1033,9 @@ void DolphinMainWindow::openTerminal()
96 + const QUrl url = m_activeViewContainer->url();
97 +
98 + if (url.isLocalFile()) {
99 +- KToolInvocation::invokeTerminal(QString(), {}, url.toLocalFile());
100 ++ auto job = new KTerminalLauncherJob(QString());
101 ++ job->setWorkingDirectory(url.toLocalFile());
102 ++ job->start();
103 + return;
104 + }
105 +
106 +@@ -1047,14 +1049,18 @@ void DolphinMainWindow::openTerminal()
107 + statUrl = job->mostLocalUrl();
108 + }
109 +
110 +- KToolInvocation::invokeTerminal(QString(), {}, statUrl.isLocalFile() ? statUrl.toLocalFile() : QDir::homePath());
111 ++ auto job = new KTerminalLauncherJob(QString());
112 ++ job->setWorkingDirectory(statUrl.isLocalFile() ? statUrl.toLocalFile() : QDir::homePath());
113 ++ job->start();
114 + });
115 +
116 + return;
117 + }
118 +
119 + // Nothing worked, just use $HOME
120 +- KToolInvocation::invokeTerminal(QString(), {}, QDir::homePath());
121 ++ auto job = new KTerminalLauncherJob(QString());
122 ++ job->setWorkingDirectory(QDir::homePath());
123 ++ job->start();
124 + }
125 +
126 + void DolphinMainWindow::editSettings()
127 +diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
128 +index 9c551d67a..8d528f418 100644
129 +--- a/src/dolphinpart.cpp
130 ++++ b/src/dolphinpart.cpp
131 +@@ -32,7 +32,7 @@
132 + #include <KPluginFactory>
133 + #include <KIO/CommandLauncherJob>
134 + #include <KSharedConfig>
135 +-#include <KToolInvocation>
136 ++#include <KTerminalLauncherJob>
137 +
138 + #include <QActionGroup>
139 + #include <QApplication>
140 +@@ -567,7 +567,9 @@ QString DolphinPart::localFilePathOrHome() const
141 +
142 + void DolphinPart::slotOpenTerminal()
143 + {
144 +- KToolInvocation::invokeTerminal(QString(), {}, localFilePathOrHome());
145 ++ auto job = new KTerminalLauncherJob(QString());
146 ++ job->setWorkingDirectory(localFilePathOrHome());
147 ++ job->start();
148 + }
149 +
150 + void DolphinPart::slotFindFile()
151 +--
152 +GitLab
153 +