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> |
||
|---|---|---|
| .. | ||
| qfileinfogatherer.cpp | ||
| qfileinfogatherer_p.h | ||
| qfilesystemmodel.cpp | ||
| qfilesystemmodel.h | ||
| qfilesystemmodel_p.h | ||
| qstandarditemmodel.cpp | ||
| qstandarditemmodel.h | ||
| qstandarditemmodel_p.h | ||