mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-05 17:15:49 +00: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:
parent
2fd74990b7
commit
c488545091
1 changed files with 14 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue