summaryrefslogtreecommitdiff
path: root/kde-apps/kio-extras/files/kio-extras-21.04.3-kio_filenamesearch-crash.patch
blob: dff398e68a25ee1ba6eeb104267d23b70ad4a1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 5dff395ecea2977cf149c293c16c4d4a5151493b Mon Sep 17 00:00:00 2001
From: Ahmad Samir <a.samirh78@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