diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/qt_sdl/Platform.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp index ddf48e9..7ce70ab 100644 --- a/src/frontend/qt_sdl/Platform.cpp +++ b/src/frontend/qt_sdl/Platform.cpp @@ -80,10 +80,12 @@ FILE* OpenFile(const char* path, const char* mode, bool mustexist) { QFile f(path); - if (!mustexist && !f.exists()) + if (mustexist && !f.exists()) + { return nullptr; + } - f.open(QIODevice::ReadOnly); + f.open(QIODevice::ReadWrite); FILE* file = fdopen(dup(f.handle()), mode); f.close(); @@ -105,7 +107,9 @@ FILE* OpenLocalFile(const char* path, const char* mode) fullpath = QString("./") + path; #else // Check user configuration directory - fullpath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/melonDS/"; + QDir config(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)); + config.mkdir("melonDS"); + fullpath = config.absolutePath() + "/melonDS/"; fullpath.append(path); #endif } |