MCPcopy Create free account
hub / github.com/PrismLauncher/PrismLauncher / data

Method data

launcher/java/JavaInstallList.cpp:92–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92QVariant 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
121BaseVersionList::RoleList JavaInstallList::providesRoles() const
122{

Callers

nothing calls this directly

Calls 3

isValidMethod · 0.45
descriptorMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected