diff options
| author | 2018-10-24 11:25:55 -0400 | |
|---|---|---|
| committer | 2018-10-24 11:27:35 -0400 | |
| commit | 1edf8660bc75381882cb24cad05e398e8854742d (patch) | |
| tree | 6118916985866e53a17de26576a4122526345569 | |
| parent | Merge pull request #1468 from DarkLordZach/profile-manager-ui (diff) | |
| download | yuzu-1edf8660bc75381882cb24cad05e398e8854742d.tar.gz yuzu-1edf8660bc75381882cb24cad05e398e8854742d.tar.xz yuzu-1edf8660bc75381882cb24cad05e398e8854742d.zip | |
game_list_worker: Use QString's formatting instead of fmt in FormatPatchNameVersions()
Using fmt here requires unnecessary string conversions back into
QString. Instead, we can just use QString's formatting and get the end
result of the formatting operation in the proper type.
| -rw-r--r-- | src/yuzu/game_list_worker.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 3881aba5f..3d865a12d 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp | |||
| @@ -62,19 +62,24 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager, | |||
| 62 | FileSys::VirtualFile update_raw; | 62 | FileSys::VirtualFile update_raw; |
| 63 | loader.ReadUpdateRaw(update_raw); | 63 | loader.ReadUpdateRaw(update_raw); |
| 64 | for (const auto& kv : patch_manager.GetPatchVersionNames(update_raw)) { | 64 | for (const auto& kv : patch_manager.GetPatchVersionNames(update_raw)) { |
| 65 | if (!updatable && kv.first == "Update") | 65 | const bool is_update = kv.first == "Update"; |
| 66 | if (!updatable && is_update) { | ||
| 66 | continue; | 67 | continue; |
| 68 | } | ||
| 69 | |||
| 70 | const QString type = QString::fromStdString(kv.first); | ||
| 67 | 71 | ||
| 68 | if (kv.second.empty()) { | 72 | if (kv.second.empty()) { |
| 69 | out.append(fmt::format("{}\n", kv.first).c_str()); | 73 | out.append(QStringLiteral("%1\n").arg(type)); |
| 70 | } else { | 74 | } else { |
| 71 | auto ver = kv.second; | 75 | auto ver = kv.second; |
| 72 | 76 | ||
| 73 | // Display container name for packed updates | 77 | // Display container name for packed updates |
| 74 | if (ver == "PACKED" && kv.first == "Update") | 78 | if (is_update && ver == "PACKED") { |
| 75 | ver = Loader::GetFileTypeString(loader.GetFileType()); | 79 | ver = Loader::GetFileTypeString(loader.GetFileType()); |
| 80 | } | ||
| 76 | 81 | ||
| 77 | out.append(fmt::format("{} ({})\n", kv.first, ver).c_str()); | 82 | out.append(QStringLiteral("%1 (%2)\n").arg(type, QString::fromStdString(ver))); |
| 78 | } | 83 | } |
| 79 | } | 84 | } |
| 80 | 85 | ||