Avoid Id->QString->Id round trip in macrohandler setup

A minor glitch in the startup profile.

Change-Id: I2195530e922b3fb37dbfadc800933a9378491833
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-11-05 08:58:24 +01:00
parent 16844e1fbc
commit f80e580003
4 changed files with 9 additions and 10 deletions

View File

@@ -59,8 +59,8 @@ ActionMacroHandler::ActionMacroHandler():
connect(m_mapper, SIGNAL(mapped(QString)),
this, SLOT(addActionEvent(QString)));
connect(ActionManager::instance(), SIGNAL(commandAdded(QString)),
this, SLOT(addCommand(QString)));
connect(ActionManager::instance(), &ActionManager::commandAdded,
this, &ActionMacroHandler::addCommand);
// Register all existing scriptable actions
QList<Command *> commands = ActionManager::commands();
@@ -113,9 +113,8 @@ void ActionMacroHandler::registerCommand(Id id)
}
}
void ActionMacroHandler::addCommand(const QString &name)
void ActionMacroHandler::addCommand(Id id)
{
const Id id = Id::fromString(name);
const Command *command = ActionManager::command(id);
if (command->isScriptable())
registerCommand(id);