Fix user data path on macOS.

This commit is contained in:
squidbus 2024-07-20 03:03:09 -07:00 committed by TheTurtle
parent 225ca3ac5b
commit 43c0f313f2
2 changed files with 38 additions and 10 deletions

View file

@ -18,16 +18,9 @@ int main(int argc, char* argv[]) {
QApplication a(argc, argv);
// Load configurations and initialize Qt application
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::load(config_dir / "config.toml");
QString gameDataPath = QDir::currentPath() + "/user/game_data/";
std::string stdStr = gameDataPath.toStdString();
std::filesystem::path path(stdStr);
#ifdef _WIN64
std::wstring wstdStr = gameDataPath.toStdWString();
path = std::filesystem::path(wstdStr);
#endif
std::filesystem::create_directory(path);
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::load(user_dir / "config.toml");
std::filesystem::create_directory(user_dir / "game_data");
// Check if the game install directory is set
if (Config::getGameInstallDir() == "") {