mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-27 17:39:34 -06:00
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.
This commit is contained in:
@ -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<int>(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<int>(Column::Tags));
|
||||
emit dataChanged(index, index);
|
||||
}
|
||||
}
|
||||
|
||||
void GameListModel::NewTag(const QString& name)
|
||||
|
Reference in New Issue
Block a user