diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-03-19 09:35:50 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-03-19 09:35:50 +0100 |
commit | c8a2ea54333b4d0582afb62b4120558f8c6945e7 (patch) | |
tree | 156b198998adf6b034944ec58bc74cca41830b6d /src/shared | |
parent | 070aca8fea5fec0c31542c1b70e60bd9c493300a (diff) | |
parent | ff6dd4dc2e95ce39fd423ca520c72fe50dc64aa1 (diff) |
Merge remote-tracking branch 'origin/4.12'
Conflicts:
src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/proparser/prowriter.cpp | 13 | ||||
m--------- | src/shared/qbs | 0 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/proparser/prowriter.cpp b/src/shared/proparser/prowriter.cpp index 6d79524912..52d49751f2 100644 --- a/src/shared/proparser/prowriter.cpp +++ b/src/shared/proparser/prowriter.cpp @@ -30,9 +30,12 @@ #include <utils/algorithm.h> #include <QDir> +#include <QLoggingCategory> #include <QPair> #include <QRegularExpression> +Q_LOGGING_CATEGORY(prowriterLog, "qtc.prowriter", QtWarningMsg) + using namespace QmakeProjectManager::Internal; static uint getBlockLen(const ushort *&tokPtr) @@ -309,6 +312,9 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString const QString &var, PutFlags flags, const QString &scope, const QString &continuationIndent) { + qCDebug(prowriterLog) << Q_FUNC_INFO << "lines:" << *lines << "values:" << values + << "var:" << var << "flags:" << int(flags) << "scope:" << scope + << "indent:" << continuationIndent; const QString indent = scope.isEmpty() ? QString() : continuationIndent; const auto effectiveContIndent = [indent, continuationIndent](const ContinuationInfo &ci) { return !ci.indent.isEmpty() ? ci.indent : continuationIndent + indent; @@ -325,10 +331,12 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString if (eqs >= 0) // If this is not true, we mess up the file a bit. line.truncate(eqs + 1); // put new values + qCDebug(prowriterLog) << 1 << "old line value:" << line; for (const QString &v : values) { line += ((flags & MultiLine) ? QString(" \\\n") + effectiveContIndent(contInfo) : QString(" ")) + v; } + qCDebug(prowriterLog) << "new line value:" << line; } else { const ContinuationInfo contInfo = skipContLines(lines, lineNo, false); int endLineNo = contInfo.lineNo; @@ -343,6 +351,8 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString } else { newLine += " \\"; } + qCDebug(prowriterLog) << 2 << "adding new line" << newLine + << "at line " << curLineNo; lines->insert(curLineNo, newLine); ++endLineNo; } @@ -360,8 +370,10 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString const QRegularExpression rx("\\A(\\s*" + scope + "\\s*:\\s*)[^\\s{].*\\z"); const QRegularExpressionMatch match(rx.match(lines->at(scopeStart))); if (match.hasMatch()) { + qCDebug(prowriterLog) << 3 << "old line value:" << (*lines)[scopeStart]; (*lines)[scopeStart].replace(0, match.captured(1).length(), scope + " {\n" + continuationIndent); + qCDebug(prowriterLog) << "new line value:" << (*lines)[scopeStart]; contInfo = skipContLines(lines, scopeStart, false); lNo = contInfo.lineNo; scopeStart = -1; @@ -395,6 +407,7 @@ void ProWriter::putVarValues(ProFile *profile, QStringList *lines, const QString } if (!scope.isEmpty() && scopeStart < 0) added += "\n}"; + qCDebug(prowriterLog) << 4 << "adding" << added << "at line" << lNo; lines->insert(lNo, added); } } diff --git a/src/shared/qbs b/src/shared/qbs -Subproject 40ae3324be2790e8fa0c19fe21c6551084970dc +Subproject dcd57b60f8a79a2ee9c46cb5fddf60846302d37 |