Commit f80e5800 authored by hjk's avatar hjk
Browse files

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



A minor glitch in the startup profile.

Change-Id: I2195530e922b3fb37dbfadc800933a9378491833
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 16844e1f
......@@ -254,7 +254,7 @@ Command *ActionManager::registerAction(QAction *action, Id id, const Context &co
if (a) {
a->addOverrideAction(action, context, scriptable);
emit m_instance->commandListChanged();
emit m_instance->commandAdded(id.toString());
emit m_instance->commandAdded(id);
}
return a;
}
......
......@@ -73,7 +73,7 @@ public:
signals:
void commandListChanged();
void commandAdded(const QString &id);
void commandAdded(Core::Id id);
private:
ActionManager(QObject *parent = 0);
......
......@@ -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);
......
......@@ -55,13 +55,13 @@ public:
bool canExecuteEvent(const MacroEvent &macroEvent);
bool executeEvent(const MacroEvent &macroEvent);
private slots:
void addActionEvent(const QString &id);
private:
void registerCommand(Core::Id id);
Core::Command *command(const QString &id);
private slots:
void addCommand(const QString &id);
void addActionEvent(const QString &id);
void addCommand(Core::Id id);
private:
QSet<Core::Id> m_commandIds;
......
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