void fileAdded(File const &file, FileIndex const &) { GameStateFolder const &saveFolder = file.as<GameStateFolder>(); if (shouldAddFolder(saveFolder)) { mainCall.enqueue([this, &saveFolder] () { // Needs to be added. self().append(new SaveItem(saveFolder)); }); } }
void fileRemoved(File const &, FileIndex const &) { // Remove obsolete entries. mainCall.enqueue([this] () { for (ui::Data::Pos idx = self().size() - 1; idx < self().size(); --idx) { if (!self().at(idx).isValid()) { self().remove(idx); } } }); }