flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-utilities] [refs/heads/develop] - sometimes a progress event has 0 for bytesTotal which makes the progressbar draw incorrectly. Looks like we can just eat those events
Date Wed, 12 Feb 2014 23:36:55 GMT
Updated Branches:
  refs/heads/develop 0c1cdf683 -> 75a72333c


sometimes a progress event has 0 for bytesTotal which makes the progressbar draw incorrectly.
 Looks like we can just eat those events


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/75a72333
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/75a72333
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/75a72333

Branch: refs/heads/develop
Commit: 75a72333cccd9ff0c3f5bea0673363eb97fc3177
Parents: 0c1cdf6
Author: Alex Harui <aharui@apache.org>
Authored: Wed Feb 12 15:36:45 2014 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Feb 12 15:36:45 2014 -0800

----------------------------------------------------------------------
 installer/src/InstallApacheFlex.mxml | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/75a72333/installer/src/InstallApacheFlex.mxml
----------------------------------------------------------------------
diff --git a/installer/src/InstallApacheFlex.mxml b/installer/src/InstallApacheFlex.mxml
index b63d80e..b35ed0a 100644
--- a/installer/src/InstallApacheFlex.mxml
+++ b/installer/src/InstallApacheFlex.mxml
@@ -1218,7 +1218,8 @@ variables are not required because the locations of these pieces are
known.
 		protected function md5VerificationProgressHandler(event:ProgressEvent):void {
             if (debugMode)
                 log("md5 progress " + event.bytesLoaded + "  " + event.bytesTotal, -1, false);
-			progressBar.percent = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
+            if (event.bytesTotal > 0)
+    			progressBar.percent = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
 		}
 		
 		protected function handleApacheFlexSDKDownloadError(event:* = null):void {
@@ -1354,7 +1355,8 @@ variables are not required because the locations of these pieces are
known.
         {
             if (debugMode)
                 log("progress " + event.bytesLoaded + "  " + event.bytesTotal, -1, false);
-            progressBar.percent = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
+            if (event.bytesTotal > 0)
+                progressBar.percent = Math.round((event.bytesLoaded / event.bytesTotal) *
100);
             /*
             if (ant.progressClass is Copy)
             {
@@ -1404,7 +1406,7 @@ variables are not required because the locations of these pieces are
known.
             else if (s.indexOf("[echo] ") != -1)
             {
                 s = s.substr(s.indexOf("[echo] ") + 7);
-                isPublic = false;
+                //isPublic = false;
                 skipLog = false;
             }
             log(s, -1, isPublic, skipLog);
@@ -2165,11 +2167,14 @@ variables are not required because the locations of these pieces are
known.
 		private function handleDownloadProgress(event:ProgressEvent):void {
 			var bytesTotal:int = event.bytesTotal;
 			var bytesLoaded:int = event.bytesLoaded;
-			var percentLoaded:int = Math.round(bytesLoaded * 100 / bytesTotal);
-            if (debugMode)
-                log("download progress " + event.bytesLoaded + "  " + event.bytesTotal, -1,
false);
-			
-			progressBar.percent = percentLoaded;
+            if (event.bytesTotal > 0)
+            {
+    			var percentLoaded:int = Math.round(bytesLoaded * 100 / bytesTotal);
+                if (debugMode)
+                    log("download progress " + event.bytesLoaded + "  " + event.bytesTotal,
-1, false);
+    			
+    			progressBar.percent = percentLoaded;
+            }
 		}
 		
 		private function handleDownloadComplete(event:Event):void {


Mime
View raw message