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

Method setVersion

launcher/minecraft/Component.cpp:299–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void Component::setVersion(const QString& version)
300{
301 if (version == m_version) {
302 return;
303 }
304 m_version = version;
305 if (m_loaded) {
306 // we are loaded and potentially have state to invalidate
307 if (m_file) {
308 // we have a file... explicit version has been changed and there is nothing else to do.
309 } else {
310 // we don't have a file, therefore we are loaded with metadata
311 m_cachedVersion = version;
312 // see if the meta version is loaded
313 auto metaVersion = APPLICATION->metadataIndex()->get(m_uid, version);
314 if (metaVersion->isLoaded()) {
315 // if yes, we can continue with that.
316 m_metaVersion = metaVersion;
317 } else {
318 // if not, we need loading
319 m_metaVersion.reset();
320 m_loaded = false;
321 }
322 updateCachedData();
323 }
324 } else {
325 // not loaded... assume it will be sorted out later by the update task
326 }
327 emit dataChanged();
328}
329
330bool Component::customize()
331{

Callers 3

resolveDependenciesMethod · 0.80
performUpdateActionsMethod · 0.80
setComponentVersionMethod · 0.80

Calls 4

metadataIndexMethod · 0.80
getMethod · 0.45
isLoadedMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected