diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2021-12-08 14:01:07 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2021-12-08 16:07:44 +0100 |
commit | f9435f8048d66cf3f4663b8f65d231c3f82388d3 (patch) | |
tree | 5e37c11d822279d781273bda0b642f9fcfc60741 /kde-frameworks/kio | |
parent | kde-frameworks/kiconthemes: Drop 5.88.0 (r0) (diff) | |
download | gentoo-f9435f8048d66cf3f4663b8f65d231c3f82388d3.tar.gz gentoo-f9435f8048d66cf3f4663b8f65d231c3f82388d3.tar.bz2 gentoo-f9435f8048d66cf3f4663b8f65d231c3f82388d3.zip |
kde-frameworks/kio: Fix KRun opening URLs twice
Upstream commit 25f3a6937a80f2748790265b9b688d64126e43d0
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=446272
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-frameworks/kio')
-rw-r--r-- | kde-frameworks/kio/files/kio-5.88.0-fix-KRun-open-URLs-twice.patch | 87 | ||||
-rw-r--r-- | kde-frameworks/kio/kio-5.88.0-r2.ebuild | 99 |
2 files changed, 186 insertions, 0 deletions
diff --git a/kde-frameworks/kio/files/kio-5.88.0-fix-KRun-open-URLs-twice.patch b/kde-frameworks/kio/files/kio-5.88.0-fix-KRun-open-URLs-twice.patch new file mode 100644 index 000000000000..0d3bf2aeca3a --- /dev/null +++ b/kde-frameworks/kio/files/kio-5.88.0-fix-KRun-open-URLs-twice.patch @@ -0,0 +1,87 @@ +From 25f3a6937a80f2748790265b9b688d64126e43d0 Mon Sep 17 00:00:00 2001 +From: Aleix Pol <aleixpol@kde.org> +Date: Tue, 30 Nov 2021 17:33:18 +0100 +Subject: [PATCH] Fix KRun::runApplication when xdg activation is involved + +Has waitForStarted account for xdg activation token request. + +BUG: 446272 +--- + src/gui/kprocessrunner.cpp | 13 ++++++++++--- + src/gui/kprocessrunner_p.h | 1 + + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/src/gui/kprocessrunner.cpp b/src/gui/kprocessrunner.cpp +index 130dade75..82c959afe 100644 +--- a/src/gui/kprocessrunner.cpp ++++ b/src/gui/kprocessrunner.cpp +@@ -32,6 +32,7 @@ + #include <QProcess> + #include <QStandardPaths> + #include <QString> ++#include <QTimer> + #include <QUuid> + + #ifdef Q_OS_WIN +@@ -259,7 +260,6 @@ void KProcessRunner::init(const KService::Ptr &service, + Q_UNUSED(iconName); + #endif + +- bool waitingForXdgToken = false; + if (KWindowSystem::isPlatformWayland()) { + if (!asn.isEmpty()) { + m_process->setEnv(QStringLiteral("XDG_ACTIVATION_TOKEN"), QString::fromUtf8(asn)); +@@ -274,7 +274,7 @@ void KProcessRunner::init(const KService::Ptr &service, + } + if (window) { + const int launchedSerial = KWindowSystem::lastInputSerial(window); +- waitingForXdgToken = true; ++ m_waitingForXdgToken = true; + connect(this, &KProcessRunner::xdgActivationTokenArrived, m_process.get(), [this] { + startProcess(); + }); +@@ -285,6 +285,7 @@ void KProcessRunner::init(const KService::Ptr &service, + if (tokenSerial == launchedSerial) { + m_process->setEnv(QStringLiteral("XDG_ACTIVATION_TOKEN"), token); + Q_EMIT xdgActivationTokenArrived(); ++ m_waitingForXdgToken = false; + } + }); + KWindowSystem::requestXdgActivationToken(window, launchedSerial, QFileInfo(m_serviceEntryPath).completeBaseName()); +@@ -316,7 +317,7 @@ void KProcessRunner::init(const KService::Ptr &service, + m_description = userVisibleName; + } + +- if (!waitingForXdgToken) { ++ if (!m_waitingForXdgToken) { + startProcess(); + } + } +@@ -331,6 +332,12 @@ void ForkingProcessRunner::startProcess() + + bool ForkingProcessRunner::waitForStarted(int timeout) + { ++ if (m_process->state() == QProcess::NotRunning && m_waitingForXdgToken) { ++ QEventLoop loop; ++ QObject::connect(m_process.get(), &QProcess::stateChanged, &loop, &QEventLoop::quit); ++ QTimer::singleShot(timeout, &loop, &QEventLoop::quit); ++ loop.exec(); ++ } + return m_process->waitForStarted(timeout); + } + +diff --git a/src/gui/kprocessrunner_p.h b/src/gui/kprocessrunner_p.h +index 1f94df7a2..df6f08f64 100644 +--- a/src/gui/kprocessrunner_p.h ++++ b/src/gui/kprocessrunner_p.h +@@ -140,6 +140,7 @@ protected: + qint64 m_pid = 0; + KService::Ptr m_service; + QString m_serviceEntryPath; ++ bool m_waitingForXdgToken = false; + + private: + void emitDelayedError(const QString &errorMsg); +-- +GitLab + diff --git a/kde-frameworks/kio/kio-5.88.0-r2.ebuild b/kde-frameworks/kio/kio-5.88.0-r2.ebuild new file mode 100644 index 000000000000..924efc14421f --- /dev/null +++ b/kde-frameworks/kio/kio-5.88.0-r2.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ECM_DESIGNERPLUGIN="true" +ECM_TEST="forceoptional" +PVCUT=$(ver_cut 1-2) +QTMIN=5.15.2 +VIRTUALX_REQUIRED="test" +inherit ecm kde.org xdg-utils + +DESCRIPTION="Framework providing transparent file and data management" + +LICENSE="LGPL-2+" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" +IUSE="acl +handbook kerberos +kwallet X" + +# tests hang +RESTRICT="test" + +RDEPEND=" + dev-libs/libxml2 + dev-libs/libxslt + >=dev-qt/qtdbus-${QTMIN}:5 + >=dev-qt/qtdeclarative-${QTMIN}:5 + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtnetwork-${QTMIN}:5[ssl] + >=dev-qt/qtwidgets-${QTMIN}:5 + >=dev-qt/qtxml-${QTMIN}:5 + =kde-frameworks/kauth-${PVCUT}*:5 + =kde-frameworks/karchive-${PVCUT}*:5 + =kde-frameworks/kbookmarks-${PVCUT}*:5 + =kde-frameworks/kcodecs-${PVCUT}*:5 + =kde-frameworks/kcompletion-${PVCUT}*:5 + =kde-frameworks/kconfig-${PVCUT}*:5 + =kde-frameworks/kconfigwidgets-${PVCUT}*:5 + =kde-frameworks/kcoreaddons-${PVCUT}*:5 + =kde-frameworks/kcrash-${PVCUT}*:5 + =kde-frameworks/kdbusaddons-${PVCUT}*:5 + =kde-frameworks/kguiaddons-${PVCUT}*:5 + =kde-frameworks/ki18n-${PVCUT}*:5 + =kde-frameworks/kiconthemes-${PVCUT}*:5 + =kde-frameworks/kitemviews-${PVCUT}*:5 + =kde-frameworks/kjobwidgets-${PVCUT}*:5 + =kde-frameworks/knotifications-${PVCUT}*:5 + =kde-frameworks/kservice-${PVCUT}*:5 + =kde-frameworks/ktextwidgets-${PVCUT}*:5 + =kde-frameworks/kwidgetsaddons-${PVCUT}*:5 + =kde-frameworks/kwindowsystem-${PVCUT}*:5 + =kde-frameworks/kxmlgui-${PVCUT}*:5 + =kde-frameworks/solid-${PVCUT}*:5 + acl? ( + sys-apps/attr + virtual/acl + ) + handbook? ( =kde-frameworks/kdoctools-${PVCUT}*:5 ) + kerberos? ( virtual/krb5 ) + kwallet? ( =kde-frameworks/kwallet-${PVCUT}*:5 ) + X? ( >=dev-qt/qtx11extras-${QTMIN}:5 ) +" +DEPEND="${RDEPEND} + >=dev-qt/qtconcurrent-${QTMIN}:5 + test? ( sys-libs/zlib ) + X? ( + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXrender + ) +" +PDEPEND=">=kde-frameworks/kded-${PVCUT}:5" + +PATCHES=( + "${FILESDIR}"/${P}-fix-copy-between-filesystems.patch + "${FILESDIR}"/${P}-fix-KRun-open-URLs-twice.patch # KDE-bug 446272 +) + +src_configure() { + local mycmakeargs=( + -DKIO_NO_PUBLIC_QTCONCURRENT=ON + $(cmake_use_find_package acl ACL) + $(cmake_use_find_package handbook KF5DocTools) + $(cmake_use_find_package kerberos GSSAPI) + $(cmake_use_find_package kwallet KF5Wallet) + $(cmake_use_find_package X X11) + ) + + ecm_src_configure +} + +pkg_postinst() { + ecm_pkg_postinst + xdg_desktop_database_update +} + +pkg_postrm() { + ecm_pkg_postrm + xdg_desktop_database_update +} |