diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-09-02 16:43:49 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-04 11:47:27 +0200 |
commit | 08d0cb6f8e90a818bf6d3bec7a6d00f16419b8c0 (patch) | |
tree | 4d477a86615511168f8546190543d528c4e38ca8 | |
parent | 6c80018430ffb1c3e72c70f406544a812c22309a (diff) |
print project errors after all. sometimes.
we evaluate prf files precisely, so we need to see their errors, as they
may give a hint why they terminated prematurely.
however, we prefix the errors with "WARNING:" to make them less scary.
Change-Id: Ia14953a5a9dc31af56ad6c338017dd5b85bb4494
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r-- | src/linguist/lrelease/main.cpp | 8 | ||||
-rw-r--r-- | src/linguist/lupdate/main.cpp | 8 | ||||
-rw-r--r-- | src/linguist/shared/qmakebuiltins.cpp | 8 | ||||
-rw-r--r-- | src/linguist/shared/qmakeevaluator.h | 4 | ||||
-rw-r--r-- | src/linguist/shared/qmakeparser.h | 5 |
5 files changed, 26 insertions, 7 deletions
diff --git a/src/linguist/lrelease/main.cpp b/src/linguist/lrelease/main.cpp index 3239d4725..26d9c89ee 100644 --- a/src/linguist/lrelease/main.cpp +++ b/src/linguist/lrelease/main.cpp @@ -209,7 +209,13 @@ public: print(fileName, lineNo, msg); } - virtual void fileMessage(const QString &) {} + virtual void fileMessage(int type, const QString &msg) + { + if (verbose && !(type & CumulativeEvalMessage) && (type & CategoryMask) == ErrorMessage) { + // "Downgrade" errors, as we don't really care for them + printErr(QLatin1String("WARNING: ") + msg + QLatin1Char('\n')); + } + } virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {} virtual void doneWithEval(ProFile *) {} diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index 74eab780a..001841b1d 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -252,7 +252,13 @@ public: print(fileName, lineNo, msg); } - virtual void fileMessage(const QString &) {} + virtual void fileMessage(int type, const QString &msg) + { + if (verbose && !(type & CumulativeEvalMessage) && (type & CategoryMask) == ErrorMessage) { + // "Downgrade" errors, as we don't really care for them + printErr(QLatin1String("WARNING: ") + msg + QLatin1Char('\n')); + } + } virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {} virtual void doneWithEval(ProFile *) {} diff --git a/src/linguist/shared/qmakebuiltins.cpp b/src/linguist/shared/qmakebuiltins.cpp index 4712df52d..8750b76a9 100644 --- a/src/linguist/shared/qmakebuiltins.cpp +++ b/src/linguist/shared/qmakebuiltins.cpp @@ -1360,8 +1360,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( fputs(msg.toLatin1().constData(), stderr); #endif } else { - m_handler->fileMessage(fL1S("Project %1: %2") - .arg(function.toQString(m_tmp1).toUpper(), msg)); + m_handler->fileMessage( + (func_t == T_ERROR ? QMakeHandler::ErrorMessage : + func_t == T_WARNING ? QMakeHandler::WarningMessage : + QMakeHandler::InfoMessage) + | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0), + fL1S("Project %1: %2").arg(function.toQString(m_tmp1).toUpper(), msg)); } } return (func_t == T_ERROR && !m_cumulative) ? ReturnError : ReturnTrue; diff --git a/src/linguist/shared/qmakeevaluator.h b/src/linguist/shared/qmakeevaluator.h index 13198c389..8a107223a 100644 --- a/src/linguist/shared/qmakeevaluator.h +++ b/src/linguist/shared/qmakeevaluator.h @@ -73,6 +73,8 @@ public: enum { SourceEvaluator = 0x10, + CumulativeEvalMessage = 0x1000, + EvalWarnLanguage = SourceEvaluator | WarningMessage | WarnLanguage, EvalWarnDeprecated = SourceEvaluator | WarningMessage | WarnDeprecated, @@ -80,7 +82,7 @@ public: }; // error(), warning() and message() from .pro file - virtual void fileMessage(const QString &msg) = 0; + virtual void fileMessage(int type, const QString &msg) = 0; enum EvalFileType { EvalProjectFile, EvalIncludeFile, EvalConfigFile, EvalFeatureFile, EvalAuxFile }; virtual void aboutToEval(ProFile *parent, ProFile *proFile, EvalFileType type) = 0; diff --git a/src/linguist/shared/qmakeparser.h b/src/linguist/shared/qmakeparser.h index dd55659d8..15897cffe 100644 --- a/src/linguist/shared/qmakeparser.h +++ b/src/linguist/shared/qmakeparser.h @@ -58,8 +58,9 @@ class QMAKE_EXPORT QMakeParserHandler public: enum { CategoryMask = 0xf00, - WarningMessage = 0x000, - ErrorMessage = 0x100, + InfoMessage = 0x100, + WarningMessage = 0x200, + ErrorMessage = 0x300, SourceMask = 0xf0, SourceParser = 0, |