commit:     19a0f717d4322e58473f4e8aea88521fd158abf6
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 16 21:58:32 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Oct 20 13:25:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19a0f717

kde-apps/kio-extras: Fix kio_filenamesearch crash

Reported-by: Eric F. Garioud <eric-f.garioud <AT> wanadoo.fr>
Bug: https://bugs.gentoo.org/817008
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...o-extras-21.04.3-kio_filenamesearch-crash.patch | 36 ++++++++++++++++++++++
 kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild   |  1 +
 ...04.3-r3.ebuild => kio-extras-21.08.2-r1.ebuild} | 15 +++------
 3 files changed, 42 insertions(+), 10 deletions(-)

diff --git 
a/kde-apps/kio-extras/files/kio-extras-21.04.3-kio_filenamesearch-crash.patch 
b/kde-apps/kio-extras/files/kio-extras-21.04.3-kio_filenamesearch-crash.patch
new file mode 100644
index 00000000000..dff398e68a2
--- /dev/null
+++ 
b/kde-apps/kio-extras/files/kio-extras-21.04.3-kio_filenamesearch-crash.patch
@@ -0,0 +1,36 @@
+From 5dff395ecea2977cf149c293c16c4d4a5151493b Mon Sep 17 00:00:00 2001
+From: Ahmad Samir <a.samir...@gmail.com>
+Date: Fri, 9 Jul 2021 17:11:02 +0200
+Subject: [PATCH] kio_filenamesearch: fix crash due to KCoreDirLister changes
+
+Error reporting was changed in KCoreDirlister, to match the original behaviour
+we need to explicitly disable auto error handling.
+
+This fixes a crash while searching in Dolphin, kio_filenamesearch intrenally
+uses a dirlister, and a nested event loop, if there is an error while listing
+some dir it tries to report it using a job ui delegate, but the parent job
+could well be dead by that time, which causes a crash:
+"QWidget: Cannot create a QWidget without QApplication"
+
+Note that this crash only happens if KDE_FORK_SLAVES is _not_ set.
+
+BUG: 438187
+---
+ filenamesearch/kio_filenamesearch.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/filenamesearch/kio_filenamesearch.cpp 
b/filenamesearch/kio_filenamesearch.cpp
+index 4d15aac2..5651a025 100644
+--- a/filenamesearch/kio_filenamesearch.cpp
++++ b/filenamesearch/kio_filenamesearch.cpp
+@@ -102,6 +102,7 @@ void FileNameSearchProtocol::searchDirectory(const QUrl 
&directory,
+     QScopedPointer<KCoreDirLister> dirLister(new KCoreDirLister);
+     dirLister->setDelayedMimeTypes(true);
+     dirLister->openUrl(directory);
++    dirLister->setAutoErrorHandlingEnabled(false);
+ 
+     QEventLoop eventLoop;
+     QObject::connect(dirLister.data(), 
static_cast<void(KCoreDirLister::*)()>(&KCoreDirLister::canceled),
+-- 
+GitLab
+

diff --git a/kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild 
b/kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild
index 8814d0c4cb6..b23dee6554d 100644
--- a/kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild
+++ b/kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild
@@ -72,6 +72,7 @@ BDEPEND="man? ( dev-util/gperf )"
 
 PATCHES=(
        "${FILESDIR}"/${P}-libmtp-0.1.19.patch
+       "${FILESDIR}"/${P}-kio_filenamesearch-crash.patch # bug 817008
 )
 
 src_prepare() {

diff --git a/kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild 
b/kde-apps/kio-extras/kio-extras-21.08.2-r1.ebuild
similarity index 93%
copy from kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild
copy to kde-apps/kio-extras/kio-extras-21.08.2-r1.ebuild
index 8814d0c4cb6..79248e2a040 100644
--- a/kde-apps/kio-extras/kio-extras-21.04.3-r3.ebuild
+++ b/kde-apps/kio-extras/kio-extras-21.08.2-r1.ebuild
@@ -1,11 +1,11 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 ECM_HANDBOOK="forceoptional"
 ECM_TEST="optional"
-KFMIN=5.80.0
+KFMIN=5.84.0
 QTMIN=5.15.2
 VIRTUALX_REQUIRED="test"
 inherit ecm kde.org
@@ -19,7 +19,7 @@ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
 IUSE="activities +man mtp nfs openexr phonon samba +sftp taglib X"
 
 # requires running Plasma environment
-RESTRICT+=" test"
+RESTRICT="test"
 
 DEPEND="
        >=dev-qt/qtdbus-${QTMIN}:5
@@ -71,21 +71,16 @@ RDEPEND="${DEPEND}
 BDEPEND="man? ( dev-util/gperf )"
 
 PATCHES=(
-       "${FILESDIR}"/${P}-libmtp-0.1.19.patch
+       "${FILESDIR}"/${PN}-21.04.3-kio_filenamesearch-crash.patch # bug 817008
 )
 
-src_prepare() {
-       ecm_src_prepare
-       cmake_comment_add_subdirectory network
-}
-
 src_configure() {
        local mycmakeargs=(
                $(cmake_use_find_package activities KF5Activities)
                $(cmake_use_find_package activities KF5ActivitiesStats)
                $(cmake_use_find_package activities Qt5Sql)
                $(cmake_use_find_package man Gperf)
-               $(cmake_use_find_package mtp Mtp)
+               $(cmake_use_find_package mtp Libmtp)
                $(cmake_use_find_package nfs TIRPC)
                $(cmake_use_find_package openexr OpenEXR)
                $(cmake_use_find_package phonon Phonon4Qt5)

Reply via email to