mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Reduce data dependency for GamesProxyModel
This commit is contained in:
parent
d65a444ac5
commit
c5aa75d4d1
3 changed files with 7 additions and 6 deletions
|
|
@ -225,9 +225,9 @@ void GamesModel::updateGameList(const ServerInfo_Game &game)
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent, ServerInfo_User *_ownUser)
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent, bool _ownUserIsRegistered)
|
||||
: QSortFilterProxyModel(parent),
|
||||
ownUser(_ownUser),
|
||||
ownUserIsRegistered(_ownUserIsRegistered),
|
||||
showBuddiesOnlyGames(false),
|
||||
unavailableGamesVisible(false),
|
||||
showPasswordProtectedGames(true),
|
||||
|
|
@ -348,7 +348,7 @@ bool GamesProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &/*sourc
|
|||
return false;
|
||||
if (game.started())
|
||||
return false;
|
||||
if (!(ownUser->user_level() & ServerInfo_User::IsRegistered))
|
||||
if (!ownUserIsRegistered)
|
||||
if (game.only_registered())
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue