diff options
Diffstat (limited to 'src/frontend/qt_sdl/Platform.cpp')
-rw-r--r-- | src/frontend/qt_sdl/Platform.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp index 7621931..5199254 100644 --- a/src/frontend/qt_sdl/Platform.cpp +++ b/src/frontend/qt_sdl/Platform.cpp @@ -137,9 +137,11 @@ FILE* OpenFile(const char* path, const char* mode, bool mustexist) QIODevice::OpenMode qmode; if (strlen(mode) > 1 && mode[0] == 'r' && mode[1] == '+') { - qmode = QIODevice::OpenModeFlag::ReadWrite; - } else if (mode[0] == 'w') { - qmode = QIODevice::OpenModeFlag::Truncate; + qmode = QIODevice::OpenModeFlag::ReadWrite; + } else if (strlen(mode) > 1 && mode[0] == 'w' && mode[1] == '+') { + qmode = QIODevice::OpenModeFlag::Truncate | QIODevice::OpenModeFlag::ReadWrite; + } else if (mode[0] == 'w') { + qmode = QIODevice::OpenModeFlag::Truncate | QIODevice::OpenModeFlag::WriteOnly; } else { qmode = QIODevice::OpenModeFlag::ReadOnly; } |