| 90 | } |
| 91 | |
| 92 | QVariant JavaInstallList::data(const QModelIndex& index, int role) const |
| 93 | { |
| 94 | if (!index.isValid()) |
| 95 | return QVariant(); |
| 96 | |
| 97 | if (index.row() > count()) |
| 98 | return QVariant(); |
| 99 | |
| 100 | auto version = std::dynamic_pointer_cast<JavaInstall>(m_vlist[index.row()]); |
| 101 | switch (role) { |
| 102 | case SortRole: |
| 103 | return -index.row(); |
| 104 | case VersionPointerRole: |
| 105 | return QVariant::fromValue(m_vlist[index.row()]); |
| 106 | case VersionIdRole: |
| 107 | return version->descriptor(); |
| 108 | case VersionRole: |
| 109 | return version->id.toString(); |
| 110 | case RecommendedRole: |
| 111 | return false; |
| 112 | case PathRole: |
| 113 | return version->path; |
| 114 | case CPUArchitectureRole: |
| 115 | return version->arch; |
| 116 | default: |
| 117 | return QVariant(); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | BaseVersionList::RoleList JavaInstallList::providesRoles() const |
| 122 | { |
nothing calls this directly
no test coverage detected