diff options
author | Christian Stenger <christian.stenger@qt.io> | 2023-10-19 09:49:34 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2023-10-19 13:44:28 +0000 |
commit | 66d94a82a32cdfdb344d55ef2c610ee9b3f03f7f (patch) | |
tree | 986e4cf84dda46f2d205c5f78cc675f8f78ead4d | |
parent | b706fab6c642072750935a0f13290d098cf49233 (diff) |
QmlPreview: Do not act on any editor / document change
If no preview is running there is no need to process anything.
In theory the basic connections inside the plugin might be
better properly done and explicitly connected and disconnected,
but I wanted to avoid an intrusive change after the beta.
Fixes ongoing message box displaying when editing a qml file.
Kind of amends 5336fd83a004c1fe5265b9f9ba87320c031d2040 as it
revealed this misbehavior.
Change-Id: I5081e1c7d2154e3cc75ad9da32af1b0c7f86dff2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r-- | src/plugins/qmlpreview/qmlpreviewplugin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index 2722ecb016..464c9b88f0 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -413,6 +413,8 @@ void QmlPreviewPluginPrivate::attachToEditor() void QmlPreviewPluginPrivate::checkEditor() { + if (m_runningPreviews.isEmpty()) + return; QmlJS::Dialect::Enum dialect = QmlJS::Dialect::AnyLanguage; Core::IDocument *doc = m_lastEditor->document(); const QString mimeType = doc->mimeType(); |