MCPcopy Create free account
hub / github.com/MultiMC/Launcher / setVersion

Method setVersion

launcher/minecraft/Component.cpp:252–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void Component::setVersion(const QString& version)
253{
254 if(version == m_version)
255 {
256 return;
257 }
258 m_version = version;
259 if(m_loaded)
260 {
261 // we are loaded and potentially have state to invalidate
262 if(m_file)
263 {
264 // we have a file... explicit version has been changed and there is nothing else to do.
265 }
266 else
267 {
268 // we don't have a file, therefore we are loaded with metadata
269 m_cachedVersion = version;
270 // see if the meta version is loaded
271 auto metaVersion = APPLICATION->metadataIndex()->get(m_uid, version);
272 if(metaVersion->isLoaded())
273 {
274 // if yes, we can continue with that.
275 m_metaVersion = metaVersion;
276 }
277 else
278 {
279 // if not, we need loading
280 m_metaVersion.reset();
281 m_loaded = false;
282 }
283 updateCachedData();
284 }
285 }
286 else
287 {
288 // not loaded... assume it will be sorted out later by the update task
289 }
290 emit dataChanged();
291}
292
293bool Component::customize()
294{

Callers 2

resolveDependenciesMethod · 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