diff --git a/desktop/kde/applications/dolphin/files/kdebug-419585.patch b/desktop/kde/applications/dolphin/files/kdebug-419585.patch new file mode 100644 index 0000000000..b88d1586d6 --- /dev/null +++ b/desktop/kde/applications/dolphin/files/kdebug-419585.patch @@ -0,0 +1,47 @@ +From 35b4c6d4df1281afd621374e686f19e654ad7bae Mon Sep 17 00:00:00 2001 +From: "Martin T. H. Sandsmark" +Date: Tue, 7 Apr 2020 17:14:59 +0200 +Subject: Fix crashing on starting and quitting + +QCollator (especially with Qt 5.14 and ICU 65.1) is very unhappy with +threads. + +To avoid having to lock and unlock the mutex everywhere (and ensure it +is unlocked before calling other things that might lock it, etc.), we do +it as locally as possible. Even if for some reason Qt and ICU make +QCollator threadsafe in the future locking here should have minimal +impact. + +BUG: 419585 + +Differential Revision: https://phabricator.kde.org/D28659 +--- + src/kitemviews/kfileitemmodel.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp +index 4b35a02..e4dca27 100644 +--- a/src/kitemviews/kfileitemmodel.cpp ++++ b/src/kitemviews/kfileitemmodel.cpp +@@ -33,6 +33,9 @@ + #include + #include + #include ++#include ++ ++Q_GLOBAL_STATIC_WITH_ARGS(QMutex, s_collatorMutex, (QMutex::Recursive)) + + // #define KFILEITEMMODEL_DEBUG + +@@ -1878,6 +1881,8 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const + + int KFileItemModel::stringCompare(const QString& a, const QString& b, const QCollator& collator) const + { ++ QMutexLocker collatorLock(s_collatorMutex()); ++ + if (m_naturalSorting) { + return collator.compare(a, b); + } +-- +cgit v1.1 + diff --git a/desktop/kde/applications/dolphin/pspec.xml b/desktop/kde/applications/dolphin/pspec.xml index 82f7ad3e2d..081e6b3ee5 100755 --- a/desktop/kde/applications/dolphin/pspec.xml +++ b/desktop/kde/applications/dolphin/pspec.xml @@ -44,6 +44,7 @@ dolphin-17.04.0-allow-root.patch + kdebug-419585.patch