Use const where applicable

merge-requests/60/head
Zach Hilman 2018-07-28 12:35:02 +07:00
parent 9e88f03e75
commit 5927cf0e17
4 changed files with 7 additions and 7 deletions

@ -62,7 +62,7 @@ enum class Language : u8 {
Chinese = 14, Chinese = 14,
}; };
static std::array<std::string, 15> LANGUAGE_NAMES = { static constexpr std::array<const char*, 15> LANGUAGE_NAMES = {
"AmericanEnglish", "BritishEnglish", "Japanese", "AmericanEnglish", "BritishEnglish", "Japanese",
"French", "German", "LatinAmericanSpanish", "French", "German", "LatinAmericanSpanish",
"Spanish", "Italian", "Dutch", "Spanish", "Italian", "Dutch",

@ -25,7 +25,7 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys
// Icon // Icon
FileSys::VirtualFile icon_file = nullptr; FileSys::VirtualFile icon_file = nullptr;
for (const auto& language : FileSys::LANGUAGE_NAMES) { for (const auto& language : FileSys::LANGUAGE_NAMES) {
icon_file = dir->GetFile("icon_" + language + ".dat"); icon_file = dir->GetFile("icon_" + std::string(language) + ".dat");
if (icon_file != nullptr) { if (icon_file != nullptr) {
icon_data = icon_file->ReadAllBytes(); icon_data = icon_file->ReadAllBytes();
break; break;

@ -12,9 +12,9 @@ ConfigureGameList::ConfigureGameList(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGameList) { : QWidget(parent), ui(new Ui::ConfigureGameList) {
ui->setupUi(this); ui->setupUi(this);
static std::vector<std::pair<u32, std::string>> default_icon_sizes{ static const std::vector<std::pair<u32, std::string>> default_icon_sizes{
std::make_pair(0, "None"), std::make_pair(24, "Small"), std::make_pair(0, "None"), std::make_pair(32, "Small"),
std::make_pair(48, "Standard"), std::make_pair(96, "Large"), std::make_pair(64, "Standard"), std::make_pair(128, "Large"),
std::make_pair(256, "Full Size"), std::make_pair(256, "Full Size"),
}; };
@ -25,7 +25,7 @@ ConfigureGameList::ConfigureGameList(QWidget* parent)
size.first); size.first);
} }
static std::vector<std::string> row_text_names{ static const std::vector<std::string> row_text_names{
"Filename", "Filename",
"Filetype", "Filetype",
"Title ID", "Title ID",

@ -466,7 +466,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
FileSys::VirtualFile icon_file = nullptr; FileSys::VirtualFile icon_file = nullptr;
for (const auto& language : FileSys::LANGUAGE_NAMES) { for (const auto& language : FileSys::LANGUAGE_NAMES) {
icon_file = control_dir->GetFile("icon_" + language + ".dat"); icon_file = control_dir->GetFile("icon_" + std::string(language) + ".dat");
if (icon_file != nullptr) { if (icon_file != nullptr) {
icon = icon_file->ReadAllBytes(); icon = icon_file->ReadAllBytes();
break; break;