forked from qt-creator/qt-creator
ProWriter: constify local vars
Change-Id: I4742edd3f449020c9f9be30401a9ae92f2bb81b3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
e50cab50b9
commit
77392c7dea
@@ -179,7 +179,7 @@ QString ProWriter::compileScope(const QString &scope)
|
|||||||
ProFile *includeFile = parser.parsedProBlock(QStringRef(&scope), 0, QLatin1String("no-file"), 1);
|
ProFile *includeFile = parser.parsedProBlock(QStringRef(&scope), 0, QLatin1String("no-file"), 1);
|
||||||
if (!includeFile)
|
if (!includeFile)
|
||||||
return QString();
|
return QString();
|
||||||
QString result = includeFile->items();
|
const QString result = includeFile->items();
|
||||||
includeFile->deref();
|
includeFile->deref();
|
||||||
return result.mid(2); // chop of TokLine + linenumber
|
return result.mid(2); // chop of TokLine + linenumber
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString
|
|||||||
const QString &var, PutFlags flags, const QString &scope,
|
const QString &var, PutFlags flags, const QString &scope,
|
||||||
const QString &continuationIndent)
|
const QString &continuationIndent)
|
||||||
{
|
{
|
||||||
QString indent = scope.isEmpty() ? QString() : continuationIndent;
|
const QString indent = scope.isEmpty() ? QString() : continuationIndent;
|
||||||
const auto effectiveContIndent = [indent, continuationIndent](const ContinuationInfo &ci) {
|
const auto effectiveContIndent = [indent, continuationIndent](const ContinuationInfo &ci) {
|
||||||
return !ci.indent.isEmpty() ? ci.indent : continuationIndent + indent;
|
return !ci.indent.isEmpty() ? ci.indent : continuationIndent + indent;
|
||||||
};
|
};
|
||||||
@@ -576,8 +576,8 @@ QStringList ProWriter::removeFiles(ProFile *profile, QStringList *lines,
|
|||||||
// maybe those files can be found via $$PWD/relativeToPriFile
|
// maybe those files can be found via $$PWD/relativeToPriFile
|
||||||
|
|
||||||
valuesToFind.clear();
|
valuesToFind.clear();
|
||||||
QDir baseDir = QFileInfo(profile->fileName()).absoluteDir();
|
const QDir baseDir = QFileInfo(profile->fileName()).absoluteDir();
|
||||||
QString prefixPwd = QLatin1String("$$PWD/");
|
const QString prefixPwd = QLatin1String("$$PWD/");
|
||||||
foreach (const QString &absoluteFilePath, notYetChanged)
|
foreach (const QString &absoluteFilePath, notYetChanged)
|
||||||
valuesToFind << (prefixPwd + baseDir.relativeFilePath(absoluteFilePath));
|
valuesToFind << (prefixPwd + baseDir.relativeFilePath(absoluteFilePath));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user