3DS, PSP2, Wii: Last directory loaded is saved

This commit is contained in:
Jeffrey Pfau 2016-12-20 01:49:12 -08:00
parent 20f8cdc3e0
commit 5ba2d00504
2 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,7 @@ Misc:
- 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:

View File

@ -171,6 +171,12 @@ void mGUIInit(struct mGUIRunner* runner, const char* port) {
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 @@ void mGUIRunloop(struct mGUIRunner* runner) {
if (!GUISelectFile(&runner->params, path, sizeof(path), 0)) {
break;
}
mCoreConfigSetValue(&runner->config, "lastDirectory", runner->params.currentPath);
mCoreConfigSave(&runner->config);
mGUIRun(runner, path);
}
}