Commit fb9146a9 authored by Bradley T. Hughes's avatar Bradley T. Hughes
Browse files

Compile after qt5/qtbase commit 75a0c7f9



Commit 75a0c7f9b52cde47f20fdc1b89e1264d60350848 in qt5/qtbase changed
some QRegExp methods to be non-const (they were previously const). This
change makes Qt Creator compile again.

Change-Id: Ibc98c678126c3b3189df7fcc043463b940951445
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: default avatarThiago Macieira <thiago.macieira@intel.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent d681bc10
......@@ -550,7 +550,7 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn)
simplifyStdString(QLatin1String("unsigned short"), QLatin1String("wstring"), &type);
}
// std::vector, std::deque, std::list
const QRegExp re1(QString::fromLatin1("(vector|list|deque)<%1, ?%2\\s*>").arg(inner, alloc));
QRegExp re1(QString::fromLatin1("(vector|list|deque)<%1, ?%2\\s*>").arg(inner, alloc));
Q_ASSERT(re1.isValid());
if (re1.indexIn(type) != -1)
type.replace(re1.cap(0), QString::fromLatin1("%1<%2>").arg(re1.cap(1), inner));
......
......@@ -1186,7 +1186,7 @@ void Check::addMessage(Type type, const SourceLocation &location, const QString
void Check::scanCommentsForAnnotations()
{
m_disabledMessageTypesByLine.clear();
const QRegExp disableCommentPattern(Message::suppressionPattern());
QRegExp disableCommentPattern(Message::suppressionPattern());
foreach (const SourceLocation &commentLoc, _doc->engine()->comments()) {
const QString &comment = _doc->source().mid(commentLoc.begin(), commentLoc.length);
......
......@@ -50,17 +50,16 @@ namespace Utils {
// Naming a file like a device name will break on Windows, even if it is
// "com1.txt". Since we are cross-platform, we generally disallow such file
// names.
static const QRegExp &windowsDeviceNoSubDirPattern()
static QRegExp &windowsDeviceNoSubDirPattern()
{
static const QRegExp rc(QLatin1String(WINDOWS_DEVICES),
Qt::CaseInsensitive);
static QRegExp rc(QLatin1String(WINDOWS_DEVICES), Qt::CaseInsensitive);
QTC_ASSERT(rc.isValid(), return rc);
return rc;
}
static const QRegExp &windowsDeviceSubDirPattern()
static QRegExp &windowsDeviceSubDirPattern()
{
static const QRegExp rc(QLatin1String(".*[/\\\\](" WINDOWS_DEVICES ")"), Qt::CaseInsensitive);
static QRegExp rc(QLatin1String(".*[/\\\\](" WINDOWS_DEVICES ")"), Qt::CaseInsensitive);
QTC_ASSERT(rc.isValid(), return rc);
return rc;
}
......
......@@ -223,7 +223,7 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResultList> &future,
if (flags & QTextDocument::FindWholeWords)
searchTerm = QString::fromLatin1("\\b%1\\b").arg(searchTerm);
const Qt::CaseSensitivity caseSensitivity = (flags & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive;
const QRegExp expression(searchTerm, caseSensitivity);
QRegExp expression(searchTerm, caseSensitivity);
QFile file;
QString str;
......
......@@ -65,7 +65,7 @@ namespace {
QString cleanPackageName(QString packageName)
{
const QRegExp legalChars(QLatin1String("[a-zA-Z0-9_\\.]"));
QRegExp legalChars(QLatin1String("[a-zA-Z0-9_\\.]"));
for (int i = 0; i < packageName.length(); ++i)
if (!legalChars.exactMatch(packageName.mid(i, 1)))
......
......@@ -47,7 +47,7 @@ public:
private:
virtual QString changeNumber(const QString &block) const;
QRegExp m_changeset;
mutable QRegExp m_changeset;
};
} // namespace Internal
......
......@@ -79,8 +79,8 @@ BranchInfo BazaarClient::synchronousBranchQuery(const QString &repositoryRoot) c
QTextStream ts(&branchConfFile);
QString branchLocation;
QString isBranchBound;
const QRegExp branchLocationRx(QLatin1String("bound_location\\s*=\\s*(.+)$"));
const QRegExp isBranchBoundRx(QLatin1String("bound\\s*=\\s*(.+)$"));
QRegExp branchLocationRx(QLatin1String("bound_location\\s*=\\s*(.+)$"));
QRegExp isBranchBoundRx(QLatin1String("bound\\s*=\\s*(.+)$"));
while (!ts.atEnd() && (branchLocation.isEmpty() || isBranchBound.isEmpty())) {
const QString line = ts.readLine();
if (branchLocationRx.indexIn(line) != -1)
......
......@@ -70,7 +70,7 @@ public:
private:
enum State { Header, Comment, Other };
const QTextCharFormat m_commentFormat;
const QRegExp m_keywordPattern;
QRegExp m_keywordPattern;
const QChar m_hashChar;
};
......
......@@ -54,9 +54,9 @@ private:
virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileSpec) const;
const QRegExp m_changesetId;
const QRegExp m_exactChangesetId;
const QRegExp m_diffFileId;
mutable QRegExp m_changesetId;
mutable QRegExp m_exactChangesetId;
mutable QRegExp m_diffFileId;
};
} // namespace Internal
......
......@@ -548,7 +548,7 @@ public:
void assignSuffixes(const QStringList &patterns);
void debug(QTextStream &str, int indent = 0) const;
const QRegExp suffixPattern;
QRegExp suffixPattern;
QString type;
QString comment;
......@@ -814,7 +814,8 @@ unsigned MimeType::matchesFileBySuffix(Internal::FileMatchContext &c) const
{
// check globs
foreach (const MimeGlobPattern &gp, m_d->globPatterns) {
if (gp.regExp().exactMatch(c.fileName()))
QRegExp regExp = gp.regExp();
if (regExp.exactMatch(c.fileName()))
return gp.weight();
}
return 0;
......
......@@ -234,7 +234,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
headerStr << headerLicense << "#ifndef " << guard
<< "\n#define " << guard << '\n';
const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+"));
QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+"));
QTC_CHECK(qtClassExpr.isValid());
// Determine parent QObject type for Qt types. Provide base
// class in case the user did not specify one.
......
......@@ -68,7 +68,7 @@ QList<Locator::FilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInterfac
QList<Locator::FilterEntry> betterEntries;
QStringMatcher matcher(entry, Qt::CaseInsensitive);
const QChar asterisk = QLatin1Char('*');
const QRegExp regexp(asterisk + entry + asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
QRegExp regexp(asterisk + entry + asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid())
return goodEntries;
bool hasWildcard = (entry.contains(asterisk) || entry.contains('?'));
......
......@@ -86,7 +86,7 @@ QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(QFutureInterface<Locato
QList<Locator::FilterEntry> betterEntries;
const QChar asterisk = QLatin1Char('*');
QStringMatcher matcher(entry, Qt::CaseInsensitive);
const QRegExp regexp(asterisk + entry+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
QRegExp regexp(asterisk + entry+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid())
return goodEntries;
bool hasWildcard = (entry.contains(asterisk) || entry.contains('?'));
......
......@@ -56,8 +56,8 @@ private:
QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const;
QStringList annotationPreviousVersions(const QString &revision) const;
const QRegExp m_revisionAnnotationPattern;
const QRegExp m_revisionLogPattern;
mutable QRegExp m_revisionAnnotationPattern;
mutable QRegExp m_revisionLogPattern;
QString m_diffBaseDir;
};
......
......@@ -88,8 +88,8 @@ QList<CvsLogEntry> parseLogEntries(const QString &o,
const QString revisionPrefix = QLatin1String("revision ");
const QString statusPrefix = QLatin1String("date: ");
const QString commitId = QLatin1String("commitid: ");
const QRegExp statusPattern = QRegExp(QLatin1String("^date: ([\\d\\-]+) .*commitid: ([^;]+);$"));
const QRegExp revisionPattern = QRegExp(QLatin1String("^revision ([\\d\\.]+)$"));
QRegExp statusPattern = QRegExp(QLatin1String("^date: ([\\d\\-]+) .*commitid: ([^;]+);$"));
QRegExp revisionPattern = QRegExp(QLatin1String("^revision ([\\d\\.]+)$"));
const QChar slash = QLatin1Char('/');
Q_ASSERT(statusPattern.isValid() && revisionPattern.isValid());
const QString fileSeparator = QLatin1String("=============================================================================");
......
......@@ -1572,7 +1572,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
const Iterator end = exCommandMap().constEnd();
for (Iterator it = exCommandMap().constBegin(); it != end; ++it) {
const QString &id = it.key();
const QRegExp &re = it.value();
QRegExp re = it.value();
if (!re.pattern().isEmpty() && re.indexIn(cmd.cmd) != -1) {
triggerAction(Core::Id(id));
return;
......
......@@ -307,7 +307,7 @@ void GenericProject::refresh(RefreshOptions options)
*/
static void expandEnvironmentVariables(const QProcessEnvironment &env, QString &string)
{
const static QRegExp candidate(QLatin1String("\\$\\$\\((.+)\\)"));
static QRegExp candidate(QLatin1String("\\$\\$\\((.+)\\)"));
int index = candidate.indexIn(string);
while (index != -1) {
......
......@@ -64,7 +64,7 @@ struct Glob
enum Mode { EXACT, ENDSWITH, REGEXP };
Mode mode;
QString matchString;
QRegExp matchRegexp;
mutable QRegExp matchRegexp;
};
class SelectableFilesModel : public QAbstractItemModel
......
......@@ -2356,7 +2356,7 @@ unsigned GitClient::synchronousGitVersion(bool silent, QString *errorMessage) co
}
// cut 'git version 1.6.5.1.sha'
const QString output = commandOutputFromLocal8Bit(outputText);
const QRegExp versionPattern(QLatin1String("^[^\\d]+([\\d])\\.([\\d])\\.([\\d]).*$"));
QRegExp versionPattern(QLatin1String("^[^\\d]+([\\d])\\.([\\d])\\.([\\d]).*$"));
QTC_ASSERT(versionPattern.isValid(), return 0);
QTC_ASSERT(versionPattern.exactMatch(output), return 0);
const unsigned major = versionPattern.cap(1).toUInt();
......
......@@ -65,8 +65,8 @@ private:
virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const;
virtual QStringList annotationPreviousVersions(const QString &revision) const;
const QRegExp m_changeNumberPattern8;
const QRegExp m_changeNumberPattern40;
mutable QRegExp m_changeNumberPattern8;
mutable QRegExp m_changeNumberPattern40;
};
} // namespace Git
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment