QmlJSEditor: Move outline model to document

Also the updating of the model is now done only once in the document,
and delayed till an editor is visible if necessary.

Change-Id: I69b1abebc2b691b37a618db7d1f5ebbbc8e75bca
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Eike Ziller
2014-01-30 17:18:35 +01:00
parent 1e6bc2758d
commit 58b717fbb8
5 changed files with 60 additions and 50 deletions

View File

@@ -41,6 +41,7 @@ namespace QmlJSEditor {
namespace Internal {
class QmlJSEditorDocument;
class QmlOutlineModel;
class SemanticHighlighter;
class SemanticInfoUpdater;
@@ -58,6 +59,7 @@ public slots:
void onDocumentUpdated(QmlJS::Document::Ptr doc);
void reupdateSemanticInfo();
void acceptNewSemanticInfo(const QmlJSTools::SemanticInfo &semanticInfo);
void updateOutlineModel();
public:
QmlJSEditorDocument *m_q;
@@ -69,6 +71,9 @@ public:
QVector<QTextLayout::FormatRange> m_diagnosticRanges;
Internal::SemanticHighlighter *m_semanticHighlighter;
bool m_semanticHighlightingNecessary;
bool m_outlineModelNeedsUpdate;
QTimer *m_updateOutlineModelTimer;
Internal::QmlOutlineModel *m_outlineModel;
};
} // Internal