From 517a8262a64bae9e151e02544605603d88b6a724 Mon Sep 17 00:00:00 2001 From: shweet Date: Tue, 11 Nov 2025 19:00:00 -0500 Subject: [PATCH] few more windows issues --- src/dialog.cpp | 12 +++--------- src/document.cpp | 2 +- src/imgui/taskbar.cpp | 6 +++--- src/manager.cpp | 4 ++-- src/util/string_.h | 1 + 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/dialog.cpp b/src/dialog.cpp index c46d064..2b29b95 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -1,7 +1,7 @@ #include "dialog.h" #ifdef _WIN32 - #include + #include #elif __unix__ #else #include "toast.h" @@ -67,15 +67,9 @@ namespace anm2ed #endif } - void Dialog::reset() - { - *this = Dialog(this->window); - } + void Dialog::reset() { *this = Dialog(this->window); } - bool Dialog::is_selected(dialog::Type type) - { - return this->type == type && !path.empty(); - } + bool Dialog::is_selected(dialog::Type type) { return this->type == type && !path.empty(); } void Dialog::set_string_to_selected_path(std::string& string, dialog::Type type) { diff --git a/src/document.cpp b/src/document.cpp index 48e5800..392b086 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -102,7 +102,7 @@ namespace anm2ed bool Document::autosave(std::string* errorString) { auto autosavePath = autosave_path_get(); - if (anm2.serialize(autosavePath, errorString)) + if (anm2.serialize(autosavePath.string(), errorString)) { autosaveHash = hash; lastAutosaveTime = 0.0f; diff --git a/src/imgui/taskbar.cpp b/src/imgui/taskbar.cpp index c7e3bf2..9ea518e 100644 --- a/src/imgui/taskbar.cpp +++ b/src/imgui/taskbar.cpp @@ -50,7 +50,7 @@ namespace anm2ed::imgui auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string()); ImGui::PushID(i); - if (ImGui::MenuItem(label.c_str())) manager.open(file); + if (ImGui::MenuItem(label.c_str())) manager.open(file.string()); ImGui::PopID(); } @@ -68,8 +68,8 @@ namespace anm2ed::imgui if (ImGui::MenuItem("Save As", settings.shortcutSaveAs.c_str(), false, document)) dialog.file_save(dialog::ANM2_SAVE); - if (ImGui::MenuItem("Explore XML Location", nullptr, false, document)) - dialog.file_explorer_open(document->directory_get().string()); + if (ImGui::MenuItem("Explore XML Location", nullptr, false, document)) + dialog.file_explorer_open(document->directory_get().string()); ImGui::Separator(); if (ImGui::MenuItem("Exit", settings.shortcutExit.c_str())) isQuitting = true; diff --git a/src/manager.cpp b/src/manager.cpp index 2588884..dba9244 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -54,8 +54,8 @@ namespace anm2ed { std::string errorString{}; document->path = !path.empty() ? path : document->path.string(); - document->save(document->path, &errorString); - recent_file_add(document->path); + document->save(document->path.string(), &errorString); + recent_file_add(document->path.string()); } } diff --git a/src/util/string_.h b/src/util/string_.h index c76668f..968656c 100644 --- a/src/util/string_.h +++ b/src/util/string_.h @@ -6,5 +6,6 @@ namespace anm2ed::util::string { std::string to_lower(const std::string&); std::string backslash_replace(const std::string&); + std::string quote(const std::string&); bool to_bool(const std::string&); }