report errors from projects included by cumulative evaluation

so far, we would suppress any errors which occur during the (exact)
evaluation of projects which were included only by cumulative evaluation
of a parent project (see f53d37d48). this makes sense, as excluded
projects are likely to fail, producing unsettling noise on the way.
however, having no indication at all why a subproject failed to load is
not helpful, either. so print these errors, but tag them with a prefix.

note that we continue to suppress messages from the cumulative
evaluation of all projects, including from the exact evaluation of .prf
files done even in this mode. this is done because this output is
expected to be quite noisy and unhelpful. however, it can be argued that
this isn't a wise choice for projects which are known to likely fail for
reasons which would not impact our ability to show (an approximation of)
the project in the project explorer. for the time being, we assume that
the expected errors occur later on (typically during the .prf evaluation
phase due to unknown QT entries), so an unexpected error which would
also affect the cumulative evaluation is displayed nonetheless.

Change-Id: Idc2675744169b7cb52c0542a80075850e2b9317c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen
2015-12-17 15:45:46 +01:00
parent 33ad0f1031
commit 68f5420093
3 changed files with 22 additions and 7 deletions

View File

@@ -1793,7 +1793,7 @@ void QmakeProFileNode::asyncUpdate()
m_project->incrementPendingEvaluateFutures();
setupReader();
if (!includedInExactParse())
m_readerExact->setVerbose(false);
m_readerExact->setExact(false);
m_parseFutureWatcher.waitForFinished();
EvalInput input = evalInput();
QFuture<EvalResult *> future = QtConcurrent::run(&QmakeProFileNode::asyncEvaluate, this, input);

View File

@@ -46,8 +46,11 @@ static QString format(const QString &fileName, int lineNo, const QString &msg)
return msg;
}
ProMessageHandler::ProMessageHandler(bool verbose)
ProMessageHandler::ProMessageHandler(bool verbose, bool exact)
: m_verbose(verbose)
, m_exact(exact)
//: Prefix used for output from the cumulative evaluation of project files.
, m_prefix(tr("[Inexact] "))
{
QObject::connect(this, SIGNAL(writeMessage(QString,Core::MessageManager::PrintToOutputPaneFlags)),
Core::MessageManager::instance(), SLOT(write(QString,Core::MessageManager::PrintToOutputPaneFlags)),
@@ -56,15 +59,24 @@ ProMessageHandler::ProMessageHandler(bool verbose)
void ProMessageHandler::message(int type, const QString &msg, const QString &fileName, int lineNo)
{
if ((type & CategoryMask) == ErrorMessage && ((type & SourceMask) == SourceParser || m_verbose))
emit writeMessage(format(fileName, lineNo, msg), Core::MessageManager::NoModeSwitch);
if ((type & CategoryMask) == ErrorMessage && ((type & SourceMask) == SourceParser || m_verbose)) {
QString fmsg = format(fileName, lineNo, msg);
if ((type & SourceMask) == SourceParser || m_exact)
emit writeMessage(fmsg, Core::MessageManager::NoModeSwitch);
else
emit writeMessage(m_prefix + fmsg, Core::MessageManager::NoModeSwitch);
}
}
void ProMessageHandler::fileMessage(int type, const QString &msg)
{
Q_UNUSED(type)
if (m_verbose)
emit writeMessage(msg, Core::MessageManager::NoModeSwitch);
if (m_verbose) {
if (m_exact)
emit writeMessage(msg, Core::MessageManager::NoModeSwitch);
else
emit writeMessage(m_prefix + msg, Core::MessageManager::NoModeSwitch);
}
}

View File

@@ -49,7 +49,7 @@ class QTSUPPORT_EXPORT ProMessageHandler : public QObject, public QMakeHandler
Q_OBJECT
public:
ProMessageHandler(bool verbose = true);
ProMessageHandler(bool verbose = true, bool exact = true);
virtual ~ProMessageHandler() {}
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
@@ -58,12 +58,15 @@ public:
virtual void fileMessage(int type, const QString &msg);
void setVerbose(bool on) { m_verbose = on; }
void setExact(bool on) { m_exact = on; }
signals:
void writeMessage(const QString &error, Core::MessageManager::PrintToOutputPaneFlags flag);
private:
bool m_verbose;
bool m_exact;
QString m_prefix;
};
class QTSUPPORT_EXPORT ProFileReader : public ProMessageHandler, public QMakeParser, public ProFileEvaluator