refactor: Restructure file dialog handling and introduce utility classes

- Updated file dialog references across the application to utilize a new `util::FileDialogWrapper` for consistent file handling.
- Refactored existing code to replace direct calls to `core::FileDialogWrapper` with the new utility class, enhancing modularity and maintainability.
- Introduced `util::PlatformPaths` for cross-platform directory management, ensuring consistent access to user directories and application data paths.
- Added new utility functions for file operations, improving the overall file handling capabilities within the application.
- Updated CMake configurations to include new utility source files, streamlining the build process.
This commit is contained in:
scawful
2025-10-04 23:26:42 -04:00
parent 429506e503
commit bcc8f8e8f9
39 changed files with 385 additions and 144 deletions

View File

@@ -11,11 +11,11 @@
#include "absl/debugging/failure_signal_handler.h"
#include "absl/debugging/symbolize.h"
#include "absl/status/status.h"
#include "app/core/platform/sdl_deleter.h"
#include "util/sdl_deleter.h"
#include "app/emu/snes.h"
#include "app/rom.h"
using yaze::core::SDL_Deleter;
using yaze::util::SDL_Deleter;
int main(int argc, char **argv) {
absl::InitializeSymbolizer(argv[0]);

View File

@@ -4,7 +4,7 @@
#include <fstream>
#include <vector>
#include "app/core/platform/file_dialog.h"
#include "util/file_util.h"
#include "app/core/window.h"
#include "app/emu/cpu/internal/opcodes.h"
#include "app/gui/icons.h"
@@ -316,7 +316,7 @@ void Emulator::RenderNavBar() {
}
if (open_file) {
auto file_name = core::FileDialogWrapper::ShowOpenFileDialog();
auto file_name = util::FileDialogWrapper::ShowOpenFileDialog();
if (!file_name.empty()) {
std::ifstream file(file_name, std::ios::binary);
// Load the data directly into rom_data