From daac1985c1ad0992ce3f60355ac117a24c01a9ce Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 7 Jun 2020 15:52:26 -0700 Subject: [PATCH] Qt: Show a warning when save file can't be opened --- CHANGES | 1 + src/gba/gba.c | 2 +- src/platform/qt/CoreManager.cpp | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 0ed2cb5b9..b43829bff 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Misc: - Qt: Disable Replace ROM option when no game loaded - Qt: Defer texture updates until frame is drawn (fixes mgba.io/i/1590) - Qt: Set icon for Discord Rich Presence + - Qt: Show a warning when save file can't be opened 0.8.1: (2020-02-16) Emulation fixes: diff --git a/src/gba/gba.c b/src/gba/gba.c index c399ac57c..43fe7cc26 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -433,7 +433,7 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) { bool GBALoadSave(struct GBA* gba, struct VFile* sav) { GBASavedataInit(&gba->memory.savedata, sav); - return true; + return sav; } void GBAYankROM(struct GBA* gba) { diff --git a/src/platform/qt/CoreManager.cpp b/src/platform/qt/CoreManager.cpp index 6b2a64f09..cdf38f1c9 100644 --- a/src/platform/qt/CoreManager.cpp +++ b/src/platform/qt/CoreManager.cpp @@ -109,7 +109,9 @@ CoreController* CoreManager::loadGame(VFile* vf, const QString& path, const QStr } bytes = info.dir().canonicalPath().toUtf8(); mDirectorySetAttachBase(&core->dirs, VDirOpen(bytes.constData())); - mCoreAutoloadSave(core); + if (!mCoreAutoloadSave(core)) { + LOG(QT, ERROR) << tr("Failed to open save file. Is the save directory writable?"); + } mCoreAutoloadCheats(core); CoreController* cc = new CoreController(core);