| 15 | } |
| 16 | |
| 17 | QVariant ProjectModel::data(const QModelIndex &index, int role) const |
| 18 | { |
| 19 | if (role == Qt::DecorationRole) { |
| 20 | auto name = index.data(Project::IconNameRole).toString(); |
| 21 | if (!name.isEmpty()) |
| 22 | return QIcon::fromTheme(name); |
| 23 | |
| 24 | name = index.data(Project::FileIconRole).toString(); |
| 25 | if (!name.isEmpty()) |
| 26 | return CustomIcons::icon(QFileInfo(name)); |
| 27 | } |
| 28 | |
| 29 | return QStandardItemModel::data(index, role); |
| 30 | } |
no test coverage detected