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

Method data

launcher/ui/java/VersionList.cpp:58–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58QVariant VersionList::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 auto version = (m_vlist[index.row()]);
67 switch (role) {
68 case SortRole:
69 return -index.row();
70 case VersionPointerRole:
71 return QVariant::fromValue(std::dynamic_pointer_cast<BaseVersion>(m_vlist[index.row()]));
72 case VersionIdRole:
73 return version->descriptor();
74 case VersionRole:
75 return version->version.toString();
76 case RecommendedRole:
77 return false; // do not recommend any version
78 case JavaNameRole:
79 return version->name();
80 case JavaMajorRole: {
81 auto major = version->version.toString();
82 if (major.startsWith("java")) {
83 major = "Java " + major.mid(4);
84 }
85 return major;
86 }
87 case TypeRole:
88 return version->packageType;
89 case Meta::VersionList::TimeRole:
90 return version->releaseTime;
91 default:
92 return QVariant();
93 }
94}
95
96BaseVersionList::RoleList VersionList::providesRoles() const
97{

Callers 14

getReleaseMethod · 0.45
getAssetMethod · 0.45
changeActiveAccountMethod · 0.45
addInstanceMethod · 0.45
instanceActivatedMethod · 0.45
instanceChangedMethod · 0.45
sortVersionsMethod · 0.45
activatedMethod · 0.45
selectionChangedMethod · 0.45
activatedMethod · 0.45
selectionChangedMethod · 0.45
on_buttonBox_acceptedMethod · 0.45

Calls 4

isValidMethod · 0.45
descriptorMethod · 0.45
toStringMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected