From e74ce8b17c1a251f5c9ed3877b965342c7abbfca Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:44:10 +0200 Subject: [PATCH] Always append .json for export state on Windows --- src/poptracker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/poptracker.cpp b/src/poptracker.cpp index baad3ff7..3fc4ac4b 100644 --- a/src/poptracker.cpp +++ b/src/poptracker.cpp @@ -645,6 +645,10 @@ bool PopTracker::start() std::string filename; if (!Dlg::SaveFile("Save State", lastName.c_str(), {{"JSON Files",{"*.json"}}}, filename)) return; +#ifdef _WIN32 // windows does not add *.* filter, so we can be sure json was selected + if (filename.length() < 5 || strcasecmp(filename.c_str() + filename.length() - 5, ".JSON") != 0) + filename += ",json"; +#endif auto jWindow = windowToJson(_win); json extra = { {"at_uri", _atUri},