diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index f68a9d0e4a0..64861b98470 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -105,10 +105,7 @@ namespace Internal { QmlJSEditorWidget::QmlJSEditorWidget() { - m_outlineCombo = 0; - m_contextPane = 0; m_findReferences = new FindReferences(this); - setLanguageSettingsId(QmlJSTools::Constants::QML_JS_SETTINGS_ID); } @@ -142,7 +139,6 @@ void QmlJSEditorWidget::finalizeInitialization() &m_contextPaneTimer, static_cast(&QTimer::start)); connect(m_contextPane, &IContextPane::closed, this, &QmlJSEditorWidget::showTextMarker); } - m_oldCursorPosition = -1; connect(this->document(), &QTextDocument::modificationChanged, this, &QmlJSEditorWidget::modificationChanged); diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 9a086e65c08..5bccf742662 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -117,16 +117,16 @@ private: QModelIndex indexForPosition(unsigned cursorPosition, const QModelIndex &rootIndex = QModelIndex()) const; bool hideContextPane(); - QmlJSEditorDocument *m_qmlJsEditorDocument; + QmlJSEditorDocument *m_qmlJsEditorDocument = nullptr; QTimer m_updateUsesTimer; // to wait for multiple text cursor position changes QTimer m_updateOutlineIndexTimer; QTimer m_contextPaneTimer; QComboBox *m_outlineCombo; QModelIndex m_outlineModelIndex; - QmlJS::ModelManagerInterface *m_modelManager; + QmlJS::ModelManagerInterface *m_modelManager = nullptr; - QmlJS::IContextPane *m_contextPane; - int m_oldCursorPosition; + QmlJS::IContextPane *m_contextPane = nullptr; + int m_oldCursorPosition = -1; FindReferences *m_findReferences; }; diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 6ef9f3bdee8..732deddb4b7 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -455,12 +455,9 @@ namespace QmlJSEditor { namespace Internal { QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *parent) - : q(parent), - m_semanticInfoDocRevision(-1), - m_semanticHighlighter(new SemanticHighlighter(parent)), - m_semanticHighlightingNecessary(false), - m_outlineModelNeedsUpdate(false), - m_outlineModel(new QmlOutlineModel(parent)) + : q(parent) + , m_semanticHighlighter(new SemanticHighlighter(parent)) + , m_outlineModel(new QmlOutlineModel(parent)) { ModelManagerInterface *modelManager = ModelManagerInterface::instance(); diff --git a/src/plugins/qmljseditor/qmljseditordocument_p.h b/src/plugins/qmljseditor/qmljseditordocument_p.h index f2cee06d762..854b81519f8 100644 --- a/src/plugins/qmljseditor/qmljseditordocument_p.h +++ b/src/plugins/qmljseditor/qmljseditordocument_p.h @@ -58,19 +58,19 @@ public: void updateOutlineModel(); public: - QmlJSEditorDocument *q; + QmlJSEditorDocument *q = nullptr; QTimer m_updateDocumentTimer; // used to compress multiple document changes QTimer m_reupdateSemanticInfoTimer; // used to compress multiple libraryInfo changes - int m_semanticInfoDocRevision; // document revision to which the semantic info is currently updated to + int m_semanticInfoDocRevision = -1; // document revision to which the semantic info is currently updated to SemanticInfoUpdater *m_semanticInfoUpdater; QmlJSTools::SemanticInfo m_semanticInfo; QVector m_diagnosticRanges; - Internal::SemanticHighlighter *m_semanticHighlighter; - bool m_semanticHighlightingNecessary; - bool m_outlineModelNeedsUpdate; + Internal::SemanticHighlighter *m_semanticHighlighter = nullptr; + bool m_semanticHighlightingNecessary = false; + bool m_outlineModelNeedsUpdate = false; bool m_firstSementicInfo = true; QTimer m_updateOutlineModelTimer; - Internal::QmlOutlineModel *m_outlineModel; + Internal::QmlOutlineModel *m_outlineModel = nullptr; }; } // Internal diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp index bf37940983a..77a8c4e08a7 100644 --- a/src/plugins/qmljseditor/qmljsoutline.cpp +++ b/src/plugins/qmljseditor/qmljsoutline.cpp @@ -94,13 +94,10 @@ void QmlJSOutlineFilterModel::setFilterBindings(bool filterBindings) invalidateFilter(); } -QmlJSOutlineWidget::QmlJSOutlineWidget(QWidget *parent) : - TextEditor::IOutlineWidget(parent), - m_treeView(new QmlJSOutlineTreeView(this)), - m_filterModel(new QmlJSOutlineFilterModel(this)), - m_editor(0), - m_enableCursorSync(true), - m_blockCursorSync(false) +QmlJSOutlineWidget::QmlJSOutlineWidget(QWidget *parent) + : TextEditor::IOutlineWidget(parent) + , m_treeView(new QmlJSOutlineTreeView(this)) + , m_filterModel(new QmlJSOutlineFilterModel(this)) { m_filterModel->setFilterBindings(false); diff --git a/src/plugins/qmljseditor/qmljsoutline.h b/src/plugins/qmljseditor/qmljsoutline.h index 81c3f56b6af..79129012d63 100644 --- a/src/plugins/qmljseditor/qmljsoutline.h +++ b/src/plugins/qmljseditor/qmljsoutline.h @@ -85,14 +85,14 @@ private: bool syncCursor(); private: - QmlJSOutlineTreeView *m_treeView; - QmlJSOutlineFilterModel *m_filterModel; - QmlJSEditorWidget *m_editor; + QmlJSOutlineTreeView *m_treeView = nullptr; + QmlJSOutlineFilterModel *m_filterModel = nullptr; + QmlJSEditorWidget *m_editor = nullptr; - QAction *m_showBindingsAction; + QAction *m_showBindingsAction = nullptr; - bool m_enableCursorSync; - bool m_blockCursorSync; + bool m_enableCursorSync = true; + bool m_blockCursorSync = false; }; class QmlJSOutlineWidgetFactory : public TextEditor::IOutlineWidgetFactory