From e5f3b653f0f5c7214041654e2132ac0781258499 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 2 Sep 2013 16:43:49 +0200 Subject: add enablers for printing project errors in cumulative mode this doesn't actually do anything in qmake. Change-Id: Ia14953a5a9dc31af56ad6c338017dd5b85bb4494 Reviewed-by: hjk Reviewed-by: Oswald Buddenhagen (cherry picked from qttools/08d0cb6f8e90a818bf6d3bec7a6d00f16419b8c0) Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 8 ++++++-- qmake/library/qmakeevaluator.h | 4 +++- qmake/library/qmakeparser.h | 5 +++-- qmake/option.cpp | 3 ++- qmake/option.h | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index e8be2f42fd..02cd8a2760 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1470,8 +1470,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/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index 0a653ad664..9560f71587 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -68,6 +68,8 @@ public: enum { SourceEvaluator = 0x10, + CumulativeEvalMessage = 0x1000, + EvalWarnLanguage = SourceEvaluator | WarningMessage | WarnLanguage, EvalWarnDeprecated = SourceEvaluator | WarningMessage | WarnDeprecated, @@ -75,7 +77,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/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h index dfea1ddfdf..7fa4f62a96 100644 --- a/qmake/library/qmakeparser.h +++ b/qmake/library/qmakeparser.h @@ -50,8 +50,9 @@ class QMAKE_EXPORT QMakeParserHandler public: enum { CategoryMask = 0xf00, - WarningMessage = 0x000, - ErrorMessage = 0x100, + InfoMessage = 0x100, + WarningMessage = 0x200, + ErrorMessage = 0x300, SourceMask = 0xf0, SourceParser = 0, diff --git a/qmake/option.cpp b/qmake/option.cpp index da59616e5c..46bfa33dd3 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -601,8 +601,9 @@ void EvalHandler::message(int type, const QString &msg, const QString &fileName, fprintf(stderr, "%s%s\n", qPrintable(pfx), qPrintable(msg)); } -void EvalHandler::fileMessage(const QString &msg) +void EvalHandler::fileMessage(int type, const QString &msg) { + Q_UNUSED(type) fprintf(stderr, "%s\n", qPrintable(msg)); } diff --git a/qmake/option.h b/qmake/option.h index 663f096072..cb3eb1341a 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -67,7 +67,7 @@ class EvalHandler : public QMakeHandler { public: void message(int type, const QString &msg, const QString &fileName, int lineNo); - void fileMessage(const QString &msg); + void fileMessage(int type, const QString &msg); void aboutToEval(ProFile *, ProFile *, EvalFileType); void doneWithEval(ProFile *); -- cgit v1.2.3