diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-07-27 16:03:23 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-04 12:03:30 +0000 |
commit | bc904c8524d9d230de3b634024548d3abdbca843 (patch) | |
tree | cef0342a1bd2a4ca7192c5ee54b4592dc9833be6 /src/corelib | |
parent | 216488231e6739e9a04bd2ef0138d246f25d8a8d (diff) |
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
Change-Id: I6bc336364c145bb05793a8f867545d7715d35832
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 07057188e3e42246cf006b43963d0bdcdaa159f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib')
0 files changed, 0 insertions, 0 deletions