MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / sortVersions

Method sortVersions

launcher/ui/java/VersionList.cpp:108–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void VersionList::sortVersions()
109{
110 if (!m_version || !m_version->data())
111 return;
112 QString versionStr = SysInfo::getSupportedJavaArchitecture();
113 beginResetModel();
114 auto runtimes = m_version->data()->runtimes;
115 m_vlist = {};
116 if (!versionStr.isEmpty() && !runtimes.isEmpty()) {
117 std::copy_if(runtimes.begin(), runtimes.end(), std::back_inserter(m_vlist),
118 [versionStr](Java::MetadataPtr val) { return val->runtimeOS == versionStr; });
119 std::sort(m_vlist.begin(), m_vlist.end(), sortJavas);
120 } else {
121 qWarning() << "No Java versions found for your operating system:" << SysInfo::currentSystem() << SysInfo::useQTForArch();
122 }
123 endResetModel();
124}
125
126} // namespace Java

Callers

nothing calls this directly

Calls 5

currentSystemFunction · 0.85
useQTForArchFunction · 0.85
dataMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected