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
7aff20b4
Commit
7aff20b4
authored
Nov 17, 2014
by
Mitchell Rosen
Browse files
Fix the build
parent
a3dc403f
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/gamesmodel.cpp
View file @
7aff20b4
...
@@ -23,7 +23,7 @@ namespace {
...
@@ -23,7 +23,7 @@ namespace {
* 24+ hours will return "1+ days ago", because it seems unlikely that we care about
* 24+ hours will return "1+ days ago", because it seems unlikely that we care about
* an accurate timestamp of day old games.
* an accurate timestamp of day old games.
*/
*/
std
::
s
tring
prettyPrintSecsAgo
(
uint32_t
secs
)
{
QS
tring
prettyPrintSecsAgo
(
uint32_t
secs
)
{
std
::
ostringstream
str_stream
;
std
::
ostringstream
str_stream
;
if
(
secs
<
SECS_PER_MIN
)
{
if
(
secs
<
SECS_PER_MIN
)
{
...
@@ -45,7 +45,7 @@ namespace {
...
@@ -45,7 +45,7 @@ namespace {
str_stream
<<
"5+ hours ago"
;
str_stream
<<
"5+ hours ago"
;
}
}
return
tr
(
str_stream
.
str
());
return
QObject
::
tr
(
str_stream
.
str
()
.
c_str
()
);
}
}
}
}
...
@@ -74,7 +74,7 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
...
@@ -74,7 +74,7 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
int
secs
=
now
-
then
;
int
secs
=
now
-
then
;
switch
(
role
)
{
switch
(
role
)
{
case
Qt
::
DisplayRole
:
return
QString
::
fromStdString
(
prettyPrintSecsAgo
(
secs
)
)
;
case
Qt
::
DisplayRole
:
return
prettyPrintSecsAgo
(
secs
);
case
SORT_ROLE
:
return
QVariant
(
secs
);
case
SORT_ROLE
:
return
QVariant
(
secs
);
default:
{
default:
{
qDebug
()
<<
"Returning data for col 1 of games model when role != display, role != sort"
;
qDebug
()
<<
"Returning data for col 1 of games model when role != display, role != sort"
;
...
...
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