]> granicus.if.org Git - transmission/commitdiff
fix last activity display in qt client
authorDaniel Lee <Longinus00@gmail.com>
Tue, 14 Sep 2010 04:08:24 +0000 (04:08 +0000)
committerDaniel Lee <Longinus00@gmail.com>
Tue, 14 Sep 2010 04:08:24 +0000 (04:08 +0000)
qt/details.cc

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