Don't use the QRegExp methods that modify the object [qmake]

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: I6b2d2530238a7e04b44859664a2962f2f466ee30
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Thiago Macieira 2012-04-20 14:59:30 +02:00 committed by Qt by Nokia
parent 3da8a33a62
commit fd63acdc83

View File

@ -2085,7 +2085,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
dirs.append("");
}
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];
if (!dir.isEmpty() && !dir.endsWith(QLatin1Char('/')))