Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
b7cb16da
Commit
b7cb16da
authored
Feb 09, 2015
by
Zach
Browse files
Merge pull request #713 from poixen/sepc_info
Spectator viewing options
parents
08f8c99c
616f8439
Changes
1
Show whitespace changes
Inline
Side-by-side
cockatrice/src/gamesmodel.cpp
View file @
b7cb16da
...
...
@@ -172,8 +172,18 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
case
SPECTATORS
:
switch
(
role
)
{
case
SORT_ROLE
:
case
Qt
::
DisplayRole
:
return
g
.
spectators_allowed
()
?
QVariant
(
g
.
spectators_count
())
:
QVariant
(
tr
(
"not allowed"
));
case
Qt
::
DisplayRole
:
{
if
(
g
.
spectators_allowed
())
{
QString
result
;
result
.
append
(
QString
::
number
(
g
.
spectators_count
()));
if
(
g
.
spectators_can_chat
())
result
.
append
(
", "
).
append
(
tr
(
"chat"
));
if
(
g
.
spectators_omniscient
())
result
.
append
(
", "
).
append
(
tr
(
"see everything"
));
return
result
;
}
return
QVariant
(
tr
(
"not allowed"
));
}
case
Qt
::
TextAlignmentRole
:
return
Qt
::
AlignLeft
;
default:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment