mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Chat works!
This commit is contained in:
parent
1baa188067
commit
64aa68cd26
28 changed files with 714 additions and 424 deletions
|
|
@ -1,9 +1,12 @@
|
|||
#include "gamesmodel.h"
|
||||
#include "protocol_datastructures.h"
|
||||
|
||||
GamesModel::~GamesModel()
|
||||
{
|
||||
cleanList();
|
||||
if (!gameList.isEmpty()) {
|
||||
beginRemoveRows(QModelIndex(), 0, gameList.size() - 1);
|
||||
gameList.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
|
||||
QVariant GamesModel::data(const QModelIndex &index, int role) const
|
||||
|
|
@ -69,16 +72,6 @@ void GamesModel::updateGameList(const ServerGameInfo &game)
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
void GamesModel::cleanList()
|
||||
{
|
||||
if (gameList.isEmpty())
|
||||
return;
|
||||
|
||||
beginRemoveRows(QModelIndex(), 0, gameList.size() - 1);
|
||||
gameList.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent), fullGamesVisible(false)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue