MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / data

Method data

launcher/BaseVersionList.cpp:58–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58QVariant BaseVersionList::data(const QModelIndex& index, int role) const
59{
60 if (!index.isValid())
61 return QVariant();
62
63 if (index.row() > count())
64 return QVariant();
65
66 BaseVersion::Ptr version = at(index.row());
67
68 switch (role) {
69 case VersionPointerRole:
70 return QVariant::fromValue(version);
71
72 case VersionRole:
73 return version->name();
74
75 case VersionIdRole:
76 return version->descriptor();
77
78 case TypeRole:
79 return version->typeString();
80
81 case JavaMajorRole: {
82 auto major = version->name();
83 if (major.startsWith("java")) {
84 major = "Java " + major.mid(4);
85 }
86 return major;
87 }
88
89 default:
90 return QVariant();
91 }
92}
93
94BaseVersionList::RoleList BaseVersionList::providesRoles() const
95{

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