Don't use the QRegExp methods that modify the object [QtWidgets]
QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: I44cc44b75b3da10c5ece97cb6315c2c425327dc0 Reviewed-by: Alexis Menard <alexis.menard@openbossa.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
066da57a12
commit
6624151c6a
@ -2017,7 +2017,8 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
|
||||
// Check the name regularexpression filters
|
||||
if (!(node->isDir() && (filters & QDir::AllDirs))) {
|
||||
for (int i = 0; i < nameFilters.size(); ++i) {
|
||||
if (nameFilters.at(i).exactMatch(node->fileName))
|
||||
QRegExp copy = nameFilters.at(i);
|
||||
if (copy.exactMatch(node->fileName))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user