GameList: Make cover functions const

This commit is contained in:
Connor McLaughlin 2020-11-27 23:56:09 +10:00
parent 38e3b2a28a
commit 3137eb41c4
2 changed files with 4 additions and 4 deletions

View file

@ -1128,7 +1128,7 @@ void GameList::UpdateGameSettings(const std::string& filename, const std::string
m_game_settings.SetEntry(game_code, game_title, new_entry, m_user_game_settings_filename.c_str()); m_game_settings.SetEntry(game_code, game_title, new_entry, m_user_game_settings_filename.c_str());
} }
std::string GameList::GetCoverImagePathForEntry(const GameListEntry* entry) std::string GameList::GetCoverImagePathForEntry(const GameListEntry* entry) const
{ {
static constexpr std::array<const char*, 3> extensions = {{"jpg", "jpeg", "png"}}; static constexpr std::array<const char*, 3> extensions = {{"jpg", "jpeg", "png"}};
@ -1171,7 +1171,7 @@ std::string GameList::GetCoverImagePathForEntry(const GameListEntry* entry)
return std::string(); return std::string();
} }
std::string GameList::GetNewCoverImagePathForEntry(const GameListEntry* entry, const char* new_filename) std::string GameList::GetNewCoverImagePathForEntry(const GameListEntry* entry, const char* new_filename) const
{ {
const char* extension = std::strrchr(new_filename, '.'); const char* extension = std::strrchr(new_filename, '.');
if (!extension) if (!extension)

View file

@ -100,8 +100,8 @@ public:
void UpdateGameSettings(const std::string& filename, const std::string& game_code, const std::string& game_title, void UpdateGameSettings(const std::string& filename, const std::string& game_code, const std::string& game_title,
const GameSettings::Entry& new_entry, bool save_to_list = true); const GameSettings::Entry& new_entry, bool save_to_list = true);
std::string GetCoverImagePathForEntry(const GameListEntry* entry); std::string GetCoverImagePathForEntry(const GameListEntry* entry) const;
std::string GetNewCoverImagePathForEntry(const GameListEntry* entry, const char* new_filename); std::string GetNewCoverImagePathForEntry(const GameListEntry* entry, const char* new_filename) const;
private: private:
enum : u32 enum : u32