mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Filter registered-only games as unavailable when user isn't regged
This commit is contained in:
parent
eebc615c1c
commit
edd429d874
6 changed files with 17 additions and 10 deletions
|
|
@ -106,8 +106,8 @@ void GamesModel::updateGameList(ServerInfo_Game *_game)
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent), unjoinableGamesVisible(false)
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent, ServerInfo_User *_ownUser)
|
||||
: QSortFilterProxyModel(parent), ownUser(_ownUser), unjoinableGamesVisible(false)
|
||||
{
|
||||
setDynamicSortFilter(true);
|
||||
}
|
||||
|
|
@ -130,6 +130,9 @@ bool GamesProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &/*sourc
|
|||
return false;
|
||||
if (game->getStarted())
|
||||
return false;
|
||||
if (!(ownUser->getUserLevel() & ServerInfo_User::IsRegistered))
|
||||
if (game->getOnlyRegistered())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue