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

Method insertComponent

launcher/minecraft/PackProfile.cpp:612–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612void PackProfile::insertComponent(size_t index, ComponentPtr component)
613{
614 auto id = component->getID();
615 if(id.isEmpty())
616 {
617 qWarning() << "Attempt to add a component with empty ID!";
618 return;
619 }
620 if(d->componentIndex.contains(id))
621 {
622 qWarning() << "Attempt to add a component that is already present!";
623 return;
624 }
625 beginInsertRows(QModelIndex(), index, index);
626 d->components.insert(index, component);
627 d->componentIndex[id] = component;
628 endInsertRows();
629 connect(component.get(), &Component::dataChanged, this, &PackProfile::componentDataChanged);
630 scheduleSave();
631}
632
633void PackProfile::componentDataChanged()
634{

Callers 1

resolveDependenciesMethod · 0.80

Calls 6

QModelIndexClass · 0.85
getIDMethod · 0.80
isEmptyMethod · 0.80
insertMethod · 0.80
containsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected