forked from qt-creator/qt-creator
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:
@@ -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 ¯oEvent);
|
||||
bool executeEvent(const MacroEvent ¯oEvent);
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user