1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-20 13:16:53 +00:00

fix last activity display in qt client

This commit is contained in:
Daniel Lee 2010-09-14 04:08:24 +00:00
parent 0e2dd87c08
commit 0046f49fb5

View file

@ -499,8 +499,10 @@ Details :: refresh( )
if( latest < dt ) if( latest < dt )
latest = dt; latest = dt;
} }
const int seconds = latest.secsTo( qdt_now ); const int seconds = latest.isValid() ? latest.secsTo( qdt_now ) : -1;
if( seconds < 5 ) if( seconds < 0 )
string = none;
else if( seconds < 5 )
string = tr( "Active now" ); string = tr( "Active now" );
else else
string = tr( "%1 ago" ).arg( Formatter::timeToString( seconds ) ); string = tr( "%1 ago" ).arg( Formatter::timeToString( seconds ) );