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

Function setData

launcher/ui/pages/instance/ScreenshotsPage.cpp:183–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 return sourceModel()->data(mapToSource(proxyIndex), role);
182 }
183 virtual bool setData(const QModelIndex &index, const QVariant &value,
184 int role = Qt::EditRole)
185 {
186 auto model = sourceModel();
187 if (!model)
188 return false;
189 if (role != Qt::EditRole)
190 return false;
191 // FIXME: this is a workaround for a bug in QFileSystemModel, where it doesn't
192 // sort after renames
193 {
194 ((QFileSystemModel *)model)->setNameFilterDisables(true);
195 ((QFileSystemModel *)model)->setNameFilterDisables(false);
196 }
197 return model->setData(mapToSource(index), value.toString() + ".png", role);
198 }
199
200private:
201 void thumbnailImage(QString path)

Callers 3

infoRequestFinishedMethod · 0.85
mergeMethod · 0.85

Calls 2

setDataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected