diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index 04bb7a0ac..a15ce0626 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -403,8 +403,7 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection CollectionFileData* newGame = new CollectionFileData(file, curSys); rootFolder->addChild(newGame); fileIndex->addToIndex(newGame); - ViewController::get()-> - getGameListView(curSys)->onFileChanged(newGame, false); + ViewController::get()->getGameListView(curSys)->onFileChanged(newGame, false); } } @@ -699,7 +698,8 @@ bool CollectionSystemsManager::toggleGameInCollection(FileData* file) saveCustomCollection(sysData); } else { - file->getSourceFileData()->getSystem()->getIndex()->removeFromIndex(file); + file->getSourceFileData()->getSystem()->getIndex()->removeFromIndex( + file->getSourceFileData()); MetaDataList* md = &file->getSourceFileData()->metadata; std::string value = md->get("favorite"); if (value == "false") { @@ -710,13 +710,13 @@ bool CollectionSystemsManager::toggleGameInCollection(FileData* file) md->set("favorite", "false"); } - file->getSourceFileData()->getSystem()->getIndex()->addToIndex(file); + file->getSourceFileData()->getSystem()->getIndex()->addToIndex( + file->getSourceFileData()); file->getSourceFileData()->getSystem()->onMetaDataSavePoint(); refreshCollectionSystems(file->getSourceFileData()); if (mAutoCollectionSystemsData["favorites"].isEnabled) ViewController::get()-> reloadGameListView(mAutoCollectionSystemsData["favorites"].system); - } if (adding) s = new GuiInfoPopup(mWindow, "ADDED '" + diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index daa631433..fadfba3a2 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -69,9 +69,6 @@ FileData::FileData( FileData::~FileData() { - if (mType == GAME) - mSystem->getIndex()->removeFromIndex(this); - while (mChildren.size() > 0) delete (mChildren.front());