| 558 | } |
| 559 | |
| 560 | QVariant AuthorGroupProxyModel::data(const QModelIndex &proxyIndex, int role) const |
| 561 | { |
| 562 | if (isAuthorItem(proxyIndex)) { |
| 563 | const AuthorGroupItem *item = static_cast<AuthorGroupItem *>(proxyIndex.internalPointer()); |
| 564 | if (role == Qt::DisplayRole) { |
| 565 | return item->author(); |
| 566 | } else if (role == Qt::DecorationRole) { |
| 567 | return QIcon::fromTheme(item->author().isEmpty() ? QStringLiteral("user-away") : QStringLiteral("user-identity")); |
| 568 | } else { |
| 569 | return QVariant(); |
| 570 | } |
| 571 | } else { |
| 572 | return QAbstractProxyModel::data(proxyIndex, role); |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | QMap<int, QVariant> AuthorGroupProxyModel::itemData(const QModelIndex &index) const |
| 577 | { |
no test coverage detected