+ // calculate the percentage, if we have too little data assume 0%
+ // FIXME: the 5k is totally arbitrary
+ if (TotalBytes < 5*1024)
+ Percent = 0;
+ else
+ // use both files and bytes because bytes can be unreliable
+ Percent = (0.8 * (CurrentBytes/float(TotalBytes)*100.0) +
+ 0.2 * (CurrentItems/float(TotalItems)*100.0));
+