forked from qt-creator/qt-creator
QmlDesigner: reduce editor changed signals
- detaching the TextEditView already emits the TextEditor change signal -> so removing the call from QmlDesignerPlugin::deactivateAutoSynchronization() - in case the user closed explicit the editor we do not want to emit any signals anymore Change-Id: Idb5c2cdde583f7d32f2a9ef5628d1b6d3fc7bb3f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
b25d21f42e
commit
668c87ffd9
@@ -45,6 +45,7 @@
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
@@ -605,6 +606,13 @@ RewriterView *DesignDocument::rewriterView() const
|
||||
void DesignDocument::setEditor(Core::IEditor *editor)
|
||||
{
|
||||
m_textEditor = editor;
|
||||
// if the user closed the file explicit we do not want to do anything with it anymore
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::editorAboutToClose,
|
||||
this, [this](Core::IEditor *editor) {
|
||||
if (m_textEditor.data() == editor)
|
||||
m_textEditor.clear();
|
||||
});
|
||||
|
||||
connect(editor->document(), &Core::IDocument::filePathChanged,
|
||||
this, &DesignDocument::updateFileName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user