Commit 591f04ad authored by Leandro Melo's avatar Leandro Melo
Browse files

QML: Fix crash when calling reformat file

The action should only be enabled in the QML editor context.

Task-number: QTCREATORBUG-6709
Change-Id: I7d34f3eebb674d07e41fad5d6027d2ce37db9161
Reviewed-by: default avatarFawzi Mohamed <>
parent 2fb2c46d
...@@ -208,7 +208,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e ...@@ -208,7 +208,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
m_reformatFileAction = new QAction(tr("Reformat File"), this); m_reformatFileAction = new QAction(tr("Reformat File"), this);
cmd = am->registerAction(m_reformatFileAction, Core::Id(Constants::REFORMAT_FILE), globalContext); cmd = am->registerAction(m_reformatFileAction, Core::Id(Constants::REFORMAT_FILE), context);
connect(m_reformatFileAction, SIGNAL(triggered()), this, SLOT(reformatFile())); connect(m_reformatFileAction, SIGNAL(triggered()), this, SLOT(reformatFile()));
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment