Show all the warn messages.

This commit is contained in:
Roberto Raggi
2009-06-04 11:42:02 +02:00
parent f55d5500c5
commit cd3022dc3e
2 changed files with 11 additions and 4 deletions

View File

@@ -55,7 +55,8 @@ class DocumentDiagnosticClient : public DiagnosticClient
public:
DocumentDiagnosticClient(Document *doc, QList<Document::DiagnosticMessage> *messages)
: doc(doc),
messages(messages)
messages(messages),
errorCount(0)
{ }
virtual void report(int level,
@@ -63,8 +64,12 @@ public:
unsigned line, unsigned column,
const char *format, va_list ap)
{
if (messages->count() == MAX_MESSAGE_COUNT)
return;
if (level == Error) {
++errorCount;
if (errorCount >= MAX_MESSAGE_COUNT)
return; // ignore the error
}
const QString fileName = QString::fromUtf8(fileId->chars(), fileId->size());
@@ -88,8 +93,10 @@ public:
}
}
private:
Document *doc;
QList<Document::DiagnosticMessage> *messages;
int errorCount;
};
} // anonymous namespace