diff options
| author | 2018-09-17 09:47:54 -0400 | |
|---|---|---|
| committer | 2018-09-17 09:47:54 -0400 | |
| commit | e833301e4caeddfc0147f1bf18a8c7a477a50f5a (patch) | |
| tree | 2e187284d50826a27269665b9d856dad47165b38 /src | |
| parent | Merge pull request #1336 from lioncash/antialias (diff) | |
| parent | game_list_p: Amend typo in GameListItemCompat's constructor parameter (diff) | |
| download | yuzu-e833301e4caeddfc0147f1bf18a8c7a477a50f5a.tar.gz yuzu-e833301e4caeddfc0147f1bf18a8c7a477a50f5a.tar.xz yuzu-e833301e4caeddfc0147f1bf18a8c7a477a50f5a.zip | |
Merge pull request #1335 from lioncash/copy
game_list_p: Take map iterator contents by const reference
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/game_list_p.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index f22e422e5..b6272d536 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -106,7 +106,7 @@ class GameListItemCompat : public GameListItem { | |||
| 106 | public: | 106 | public: |
| 107 | static const int CompatNumberRole = Qt::UserRole + 1; | 107 | static const int CompatNumberRole = Qt::UserRole + 1; |
| 108 | GameListItemCompat() = default; | 108 | GameListItemCompat() = default; |
| 109 | explicit GameListItemCompat(const QString& compatiblity) { | 109 | explicit GameListItemCompat(const QString& compatibility) { |
| 110 | struct CompatStatus { | 110 | struct CompatStatus { |
| 111 | QString color; | 111 | QString color; |
| 112 | const char* text; | 112 | const char* text; |
| @@ -123,13 +123,13 @@ public: | |||
| 123 | {"99", {"#000000", QT_TR_NOOP("Not Tested"), QT_TR_NOOP("The game has not yet been tested.")}}}; | 123 | {"99", {"#000000", QT_TR_NOOP("Not Tested"), QT_TR_NOOP("The game has not yet been tested.")}}}; |
| 124 | // clang-format on | 124 | // clang-format on |
| 125 | 125 | ||
| 126 | auto iterator = status_data.find(compatiblity); | 126 | auto iterator = status_data.find(compatibility); |
| 127 | if (iterator == status_data.end()) { | 127 | if (iterator == status_data.end()) { |
| 128 | LOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); | 128 | LOG_WARNING(Frontend, "Invalid compatibility number {}", compatibility.toStdString()); |
| 129 | return; | 129 | return; |
| 130 | } | 130 | } |
| 131 | CompatStatus status = iterator->second; | 131 | const CompatStatus& status = iterator->second; |
| 132 | setData(compatiblity, CompatNumberRole); | 132 | setData(compatibility, CompatNumberRole); |
| 133 | setText(QObject::tr(status.text)); | 133 | setText(QObject::tr(status.text)); |
| 134 | setToolTip(QObject::tr(status.tooltip)); | 134 | setToolTip(QObject::tr(status.tooltip)); |
| 135 | setData(CreateCirclePixmapFromColor(status.color), Qt::DecorationRole); | 135 | setData(CreateCirclePixmapFromColor(status.color), Qt::DecorationRole); |