QmlJS: Fix infinite loop when scanning for exported C++ types.

Setting extra diagnostics would call updateDocument which would in turn
trigger another scan.

Change-Id: I3810a380cdf716a12767d94ff82dc30f8ae3954d
Reviewed-on: http://codereview.qt.nokia.com/3917
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-31 09:58:40 +02:00
parent 7bc8dd18a3
commit 9f7a2194f7
5 changed files with 44 additions and 7 deletions

View File

@@ -603,6 +603,22 @@ void Document::releaseSourceAndAST()
}
}
bool Document::DiagnosticMessage::operator==(const Document::DiagnosticMessage &other) const
{
return
_line == other._line &&
_column == other._column &&
_length == other._length &&
_level == other._level &&
_fileName == other._fileName &&
_text == other._text;
}
bool Document::DiagnosticMessage::operator!=(const Document::DiagnosticMessage &other) const
{
return !operator==(other);
}
Snapshot::Snapshot()
{
}

View File

@@ -177,6 +177,9 @@ public:
QString text() const
{ return _text; }
bool operator==(const DiagnosticMessage &other) const;
bool operator!=(const DiagnosticMessage &other) const;
private:
int _level;
QString _fileName;

View File

@@ -154,6 +154,7 @@ public:
Q_SIGNALS:
void documentUpdated(CPlusPlus::Document::Ptr doc);
void sourceFilesRefreshed(const QStringList &files);
void extraDiagnosticsUpdated(QString fileName);
public Q_SLOTS:
virtual void updateModifiedSourceFiles() = 0;