From: deztructor Date: Tue, 17 Nov 2009 08:55:56 +0000 (+0000) Subject: formatting progress as percents X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=commitdiff_plain;h=c47e7b47ba063d8915e6cc5df4ffee82318023ed formatting progress as percents git-svn-id: file:///svnroot/qtrapids/trunk@23 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda --- diff --git a/src/include/qtrapids/format.hpp b/src/include/qtrapids/format.hpp index 8094101..305165b 100644 --- a/src/include/qtrapids/format.hpp +++ b/src/include/qtrapids/format.hpp @@ -12,7 +12,7 @@ namespace qtrapids static inline QString formatProgress(uint progress) { - return QString::number(((double)progress) / torrent_progress_max * 100); + return QString::number(progress / torrent_progress_percent); } namespace diff --git a/src/include/qtrapids/info.hpp b/src/include/qtrapids/info.hpp index 6265155..f944677 100644 --- a/src/include/qtrapids/info.hpp +++ b/src/include/qtrapids/info.hpp @@ -9,7 +9,9 @@ namespace qtrapids { - static const uint32_t torrent_progress_max = std::numeric_limits::max(); + static const uint32_t torrent_progress_max = 1000000; + static const uint32_t torrent_progress_percent = 10000; + //std::numeric_limits::max(); typedef libtorrent::torrent_status TorrentStatus_t; typedef libtorrent::torrent_status::state_t TorrentStatusIds_t;