Fix crash when replying macro including alt+r

Task-number: QTCREATORBUG-5331

Change-Id: Ice1b9d0bdd153e437e5a70b208947b6db98cc1e3
Reviewed-on: http://codereview.qt.nokia.com/2189
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Eike Ziller
2011-07-26 13:42:34 +02:00
parent 1f3ab9baf3
commit e78bc71851

View File

@@ -323,8 +323,22 @@ void MacroManager::endMacro()
void MacroManager::executeLastMacro()
{
if (d->currentMacro)
d->executeMacro(d->currentMacro);
if (!d->currentMacro)
return;
// make sure the macro doesn't accidentally invoke a macro action
Core::ActionManager *am = Core::ICore::instance()->actionManager();
am->command(Constants::START_MACRO)->action()->setEnabled(false);
am->command(Constants::END_MACRO)->action()->setEnabled(false);
am->command(Constants::EXECUTE_LAST_MACRO)->action()->setEnabled(false);
am->command(Constants::SAVE_LAST_MACRO)->action()->setEnabled(false);
d->executeMacro(d->currentMacro);
am->command(Constants::START_MACRO)->action()->setEnabled(true);
am->command(Constants::END_MACRO)->action()->setEnabled(false);
am->command(Constants::EXECUTE_LAST_MACRO)->action()->setEnabled(true);
am->command(Constants::SAVE_LAST_MACRO)->action()->setEnabled(true);
}
bool MacroManager::executeMacro(const QString &name)