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

Method updateGeometries

launcher/ui/instanceview/InstanceView.cpp:162–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void InstanceView::updateGeometries()
163{
164 geometryCache.clear();
165
166 QMap<LocaleString, VisualGroup *> cats;
167
168 for (int i = 0; i < model()->rowCount(); ++i)
169 {
170 const QString groupName = model()->index(i, 0).data(InstanceViewRoles::GroupRole).toString();
171 if (!cats.contains(groupName))
172 {
173 VisualGroup *old = this->category(groupName);
174 if (old)
175 {
176 auto cat = new VisualGroup(old);
177 cats.insert(groupName, cat);
178 cat->update();
179 }
180 else
181 {
182 auto cat = new VisualGroup(groupName, this);
183 if(fVisibility) {
184 cat->collapsed = fVisibility(groupName);
185 }
186 cats.insert(groupName, cat);
187 cat->update();
188 }
189 }
190 }
191
192 qDeleteAll(m_groups);
193 m_groups = cats.values();
194 updateScrollbar();
195 viewport()->update();
196}
197
198bool InstanceView::isIndexHidden(const QModelIndex &index) const
199{

Callers 1

finalizeInstanceMethod · 0.80

Calls 9

categoryMethod · 0.95
insertMethod · 0.80
clearMethod · 0.45
rowCountMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
containsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected