Allow translations and custom names in GameFile::GetNetPlayName

There is no longer any major reason for why this function would
need to return the same result for all players.
This commit is contained in:
JosJuice
2020-06-10 18:49:22 +02:00
parent a41166bb37
commit 5cad82137d
10 changed files with 25 additions and 13 deletions

View File

@ -743,6 +743,11 @@ GameList::FindSecondDisc(const UICommon::GameFile& game) const
return m_model->FindSecondDisc(game);
}
std::string GameList::GetNetPlayName(const UICommon::GameFile& game) const
{
return m_model->GetNetPlayName(game);
}
void GameList::SetViewColumn(int col, bool view)
{
m_list->setColumnHidden(col, !view);

View File

@ -32,6 +32,7 @@ public:
bool HasMultipleSelected() const;
std::shared_ptr<const UICommon::GameFile> FindGame(const std::string& path) const;
std::shared_ptr<const UICommon::GameFile> FindSecondDisc(const UICommon::GameFile& game) const;
std::string GetNetPlayName(const UICommon::GameFile& game) const;
void SetListView() { SetPreferredView(true); }
void SetGridView() { SetPreferredView(false); }

View File

@ -313,6 +313,11 @@ std::shared_ptr<const UICommon::GameFile> GameListModel::GetGameFile(int index)
return m_games[index];
}
std::string GameListModel::GetNetPlayName(const UICommon::GameFile& game) const
{
return game.GetNetPlayName(m_title_database);
}
void GameListModel::AddGame(const std::shared_ptr<const UICommon::GameFile>& game)
{
beginInsertRows(QModelIndex(), m_games.size(), m_games.size());

View File

@ -37,6 +37,7 @@ public:
int columnCount(const QModelIndex& parent) const override;
std::shared_ptr<const UICommon::GameFile> GetGameFile(int index) const;
std::string GetNetPlayName(const UICommon::GameFile& game) const;
bool ShouldDisplayGameListItem(int index) const;
void SetSearchTerm(const QString& term);