Fix crash with newer Qt versions
authorAlbert Astals Cid <aacid@kde.org>
Thu, 8 Apr 2021 20:07:15 +0000 (22:07 +0200)
committerAdrian Bunk <bunk@debian.org>
Tue, 7 Feb 2023 16:22:51 +0000 (16:22 +0000)
Assign m_internalModel before calling into
QSortFilterProxyModel::setSourceModel since that can end up calling filterAcceptsRow

Gbp-Pq: Name 0001-Fix-crash-with-newer-Qt-versions.patch

src/gui/file/sortfilterfilemodel.cpp

index cbc385b6ec9a99f1fd4e082d33341daf4118e2e2..2cb2d0d393bfc22cc201075d1d5190575227aba2 100644 (file)
@@ -36,8 +36,8 @@ SortFilterFileModel::SortFilterFileModel(QObject *parent)
 
 void SortFilterFileModel::setSourceModel(QAbstractItemModel *model)
 {
-    QSortFilterProxyModel::setSourceModel(model);
     m_internalModel = dynamic_cast<FileModel *>(model);
+    QSortFilterProxyModel::setSourceModel(model);
 }
 
 FileModel *SortFilterFileModel::fileSourceModel() const