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
......@@ -102,16 +102,17 @@ void MacroOptionsWidget::createTable()
QMapIterator<QString, Macro *> it(MacroManager::macros());
while (it.hasNext()) {
it.next();
QFileInfo fileInfo(it.value()->fileName());
Macro *macro = it.value();
QFileInfo fileInfo(macro->fileName());
if (fileInfo.absoluteDir() == dir.absolutePath()) {
QTreeWidgetItem *macroItem = new QTreeWidgetItem(m_ui->treeWidget);
macroItem->setText(0, it.value()->displayName());
macroItem->setText(1, it.value()->description());
macroItem->setData(0, NAME_ROLE, it.value()->displayName());
macroItem->setData(0, WRITE_ROLE, it.value()->isWritable());
macroItem->setText(0, macro->displayName());
macroItem->setText(1, macro->description());
macroItem->setData(0, NAME_ROLE, macro->displayName());
macroItem->setData(0, WRITE_ROLE, macro->isWritable());
Core::Command *command =
Core::ActionManager::command(base.withSuffix(it.value()->displayName()));
Core::ActionManager::command(base.withSuffix(macro->displayName()));
if (command && command->action())
macroItem->setText(2, command->action()->shortcut().toString());
}
......
Supports Markdown
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