summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-11 00:12:26 +0200
committerLioncash <mathew1800@gmail.com>2018-08-11 00:19:40 +0200
commitaaf671a309a65f120190a72af88e3b016025d348 (patch)
tree0d4df55584d5af13b07dcc44af6a3a7100b7c2fc
parentqt/game_list: Remove redundant base class constructor from initializer list (diff)
downloadyuzu-aaf671a309a65f120190a72af88e3b016025d348.tar
yuzu-aaf671a309a65f120190a72af88e3b016025d348.tar.gz
yuzu-aaf671a309a65f120190a72af88e3b016025d348.tar.bz2
yuzu-aaf671a309a65f120190a72af88e3b016025d348.tar.lz
yuzu-aaf671a309a65f120190a72af88e3b016025d348.tar.xz
yuzu-aaf671a309a65f120190a72af88e3b016025d348.tar.zst
yuzu-aaf671a309a65f120190a72af88e3b016025d348.zip
-rw-r--r--src/yuzu/game_list_p.h15
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 @@
#pragma once
+#include <array>
#include <atomic>
#include <utility>
#include <QImage>
@@ -39,6 +40,7 @@ public:
* If this class receives valid SMDH data, it will also display game icons and titles.
*/
class GameListItemPath : public GameListItem {
+
public:
static const int FullPathRole = Qt::UserRole + 1;
static const int TitleRole = Qt::UserRole + 2;
@@ -68,17 +70,16 @@ public:
std::string filename;
Common::SplitPath(data(FullPathRole).toString().toStdString(), nullptr, &filename,
nullptr);
- QString title = data(TitleRole).toString();
- std::vector<QString> row_data{
+ const std::array<QString, 4> row_data{{
QString::fromStdString(filename),
data(FileTypeRole).toString(),
QString::fromStdString(fmt::format("0x{:016X}", data(ProgramIdRole).toULongLong())),
data(TitleRole).toString(),
- };
+ }};
- auto row1 = row_data.at(UISettings::values.row_1_text_id);
- auto row2 = row_data.at(UISettings::values.row_2_text_id);
+ const auto& row1 = row_data.at(UISettings::values.row_1_text_id);
+ const auto& row2 = row_data.at(UISettings::values.row_2_text_id);
if (row1.isEmpty() || row1 == row2)
return row2;
@@ -86,9 +87,9 @@ public:
return row1;
return row1 + "\n " + row2;
- } else {
- return GameListItem::data(role);
}
+
+ return GameListItem::data(role);
}
};