Reduce data dependency for GamesProxyModel

This commit is contained in:
Gavin Bisesi 2017-03-17 23:29:42 -04:00 committed by Gavin Bisesi
parent d65a444ac5
commit c5aa75d4d1
3 changed files with 7 additions and 6 deletions

View file

@ -25,7 +25,8 @@ GameSelector::GameSelector(AbstractClient *_client, const TabSupervisor *_tabSup
gameListModel = new GamesModel(_rooms, _gameTypes, this);
if(showfilters)
{
gameListProxyModel = new GamesProxyModel(this, tabSupervisor->getUserInfo());
bool ownUserIsRegistered = (bool)(tabSupervisor->getUserInfo()->user_level() & ServerInfo_User::IsRegistered);
gameListProxyModel = new GamesProxyModel(this, ownUserIsRegistered);
gameListProxyModel->setSourceModel(gameListModel);
gameListProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
gameListView->setModel(gameListProxyModel);