Skip to content

Commit

Permalink
Fixed|Time|libcore: Missing conversion of Time to text
Browse files Browse the repository at this point in the history
Previously it was only possible to convert a high-performance time
to text using the BuildNumberAndSecondsSinceStart format.
  • Loading branch information
skyjake committed May 6, 2015
1 parent 6262c69 commit 16b8802
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions doomsday/sdk/libcore/src/data/time.cpp
Expand Up @@ -313,11 +313,17 @@ String Time::asText(Format format) const
}
else if(format == BuildNumberAndSecondsSinceStart)
{
DENG2_ASSERT(d->flags & Instance::HighPerformance);

TimeDelta const elapsed = d->highPerfElapsed;
TimeDelta elapsed;
if(d->flags.testFlag(Instance::HighPerformance))
{
elapsed = d->highPerfElapsed;
}
else if(d->flags.testFlag(Instance::DateTime))
{
elapsed = highPerfTimer.startedAt().deltaTo(Time(d->dateTime));
}
int hours = elapsed.asHours();
double sec = elapsed - hours * 3600.0;
TimeDelta sec = elapsed - hours * 3600.0;
if(hours > 0)
{
return QString("#%1 %2h%3")
Expand Down

0 comments on commit 16b8802

Please sign in to comment.