formatting progress as percents
authordeztructor <denis.zalewsky@gmail.com>
Tue, 17 Nov 2009 08:55:56 +0000 (08:55 +0000)
committerdeztructor <denis.zalewsky@gmail.com>
Tue, 17 Nov 2009 08:55:56 +0000 (08:55 +0000)
git-svn-id: file:///svnroot/qtrapids/trunk@23 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda

src/include/qtrapids/format.hpp
src/include/qtrapids/info.hpp

index 8094101..305165b 100644 (file)
@@ -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 
index 6265155..f944677 100644 (file)
@@ -9,7 +9,9 @@
 namespace qtrapids
 {
 
-    static const uint32_t torrent_progress_max = std::numeric_limits<uint32_t>::max();
+    static const uint32_t torrent_progress_max = 1000000;
+    static const uint32_t torrent_progress_percent = 10000;
+    //std::numeric_limits<uint32_t>::max();
 
     typedef libtorrent::torrent_status TorrentStatus_t;
     typedef libtorrent::torrent_status::state_t TorrentStatusIds_t;