[Base] Removed useless path_to_utf8 conversion while using fmt

Default filesystem::path formatter was added to fmt around 2022
This commit is contained in:
Gliniak
2024-12-13 19:04:31 +01:00
parent 3318ab5d4c
commit a295ec1bbd
18 changed files with 55 additions and 78 deletions

View File

@@ -16,8 +16,6 @@
#include <string>
#include <utility>
#include "third_party/fmt/include/fmt/chrono.h"
#include "third_party/fmt/include/fmt/format.h"
#include "third_party/imgui/imgui.h"
#include "third_party/stb/stb_image_write.h"
#include "third_party/tomlplusplus/toml.hpp"
@@ -986,7 +984,7 @@ void EmulatorWindow::SaveImage(const std::filesystem::path& filepath,
const xe::ui::RawImage& image) {
auto file = std::ofstream(filepath, std::ios::binary);
if (!file.is_open()) {
XELOGE("Failed to open file for writing: {}", xe::path_to_utf8(filepath));
XELOGE("Failed to open file for writing: {}", filepath);
return;
}
@@ -998,7 +996,7 @@ void EmulatorWindow::SaveImage(const std::filesystem::path& filepath,
&file, image.width, image.height, 4, image.data.data(),
(int)image.stride);
if (result == 0) {
XELOGE("Failed to write PNG to file: {}", xe::path_to_utf8(filepath));
XELOGE("Failed to write PNG to file: {}", filepath);
return;
}
}
@@ -1212,12 +1210,11 @@ void EmulatorWindow::ExtractZarchive() {
// delete incomplete output file
std::filesystem::remove(abs_extract_dir, ec);
summary +=
fmt::format("\nFailed: {}", path_to_utf8(zarchive_file_path));
summary += fmt::format("\nFailed: {}", zarchive_file_path);
XELOGE("Failed to extract Zarchive package.", result);
} else {
summary += fmt::format("\nSuccess: {}", path_to_utf8(abs_extract_dir));
summary += fmt::format("\nSuccess: {}", abs_extract_dir);
}
}
@@ -1313,11 +1310,11 @@ void EmulatorWindow::CreateZarchive() {
// delete incomplete output file
std::filesystem::remove(zarchive_file, ec);
summary += fmt::format("\nFailed: {}", path_to_utf8(abs_content_dir));
summary += fmt::format("\nFailed: {}", abs_content_dir);
XELOGE("Failed to create Zarchive package.", result);
} else {
summary += fmt::format("\nSuccess: {}", path_to_utf8(zarchive_file));
summary += fmt::format("\nSuccess: {}", zarchive_file);
}
}
@@ -1962,8 +1959,7 @@ xe::X_STATUS EmulatorWindow::RunTitle(
path_to_file.empty() ? "empty" : "invalid");
if (!path_to_file.empty() && !titleExists) {
log_msg.append(
fmt::format("\nProvided Path: {}", xe::path_to_utf8(path_to_file)));
log_msg.append(fmt::format("\nProvided Path: {}", path_to_file));
}
if (ec) {

View File

@@ -61,8 +61,6 @@
#include "xenia/hid/xinput/xinput_hid.h"
#endif // XE_PLATFORM_WIN32
#include "third_party/fmt/include/fmt/format.h"
DEFINE_string(apu, "any", "Audio system. Use: [any, nop, sdl, xaudio2]", "APU");
DEFINE_string(gpu, "any", "Graphics system. Use: [any, d3d12, vulkan, null]",
"GPU");
@@ -408,7 +406,7 @@ bool EmulatorApp::OnInitialize() {
}
}
storage_root = std::filesystem::absolute(storage_root);
XELOGI("Storage root: {}", xe::path_to_utf8(storage_root));
XELOGI("Storage root: {}", storage_root);
config::SetupConfig(storage_root);
@@ -423,7 +421,7 @@ bool EmulatorApp::OnInitialize() {
}
}
content_root = std::filesystem::absolute(content_root);
XELOGI("Content root: {}", xe::path_to_utf8(content_root));
XELOGI("Content root: {}", content_root);
std::filesystem::path cache_root = cvars::cache_root;
if (cache_root.empty()) {
@@ -438,7 +436,7 @@ bool EmulatorApp::OnInitialize() {
}
}
cache_root = std::filesystem::absolute(cache_root);
XELOGI("Host cache root: {}", xe::path_to_utf8(cache_root));
XELOGI("Host cache root: {}", cache_root);
if (cvars::discord) {
discord::DiscordPresence::Initialize();