3DS, PSP2, Wii: Last directory loaded is saved
Jeffrey Pfau jeffrey@endrift.com
Tue, 20 Dec 2016 01:49:12 -0800
2 files changed,
9 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -54,6 +54,7 @@ - GBA Memory: Support for Mo Jie Qi Bing by Vast Fame (taizou)
- GBA Memory: Support reading/writing POSTFLG - Util: Add size counting to Table - Qt: Move last directory setting from qt.ini to config.ini + - 3DS, PSP2, Wii: Last directory loaded is saved 0.5.1: (2016-10-05) Bugfixes:
M
src/feature/gui/gui-runner.c
→
src/feature/gui/gui-runner.c
@@ -171,6 +171,12 @@ mCoreConfigDirectory(path, PATH_MAX);
strncat(path, PATH_SEP "log", PATH_MAX - strlen(path)); logger.vf = VFileOpen(path, O_CREAT | O_WRONLY | O_APPEND); mLogSetDefaultLogger(&logger.d); + + const char* lastPath = mCoreConfigGetValue(&runner->config, "lastDirectory"); + if (lastPath) { + strncpy(runner->params.currentPath, lastPath, PATH_MAX - 1); + runner->params.currentPath[PATH_MAX - 1] = '\0'; + } } void mGUIDeinit(struct mGUIRunner* runner) {@@ -499,6 +505,8 @@ char path[PATH_MAX];
if (!GUISelectFile(&runner->params, path, sizeof(path), 0)) { break; } + mCoreConfigSetValue(&runner->config, "lastDirectory", runner->params.currentPath); + mCoreConfigSave(&runner->config); mGUIRun(runner, path); } }