| 71 | } |
| 72 | |
| 73 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override |
| 74 | { |
| 75 | KDevelop::IPlugin* plugin = pluginForIndex(index); |
| 76 | if (!plugin) |
| 77 | return QVariant(); |
| 78 | |
| 79 | switch (role) { |
| 80 | case Qt::DisplayRole: |
| 81 | return displayName(plugin); |
| 82 | case DescriptionRole: |
| 83 | return pluginInfo(plugin).description(); |
| 84 | case Qt::DecorationRole: { |
| 85 | const QString iconName = pluginInfo(plugin).iconName(); |
| 86 | if (iconName.isEmpty()) { |
| 87 | return QStringLiteral("kdevelop"); |
| 88 | } |
| 89 | return iconName; |
| 90 | } |
| 91 | default: |
| 92 | return QVariant(); |
| 93 | }; |
| 94 | } |
| 95 | |
| 96 | int rowCount(const QModelIndex& parent = QModelIndex()) const override |
| 97 | { |
no test coverage detected