[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/sysadmin/shaman/libshaman/backends/aqpm
From:       Dario Freddi <drf () kde ! org>
Date:       2009-11-21 21:02:59
Message-ID: 1258837379.495609.1758.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1052486 by dafre:

Fix division by 0, crap

Signed-off-by: Dario Freddi <drf@kde.org>

 M  +6 -2      AqpmPlugin.cpp  


--- trunk/playground/sysadmin/shaman/libshaman/backends/aqpm/AqpmPlugin.cpp \
#1052485:1052486 @@ -216,8 +216,12 @@
 {
     transactionInterface()->setCurrentPackage(findPackageByName(c));
     transactionInterface()->setDownloadSpeed(speed);
-    transactionInterface()->setProgress((bytedone*100)/bytetotal);
-    transactionInterface()->setTotalProgress((listdone*100)/listtotal);
+    if (bytetotal > 0) {
+        transactionInterface()->setProgress((bytedone*100)/bytetotal);
+    }
+    if (listtotal > 0) {
+        transactionInterface()->setTotalProgress((listdone*100)/listtotal);
+    }
 }
 
 void AqpmPlugin::slotStreamTransProgress(Globals::TransactionProgress event, const \
QString& pkgname, int percent, int howmany, int remain)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic