Skip to content
Snippets Groups Projects
Commit d5cf6dff authored by hjk's avatar hjk
Browse files

FakeVim: Simplify Core::Id usage


Change-Id: Id8fdc442c535d0fcc274360b8ed590f5e1c61e03
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 2330fb48
No related branches found
No related tags found
No related merge requests found
...@@ -1073,12 +1073,12 @@ bool FakeVimPluginPrivate::initialize() ...@@ -1073,12 +1073,12 @@ bool FakeVimPluginPrivate::initialize()
ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED); ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED);
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR); advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR);
const Id base = Id("FakeVim.UserAction");
for (int i = 1; i < 10; ++i) { for (int i = 1; i < 10; ++i) {
QAction *act = new QAction(this); QAction *act = new QAction(this);
act->setText(tr("Execute User Action #%1").arg(i)); act->setText(tr("Execute User Action #%1").arg(i));
act->setData(i); act->setData(i);
QString id = QString::fromLatin1("FakeVim.UserAction%1").arg(i); cmd = ActionManager::registerAction(act, base.withSuffix(i), globalcontext);
cmd = ActionManager::registerAction(act, Id(id), globalcontext);
cmd->setDefaultKeySequence(QKeySequence((UseMacShortcuts ? tr("Meta+V,%1") : tr("Alt+V,%1")).arg(i))); cmd->setDefaultKeySequence(QKeySequence((UseMacShortcuts ? tr("Meta+V,%1") : tr("Alt+V,%1")).arg(i)));
connect(act, SIGNAL(triggered()), SLOT(userActionTriggered())); connect(act, SIGNAL(triggered()), SLOT(userActionTriggered()));
} }
...@@ -1826,7 +1826,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd) ...@@ -1826,7 +1826,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
const QString &id = it.key(); const QString &id = it.key();
QRegExp re = it.value(); QRegExp re = it.value();
if (!re.pattern().isEmpty() && re.indexIn(cmd.cmd) != -1) { if (!re.pattern().isEmpty() && re.indexIn(cmd.cmd) != -1) {
triggerAction(Core::Id(id)); triggerAction(Core::Id::fromString(id));
return; return;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment