Commit 33ad0f10 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Oswald Buddenhagen

report to message handler whether evaluating cumulatively

we evaluate prf files precisely even when the pro file is evaluated
cumulatively. the message handler should know the mode a message is
reported in.

this just syncs up with qttools/08d0cb6f8e90a818bf6d3bec7a6d00f16419b8c0
and qttools/ea1a5c3534f089c0e704808a0fb029eda8f753b4 without
user-visible effect.

Change-Id: Ia14953a5a9dc31af56ad6c338017dd5b85bb4494
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 4996eb34
......@@ -60,8 +60,9 @@ void ProMessageHandler::message(int type, const QString &msg, const QString &fil
emit writeMessage(format(fileName, lineNo, msg), Core::MessageManager::NoModeSwitch);
}
void ProMessageHandler::fileMessage(const QString &msg)
void ProMessageHandler::fileMessage(int type, const QString &msg)
{
Q_UNUSED(type)
if (m_verbose)
emit writeMessage(msg, Core::MessageManager::NoModeSwitch);
}
......
......@@ -55,7 +55,7 @@ public:
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
virtual void doneWithEval(ProFile *) {}
virtual void message(int type, const QString &msg, const QString &fileName, int lineNo);
virtual void fileMessage(const QString &msg);
virtual void fileMessage(int type, const QString &msg);
void setVerbose(bool on) { m_verbose = on; }
......
......@@ -399,7 +399,9 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
if (!errout.isEmpty()) {
if (errout.endsWith('\n'))
errout.chop(1);
m_handler->message(QMakeHandler::EvalError, QString::fromLocal8Bit(errout));
m_handler->message(
QMakeHandler::EvalError | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0),
QString::fromLocal8Bit(errout));
}
# endif
out = proc.readAllStandardOutput();
......@@ -1467,8 +1469,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;
......
......@@ -1981,7 +1981,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFileInto(
void QMakeEvaluator::message(int type, const QString &msg) const
{
if (!m_skipLevel)
m_handler->message(type, msg,
m_handler->message(type | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0), msg,
m_current.line ? m_current.pro->fileName() : QString(),
m_current.line != 0xffff ? m_current.line : -1);
}
......
......@@ -65,6 +65,8 @@ public:
enum {
SourceEvaluator = 0x10,
CumulativeEvalMessage = 0x1000,
EvalWarnLanguage = SourceEvaluator | WarningMessage | WarnLanguage,
EvalWarnDeprecated = SourceEvaluator | WarningMessage | WarnDeprecated,
......@@ -72,7 +74,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;
......
......@@ -47,8 +47,9 @@ class QMAKE_EXPORT QMakeParserHandler
public:
enum {
CategoryMask = 0xf00,
WarningMessage = 0x000,
ErrorMessage = 0x100,
InfoMessage = 0x100,
WarningMessage = 0x200,
ErrorMessage = 0x300,
SourceMask = 0xf0,
SourceParser = 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment