yuzu-emu
/
yuzu
Archived
1
0
Fork 0

main: Use Common::U16StringFromBuffer

See ffd3afcf2
This commit is contained in:
lat9nq 2022-05-15 18:09:19 -04:00
parent f7908eebb9
commit 3ca3254b9f
1 changed files with 4 additions and 2 deletions

View File

@ -1401,7 +1401,8 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
if (loader != nullptr && loader->ReadProgramId(title_id) == Loader::ResultStatus::Success && if (loader != nullptr && loader->ReadProgramId(title_id) == Loader::ResultStatus::Success &&
type == StartGameType::Normal) { type == StartGameType::Normal) {
// Load per game settings // Load per game settings
const auto file_path = std::filesystem::path{filename.toStdU16String()}; const auto file_path =
std::filesystem::path{Common::U16StringFromBuffer(filename.utf16(), filename.size())};
const auto config_file_name = title_id == 0 const auto config_file_name = title_id == 0
? Common::FS::PathToUTF8String(file_path.filename()) ? Common::FS::PathToUTF8String(file_path.filename())
: fmt::format("{:016X}", title_id); : fmt::format("{:016X}", title_id);
@ -1482,7 +1483,8 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
} }
if (res != Loader::ResultStatus::Success || title_name.empty()) { if (res != Loader::ResultStatus::Success || title_name.empty()) {
title_name = Common::FS::PathToUTF8String( title_name = Common::FS::PathToUTF8String(
std::filesystem::path{filename.toStdU16String()}.filename()); std::filesystem::path{Common::U16StringFromBuffer(filename.utf16(), filename.size())}
.filename());
} }
const bool is_64bit = system->Kernel().CurrentProcess()->Is64BitProcess(); const bool is_64bit = system->Kernel().CurrentProcess()->Is64BitProcess();
const auto instruction_set_suffix = is_64bit ? tr("(64-bit)") : tr("(32-bit)"); const auto instruction_set_suffix = is_64bit ? tr("(64-bit)") : tr("(32-bit)");