Skip to content
Snippets Groups Projects
Commit 2df6d1c4 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Macros: Avoid repetitive calls


Change-Id: If0c0694fe4bc01066b31b430d087de1b64ed8e0a
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 3251d0dc
No related branches found
No related tags found
No related merge requests found
...@@ -102,16 +102,17 @@ void MacroOptionsWidget::createTable() ...@@ -102,16 +102,17 @@ void MacroOptionsWidget::createTable()
QMapIterator<QString, Macro *> it(MacroManager::macros()); QMapIterator<QString, Macro *> it(MacroManager::macros());
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
QFileInfo fileInfo(it.value()->fileName()); Macro *macro = it.value();
QFileInfo fileInfo(macro->fileName());
if (fileInfo.absoluteDir() == dir.absolutePath()) { if (fileInfo.absoluteDir() == dir.absolutePath()) {
QTreeWidgetItem *macroItem = new QTreeWidgetItem(m_ui->treeWidget); QTreeWidgetItem *macroItem = new QTreeWidgetItem(m_ui->treeWidget);
macroItem->setText(0, it.value()->displayName()); macroItem->setText(0, macro->displayName());
macroItem->setText(1, it.value()->description()); macroItem->setText(1, macro->description());
macroItem->setData(0, NAME_ROLE, it.value()->displayName()); macroItem->setData(0, NAME_ROLE, macro->displayName());
macroItem->setData(0, WRITE_ROLE, it.value()->isWritable()); macroItem->setData(0, WRITE_ROLE, macro->isWritable());
Core::Command *command = Core::Command *command =
Core::ActionManager::command(base.withSuffix(it.value()->displayName())); Core::ActionManager::command(base.withSuffix(macro->displayName()));
if (command && command->action()) if (command && command->action())
macroItem->setText(2, command->action()->shortcut().toString()); macroItem->setText(2, command->action()->shortcut().toString());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment