MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / setComponentVersion

Method setComponentVersion

launcher/minecraft/PackProfile.cpp:965–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965bool PackProfile::setComponentVersion(const QString& uid, const QString& version, bool important)
966{
967 auto iter = d->componentIndex.find(uid);
968 if(iter != d->componentIndex.end())
969 {
970 ComponentPtr component = *iter;
971 // set existing
972 if(component->revert())
973 {
974 component->setVersion(version);
975 component->setImportant(important);
976 return true;
977 }
978 return false;
979 }
980 else
981 {
982 // add new
983 auto component = new Component(this, uid);
984 component->m_version = version;
985 component->m_important = important;
986 appendComponent(component);
987 return true;
988 }
989}
990
991QString PackProfile::getComponentVersion(const QString& uid) const
992{

Callers 14

installMethod · 0.80
installMethod · 0.80
foreachFunction · 0.80
runMethod · 0.80
createInstanceMethod · 0.80
installMethod · 0.80
createInstanceMethod · 0.80

Calls 5

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

Tested by

no test coverage detected