diff options
| author | bunnei <bunneidev@gmail.com> | 2021-06-02 22:11:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-02 22:11:35 -0700 |
| commit | 5a6d002bf046d0cd3211848ce3288ba01adfbd90 (patch) | |
| tree | 0b3eb6faed20d84d8e5a803ce65f0e27f6ca9856 /src/yuzu/main.cpp | |
| parent | 395cc0c32f5ce15cc324c1e392b7bb7eff24d30e (diff) | |
| parent | c41451af75520a19b050347bb9c267b69773ff0a (diff) | |
Merge pull request #6404 from lat9nq/revert_views
yuzu qt: Revert some usages of string_view
Diffstat (limited to 'src/yuzu/main.cpp')
| -rw-r--r-- | src/yuzu/main.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index dd8dd3233..237e26829 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1334,8 +1334,9 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) { // Load per game settings + const auto file_path = std::filesystem::path{filename.toStdU16String()}; const auto config_file_name = title_id == 0 - ? Common::FS::GetFilename(filename.toStdString()) + ? Common::FS::PathToUTF8String(file_path.filename()) : fmt::format("{:016X}", title_id); Config per_game_config(config_file_name, Config::ConfigType::PerGameConfig); } @@ -1799,7 +1800,7 @@ void GMainWindow::RemoveAddOnContent(u64 program_id, const QString& entry_type) } void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target, - std::string_view game_path) { + const std::string& game_path) { const QString question = [this, target] { switch (target) { case GameListRemoveTarget::ShaderCache: @@ -1846,10 +1847,11 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id) { } } -void GMainWindow::RemoveCustomConfiguration(u64 program_id, std::string_view game_path) { - const auto config_file_name = program_id == 0 - ? fmt::format("{:s}.ini", Common::FS::GetFilename(game_path)) - : fmt::format("{:016X}.ini", program_id); +void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& game_path) { + const auto file_path = std::filesystem::path(Common::FS::ToU8String(game_path)); + const auto config_file_name = + program_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()).append(".ini") + : fmt::format("{:016X}.ini", program_id); const auto custom_config_file_path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "custom" / config_file_name; |
