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: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Leandro Melo
2012-01-20 17:38:31 +01:00
parent 2fb2c46da8
commit 591f04adf1

View File

@@ -208,7 +208,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
qmlToolsMenu->addAction(cmd);
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()));
qmlToolsMenu->addAction(cmd);