diff options
author | Tobias C. Berner <tcberner@FreeBSD.org> | 2021-09-04 11:13:49 +0000 |
---|---|---|
committer | Tobias C. Berner <tcberner@FreeBSD.org> | 2021-09-04 11:13:49 +0000 |
commit | e858b5d6ba6d9901502eb8ee819616ec42736206 (patch) | |
tree | 41cfd1d597622223ee0395f07043677d2bfd6951 | |
parent | 99df221a20e3ebd8c1fe572582e5e9f9ea042b13 (diff) | |
download | ports-e858b5d6ba6d9901502eb8ee819616ec42736206.tar.gz ports-e858b5d6ba6d9901502eb8ee819616ec42736206.zip |
x11-fm/dolphin: add upstream fix to make dolphin's terminal work without kinit
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.
Upstream PR: 441072
Obtained from: https://invent.kde.org/system/dolphin/-/commit/27bfcde4efaf936243fc41e4a61d0cac32105ef6
Obtained from via: https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/dolphin/trunk/27bfcde4.patch
-rw-r--r-- | x11-fm/dolphin/Makefile | 1 | ||||
-rw-r--r-- | x11-fm/dolphin/files/patch-git_27b5cde-arch_backport | 101 |
2 files changed, 102 insertions, 0 deletions
diff --git a/x11-fm/dolphin/Makefile b/x11-fm/dolphin/Makefile index 8c4da2c76728..8b3fdf126bf6 100644 --- a/x11-fm/dolphin/Makefile +++ b/x11-fm/dolphin/Makefile @@ -1,5 +1,6 @@ PORTNAME= dolphin DISTVERSION= ${KDE_APPLICATIONS_VERSION} +PORTREVISION= 1 CATEGORIES= x11-fm kde kde-applications MAINTAINER= kde@FreeBSD.org diff --git a/x11-fm/dolphin/files/patch-git_27b5cde-arch_backport b/x11-fm/dolphin/files/patch-git_27b5cde-arch_backport new file mode 100644 index 000000000000..145aa5707ea2 --- /dev/null +++ b/x11-fm/dolphin/files/patch-git_27b5cde-arch_backport @@ -0,0 +1,101 @@ +Obtained from: + https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/dolphin/trunk/27bfcde4.patch + + +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] 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 +--- src/dolphinmainwindow.cpp ++++ 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 +--- src/dolphinpart.cpp ++++ 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() +-- +GitLab + |