From 5dff395ecea2977cf149c293c16c4d4a5151493b Mon Sep 17 00:00:00 2001 From: Ahmad Samir 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 dirLister(new KCoreDirLister); dirLister->setDelayedMimeTypes(true); dirLister->openUrl(directory); + dirLister->setAutoErrorHandlingEnabled(false); QEventLoop eventLoop; QObject::connect(dirLister.data(), static_cast(&KCoreDirLister::canceled), -- GitLab