qt6-bb10/src/gui/itemmodels
Giuseppe D'Angelo 07057188e3 QFileSystemModel: cache the name filters regexps
In order to filter out file names based on the user's settings,
QFileSystemModel used to have a loop that tested if a given file
name matched one of the filters. The problem is that each filter
(a wildcard) was converted to a QRegularExpression _inside_ the loop.
This causes a quadratic behavior (number of files * number of filters).

Instead, build the regexps once when the filters are set (or the case
sensitivity is changed, as that affects the filtering), and simply
_use_ them in the loop.

Simplify and correct some related code as a drive by.

Done-with: Jean-Michaël Celerier
Fixes: QTBUG-95383
Pick-to: 6.2 6.1 5.15
Change-Id: I6bc336364c145bb05793a8f867545d7715d35832
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-04 14:03:21 +02:00
..
qfileinfogatherer.cpp QDirIterator: add nextFileInfo() 2021-07-28 15:16:42 +02:00
qfileinfogatherer_p.h Move QFileSystemModel into QtGui 2020-08-25 06:33:44 +02:00
qfilesystemmodel.cpp QFileSystemModel: cache the name filters regexps 2021-08-04 14:03:21 +02:00
qfilesystemmodel.h Move QFileSystemModel into QtGui 2020-08-25 06:33:44 +02:00
qfilesystemmodel_p.h QFileSystemModel: cache the name filters regexps 2021-08-04 14:03:21 +02:00
qstandarditemmodel.cpp Fix QStandardItemModel signals on takeChild 2021-05-11 18:55:09 +01:00
qstandarditemmodel.h Port QStandardItemModel to the new property system 2021-01-26 21:48:00 +01:00
qstandarditemmodel_p.h Port QStandardItemModel to the new property system 2021-01-26 21:48:00 +01:00