Fixed an issue where the gamelist would sometimes not reload after media files updates.

This commit is contained in:
Leon Styhre 2020-09-27 11:41:53 +02:00
parent 90f5d7fad4
commit c00374419b

View file

@ -455,12 +455,21 @@ void GuiMetaDataEd::close()
std::function<void()> closeFunc; std::function<void()> closeFunc;
closeFunc = [this] { delete this; }; closeFunc = [this] { delete this; };
std::function<void()> closeFuncReload;
closeFuncReload = [this] {
// Always reload the gamelist if media files were updated, even if the user
// selected to not save any metadata changes.
if (mMediaFilesUpdated)
ViewController::get()->reloadGameListView(mScraperParams.system);
delete this;
};
if (metadataUpdated) { if (metadataUpdated) {
// Changes were made, ask if the user wants to save them. // Changes were made, ask if the user wants to save them.
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(), mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
"SAVE CHANGES?", "SAVE CHANGES?",
"YES", [this, closeFunc] { save(); closeFunc(); }, "YES", [this, closeFunc] { save(); closeFunc(); },
"NO", closeFunc "NO", closeFuncReload
)); ));
} }
else { else {