From ffb88a2902d765b931e21a3bbb236a621ec34b7d Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 26 Sep 2025 12:57:44 -0400 Subject: [PATCH] Refactor platform initialization in GetConfigDirectory function - Simplified platform variable initialization by removing redundant declarations and ensuring a default case for macOS. - Improved code clarity and maintainability in the GetConfigDirectory function. --- src/app/core/platform/file_dialog.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/core/platform/file_dialog.cc b/src/app/core/platform/file_dialog.cc index 6a424c07..077de22e 100644 --- a/src/app/core/platform/file_dialog.cc +++ b/src/app/core/platform/file_dialog.cc @@ -80,18 +80,21 @@ void SaveFile(const std::string &filename, const std::string &contents) { std::string GetConfigDirectory() { std::string config_directory = ".yaze"; + Platform platform; #if defined(__APPLE__) && defined(__MACH__) #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1 - Platform platform = Platform::kiOS; + platform = Platform::kiOS; #elif TARGET_OS_MAC == 1 - Platform platform = Platform::kMacOS; + platform = Platform::kMacOS; +#else + platform = Platform::kMacOS; // Default for macOS #endif #elif defined(_WIN32) - Platform platform = Platform::kWindows; + platform = Platform::kWindows; #elif defined(__linux__) - Platform platform = Platform::kLinux; + platform = Platform::kLinux; #else - Platform platform = Platform::kUnknown; + platform = Platform::kUnknown; #endif switch (platform) { case Platform::kWindows: