diff options
| -rw-r--r-- | src/yuzu/game_list_p.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 4f7e1ab37..039c7dc67 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <atomic> | 8 | #include <atomic> |
| 8 | #include <utility> | 9 | #include <utility> |
| 9 | #include <QImage> | 10 | #include <QImage> |
| @@ -39,6 +40,7 @@ public: | |||
| 39 | * If this class receives valid SMDH data, it will also display game icons and titles. | 40 | * If this class receives valid SMDH data, it will also display game icons and titles. |
| 40 | */ | 41 | */ |
| 41 | class GameListItemPath : public GameListItem { | 42 | class GameListItemPath : public GameListItem { |
| 43 | |||
| 42 | public: | 44 | public: |
| 43 | static const int FullPathRole = Qt::UserRole + 1; | 45 | static const int FullPathRole = Qt::UserRole + 1; |
| 44 | static const int TitleRole = Qt::UserRole + 2; | 46 | static const int TitleRole = Qt::UserRole + 2; |
| @@ -68,17 +70,16 @@ public: | |||
| 68 | std::string filename; | 70 | std::string filename; |
| 69 | Common::SplitPath(data(FullPathRole).toString().toStdString(), nullptr, &filename, | 71 | Common::SplitPath(data(FullPathRole).toString().toStdString(), nullptr, &filename, |
| 70 | nullptr); | 72 | nullptr); |
| 71 | QString title = data(TitleRole).toString(); | ||
| 72 | 73 | ||
| 73 | std::vector<QString> row_data{ | 74 | const std::array<QString, 4> row_data{{ |
| 74 | QString::fromStdString(filename), | 75 | QString::fromStdString(filename), |
| 75 | data(FileTypeRole).toString(), | 76 | data(FileTypeRole).toString(), |
| 76 | QString::fromStdString(fmt::format("0x{:016X}", data(ProgramIdRole).toULongLong())), | 77 | QString::fromStdString(fmt::format("0x{:016X}", data(ProgramIdRole).toULongLong())), |
| 77 | data(TitleRole).toString(), | 78 | data(TitleRole).toString(), |
| 78 | }; | 79 | }}; |
| 79 | 80 | ||
| 80 | auto row1 = row_data.at(UISettings::values.row_1_text_id); | 81 | const auto& row1 = row_data.at(UISettings::values.row_1_text_id); |
| 81 | auto row2 = row_data.at(UISettings::values.row_2_text_id); | 82 | const auto& row2 = row_data.at(UISettings::values.row_2_text_id); |
| 82 | 83 | ||
| 83 | if (row1.isEmpty() || row1 == row2) | 84 | if (row1.isEmpty() || row1 == row2) |
| 84 | return row2; | 85 | return row2; |
| @@ -86,9 +87,9 @@ public: | |||
| 86 | return row1; | 87 | return row1; |
| 87 | 88 | ||
| 88 | return row1 + "\n " + row2; | 89 | return row1 + "\n " + row2; |
| 89 | } else { | ||
| 90 | return GameListItem::data(role); | ||
| 91 | } | 90 | } |
| 91 | |||
| 92 | return GameListItem::data(role); | ||
| 92 | } | 93 | } |
| 93 | }; | 94 | }; |
| 94 | 95 | ||