forked from qt-creator/qt-creator
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:
@@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user