MCPcopy Create free account
hub / github.com/MultiMC/Launcher / data

Method data

launcher/BaseVersionList.cpp:41–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41QVariant BaseVersionList::data(const QModelIndex &index, int role) const
42{
43 if (!index.isValid())
44 return QVariant();
45
46 if (index.row() > count())
47 return QVariant();
48
49 BaseVersionPtr version = at(index.row());
50
51 switch (role)
52 {
53 case VersionPointerRole:
54 return qVariantFromValue(version);
55
56 case VersionRole:
57 return version->name();
58
59 case VersionIdRole:
60 return version->descriptor();
61
62 case TypeRole:
63 return version->typeString();
64
65 default:
66 return QVariant();
67 }
68}
69
70BaseVersionList::RoleList BaseVersionList::providesRoles() const
71{

Callers

nothing calls this directly

Calls 4

isValidMethod · 0.45
nameMethod · 0.45
descriptorMethod · 0.45
typeStringMethod · 0.45

Tested by

no test coverage detected