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

Method setComponentVersion

launcher/minecraft/PackProfile.cpp:1181–1205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179}
1180
1181bool PackProfile::setComponentVersion(const QString& uid, const QString& version, bool important)
1182{
1183 auto iter = d->componentIndex.find(uid);
1184 if(iter != d->componentIndex.end())
1185 {
1186 ComponentPtr component = *iter;
1187 // set existing
1188 if(component->revert())
1189 {
1190 component->setVersion(version);
1191 component->setImportant(important);
1192 return true;
1193 }
1194 return false;
1195 }
1196 else
1197 {
1198 // add new
1199 auto component = new Component(this, uid);
1200 component->m_version = version;
1201 component->m_important = important;
1202 appendComponent(component);
1203 return true;
1204 }
1205}
1206
1207QString PackProfile::getComponentVersion(const QString& uid) const
1208{

Callers 13

executeTaskMethod · 0.80
processModrinthMethod · 0.80
installMethod · 0.80
installMethod · 0.80
foreachFunction · 0.80
runMethod · 0.80
copyFinishedMethod · 0.80

Calls 5

revertMethod · 0.80
setVersionMethod · 0.80
setImportantMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected