From fe5f9599251bd8811317e4236947dcf385107be8 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 12 Mar 2024 15:39:49 +0100 Subject: [PATCH] QmlPreview: Fix enabled state of editor action Kind of amends 42c1b1587484b5dd6dc562e7fd80dacbd041bd33. Change-Id: Ifd340d0f9bb206c48fd82cecf4e735cca0d70a7d Reviewed-by: Alessandro Portale --- src/plugins/qmlpreview/qmlpreviewplugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index c871996a7bf..31638f76622 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -199,7 +199,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent) previewFileAction->setVisible(fileNode && fileNode->fileType() == FileType::QML); }); connect(Core::EditorManager::instance(), &Core::EditorManager::editorOpened, this, - [runPreviewAction] (Core::IEditor *editor) { + [] (Core::IEditor *editor) { if (!editor) return; if (!editor->document()) @@ -225,8 +225,8 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent) {":/utils/images/run_small.png", Utils::Theme::IconsRunToolBarColor}, {":/utils/images/eyeoverlay.png", Utils::Theme::IconsDebugColor} }).icon(); - Utils::ProxyAction *action = - Utils::ProxyAction::proxyActionWithIcon(runPreviewAction, icon); + Utils::ProxyAction *action = Utils::ProxyAction::proxyActionWithIcon( + Core::ActionManager::command("QmlPreview.RunPreview")->action(), icon); toolBar->insertAction(nullptr, action); });