diff --git a/qt/torrent-delegate.cc b/qt/torrent-delegate.cc index 9352c5938..9a2b3425a 100644 --- a/qt/torrent-delegate.cc +++ b/qt/torrent-delegate.cc @@ -91,7 +91,7 @@ TorrentDelegate :: progressString( const Torrent& tor ) const str = tr( "%1 of %2 (%3%), uploaded %4 (Ratio: %5 Goal: %6)" ) .arg( Utils::sizeToString( haveTotal ) ) .arg( Utils::sizeToString( tor.totalSize( ) ) ) - .arg( tor.percentDone( ) * 100.0, 0, 'f', 2 ) + .arg( tor.percentComplete( ) * 100.0, 0, 'f', 2 ) .arg( Utils::sizeToString( tor.uploadedEver( ) ) ) .arg( Utils::ratioToString( tor.ratio( ) ) ) .arg( Utils::ratioToString( seedRatio ) ); @@ -106,7 +106,7 @@ TorrentDelegate :: progressString( const Torrent& tor ) const str = tr( "%1 of %2 (%3%), uploaded %4 (Ratio: %5)" ) .arg( Utils::sizeToString( haveTotal ) ) .arg( Utils::sizeToString( tor.totalSize( ) ) ) - .arg( tor.percentDone( ) * 100.0, 0, 'f', 2 ) + .arg( tor.percentComplete( ) * 100.0, 0, 'f', 2 ) .arg( Utils::sizeToString( tor.uploadedEver( ) ) ) .arg( Utils::ratioToString( tor.ratio( ) ) ); } diff --git a/qt/torrent.h b/qt/torrent.h index b96dcf442..e51f754d9 100644 --- a/qt/torrent.h +++ b/qt/torrent.h @@ -253,6 +253,7 @@ class Torrent: public QObject bool hasMetadata( ) const { return getDouble( METADATA_PERCENT_DONE ) >= 1.0; } int pieceCount( ) const { return getInt( PIECE_COUNT ); } double ratio( ) const { return getDouble( RATIO ); } + double percentComplete( ) const { return haveTotal() / (double)totalSize(); } double percentDone( ) const { return getDouble( PERCENT_DONE ); } double metadataPercentDone( ) const { return getDouble( METADATA_PERCENT_DONE ); } uint64_t downloadedEver( ) const { return getSize( DOWNLOADED_EVER ); }