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

Method data

launcher/BaseVersionList.cpp:61–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61QVariant BaseVersionList::data(const QModelIndex &index, int role) const
62{
63 if (!index.isValid())
64 return QVariant();
65
66 if (index.row() > count())
67 return QVariant();
68
69 BaseVersionPtr version = at(index.row());
70
71 switch (role)
72 {
73 case VersionPointerRole:
74 return QVariant::fromValue(version);
75
76 case VersionRole:
77 return version->name();
78
79 case VersionIdRole:
80 return version->descriptor();
81
82 case TypeRole:
83 return version->typeString();
84
85 default:
86 return QVariant();
87 }
88}
89
90BaseVersionList::RoleList BaseVersionList::providesRoles() const
91{

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