diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-03-11 14:01:35 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-03-16 11:13:32 +0000 |
commit | a102c11d003928dcad2f9ce41c1f507320bc1d1a (patch) | |
tree | ad9d751cb65965af3c1b95e5c9987cc775176b19 /src/shared | |
parent | 9295bfe3e47a83aa32b7d18f4f0082714528ab27 (diff) | |
download | qt-creator-a102c11d003928dcad2f9ce41c1f507320bc1d1a.tar.gz |
Qmake: Add some debug output for file add/remove operations
This will help collecting feedback from users affected by bugs.
Task-number: QTCREATORBUG-22508
Change-Id: Idfc22245587dd2d71b229b4ab6c7562fb7a5ecfc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/proparser/prowriter.cpp | 13 |
1 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); } } |