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:
@@ -3,7 +3,7 @@
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/platform/file_dialog.h"
|
||||
#include "util/file_util.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
@@ -165,7 +165,7 @@ absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
|
||||
gfx::Tilemap &tile16_blockset,
|
||||
std::array<gfx::Bitmap, 4> &sheets,
|
||||
std::vector<uint8_t> &gfx_bin_data) {
|
||||
std::string bin_file = core::FileDialogWrapper::ShowOpenFileDialog();
|
||||
std::string bin_file = util::FileDialogWrapper::ShowOpenFileDialog();
|
||||
if (bin_file.empty()) {
|
||||
return absl::InternalError("No file selected");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user