MCPcopy Create free account
hub / github.com/clementgallet/libTAS / loadSettings

Method loadSettings

src/program/ui/RamWatchModel.cpp:262–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void RamWatchModel::loadSettings(QSettings& watchSettings)
263{
264 beginResetModel();
265
266 int size = watchSettings.beginReadArray("watches");
267 ramwatches.clear();
268 for (int i = 0; i < size; ++i) {
269 watchSettings.setArrayIndex(i);
270
271 std::unique_ptr<RamWatchDetailed> ramwatch;
272 int type = watchSettings.value("type").toInt();
273 uintptr_t addr = watchSettings.value("address").toULongLong();
274
275 /* Build the ram watch using the right type as template */
276 ramwatch.reset(new RamWatchDetailed(addr, type));
277
278 ramwatch->label = watchSettings.value("label").toString().toStdString();
279 ramwatch->hex = watchSettings.value("hex").toBool();
280 ramwatch->is_pointer = watchSettings.value("isPointer").toBool();
281 if (ramwatch->is_pointer) {
282 ramwatch->base_address = 0;
283 ramwatch->base_file = watchSettings.value("base_file").toString().toStdString();
284 ramwatch->base_file_offset = watchSettings.value("base_file_offset").toLongLong();
285 int size_off = watchSettings.beginReadArray("offsets");
286 for (int j = 0; j < size_off; ++j) {
287 watchSettings.setArrayIndex(j);
288 ramwatch->pointer_offsets.push_back(watchSettings.value("offset").toInt());
289 }
290 watchSettings.endArray();
291 }
292 ramwatches.push_back(std::move(ramwatch));
293 }
294 watchSettings.endArray();
295
296 endResetModel();
297}
298
299void RamWatchModel::update()
300{

Callers 1

slotLoadMethod · 0.80

Calls 3

valueMethod · 0.80
clearMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected