From c488545091bf0cdd57252af4c88fe49e22caf253 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Mon, 16 Jun 2025 22:11:09 -0700 Subject: [PATCH] GameListModel: Update tag list and sorting immediately Emit the dataChanged signal when adding or removing tags from a game. This both updates the contents of the game's Tags column immediately (instead of having to wait for the context menu to be closed), and updates the sorting if games are being sorted by the Tags column. --- Source/Core/DolphinQt/GameList/GameListModel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/Core/DolphinQt/GameList/GameListModel.cpp b/Source/Core/DolphinQt/GameList/GameListModel.cpp index 42a911ce49..34b8c8570f 100644 --- a/Source/Core/DolphinQt/GameList/GameListModel.cpp +++ b/Source/Core/DolphinQt/GameList/GameListModel.cpp @@ -470,6 +470,13 @@ void GameListModel::AddGameTag(const std::string& path, const QString& name) m_game_tags[QString::fromStdString(path)] = tags; Settings::GetQSettings().setValue(QStringLiteral("gamelist/game_tags"), m_game_tags); + + const int row = FindGameIndex(path); + if (row >= 0) + { + const QModelIndex index = createIndex(row, static_cast(Column::Tags)); + emit dataChanged(index, index); + } } void GameListModel::RemoveGameTag(const std::string& path, const QString& name) @@ -481,6 +488,13 @@ void GameListModel::RemoveGameTag(const std::string& path, const QString& name) m_game_tags[QString::fromStdString(path)] = tags; Settings::GetQSettings().setValue(QStringLiteral("gamelist/game_tags"), m_game_tags); + + const int row = FindGameIndex(path); + if (row >= 0) + { + const QModelIndex index = createIndex(row, static_cast(Column::Tags)); + emit dataChanged(index, index); + } } void GameListModel::NewTag(const QString& name)