diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-23 16:47:50 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-25 21:05:49 +0200 |
commit | 11d0f7827fa8b20c7a084a184e70b90e1e0aeaea (patch) | |
tree | 2c2cbb047c7a50daf9eb2cd97e5c9ec6fc6248e2 /src/quick/items/qquickdroparea.cpp | |
parent | 87327515d70f5b66ce5f3f894f9b90ed649b200d (diff) |
Don't use the QRegExp methods that modify the object
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: I252d1c47d7039caacec6aac5b572371d5b7efe32
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/quick/items/qquickdroparea.cpp')
-rw-r--r-- | src/quick/items/qquickdroparea.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp index 51ba4c56ec..053a133609 100644 --- a/src/quick/items/qquickdroparea.cpp +++ b/src/quick/items/qquickdroparea.cpp @@ -230,8 +230,9 @@ bool QQuickDropAreaPrivate::hasMatchingKey(const QStringList &keys) const if (keyRegExp.isEmpty()) return true; + QRegExp copy = keyRegExp; foreach (const QString &key, keys) { - if (keyRegExp.exactMatch(key)) + if (copy.exactMatch(key)) return true; } return false; |