Todo: Store icons in the settings via index instead of strings

This allows us to use something else than a string in order to reference
icons. For an upcoming patch this will be necessary.

Since this patch introduces a settings structure change, a migration
feature from the old "Keyword\iconResource" string to the new "Keyword
\iconType" int is implemented.

Change-Id: Ia5695418fb135510ed549cf9a7cb59aab5389f31
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2015-11-16 16:45:05 +01:00
parent 04fda7d0f5
commit 19eb9e4f06
14 changed files with 176 additions and 40 deletions

View File

@@ -175,7 +175,8 @@ void TodoOutputPane::todoTreeViewClicked(const QModelIndex &index)
item.file = index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString();
item.line = index.sibling(row, Constants::OUTPUT_COLUMN_LINE).data().toInt();
item.color = index.data(Qt::BackgroundColorRole).value<QColor>();
item.iconResource = index.sibling(row, Constants::OUTPUT_COLUMN_TEXT).data(Qt::DecorationRole).toString();
item.iconType = static_cast<IconType>(index.sibling(row, Constants::OUTPUT_COLUMN_TEXT)
.data(Qt::UserRole).toInt());
emit todoItemClicked(item);
}