summaryrefslogtreecommitdiff
path: root/src/linguist/shared/profileevaluator.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-04-23 17:47:03 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-25 18:09:46 +0200
commite68cbe6a7d61611dc048edd82cfba716b443a474 (patch)
treed193b351f51d68395ac718dc4eb640997a4f997b /src/linguist/shared/profileevaluator.cpp
parent8f66084ab51bfbbef64d0cf2f615808099c78811 (diff)
downloadqttools-e68cbe6a7d61611dc048edd82cfba716b443a474.tar.gz
Don't use the QRegExp methods that modify the object [Linguist]
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: I181d37fd98b00550dd98d418a33183a4bde0c532 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/linguist/shared/profileevaluator.cpp')
-rw-r--r--src/linguist/shared/profileevaluator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linguist/shared/profileevaluator.cpp b/src/linguist/shared/profileevaluator.cpp
index 6abb4d3a0..75c7aefda 100644
--- a/src/linguist/shared/profileevaluator.cpp
+++ b/src/linguist/shared/profileevaluator.cpp
@@ -2544,7 +2544,7 @@ ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
}
r.detach(); // Keep m_tmp out of QRegExp's cache
- const QRegExp regex(r, Qt::CaseSensitive, QRegExp::Wildcard);
+ QRegExp regex(r, Qt::CaseSensitive, QRegExp::Wildcard);
for (int d = 0; d < dirs.count(); d++) {
QString dir = dirs[d];
QDir qdir(pfx + dir);
@@ -2566,7 +2566,7 @@ ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
if(args.count() != 3 ) {
evalError(fL1S("replace(var, before, after) requires three arguments"));
} else {
- const QRegExp before(args.at(1).toQString());
+ QRegExp before(args.at(1).toQString());
const QString &after(args.at(2).toQString(m_tmp2));
foreach (const ProString &val, values(map(args.at(0)))) {
QString rstr = val.toQString(m_tmp1);