aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-09-19 07:26:44 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-09-19 10:48:11 +0000
commit9274ed77bc273330a3f202a00239dcc1b6ef8cc3 (patch)
treee0ea24fa1a3d334eaaca24077bdb6b9dd8117e4a
parent9d89f9019ecd17d21fa491b55726d60985756a29 (diff)
Check if the filters are different before triggering an update
If the filters list is the same as before, then there is no reason to trigger an update on the thread as the result would be the same as before. This solves a problem that was occurring with iOS 13 as it would get stuck due to repeated calls to setNameFilters() with the same filter list. Fixes: QTBUG-78468 Change-Id: I705cfaaa0a1a19b1d0397140a5831fc67557a4ee Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 2040fb5f0c..51931097f3 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -539,6 +539,8 @@ QStringList QQuickFolderListModel::nameFilters() const
void QQuickFolderListModel::setNameFilters(const QStringList &filters)
{
Q_D(QQuickFolderListModel);
+ if (d->nameFilters == filters)
+ return;
d->fileInfoThread.setNameFilters(filters);
d->nameFilters = filters;
}