mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
GameListModel: make UpdateGame update existing files as well
This commit is contained in:
@ -204,15 +204,18 @@ void GameListModel::UpdateGame(QSharedPointer<GameFile> game)
|
|||||||
{
|
{
|
||||||
QString path = game->GetFilePath();
|
QString path = game->GetFilePath();
|
||||||
|
|
||||||
int entry = FindGame(path);
|
int index = FindGame(path);
|
||||||
if (entry < 0)
|
if (index < 0)
|
||||||
entry = m_games.size();
|
{
|
||||||
else
|
beginInsertRows(QModelIndex(), m_games.size(), m_games.size());
|
||||||
return;
|
m_games.push_back(game);
|
||||||
|
|
||||||
beginInsertRows(QModelIndex(), entry, entry);
|
|
||||||
m_games.insert(entry, game);
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_games[index] = game;
|
||||||
|
emit dataChanged(createIndex(index, 0), createIndex(index + 1, columnCount(QModelIndex())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameListModel::RemoveGame(const QString& path)
|
void GameListModel::RemoveGame(const QString& path)
|
||||||
|
Reference in New Issue
Block a user