Revision: 4567
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4567&view=rev
Author:   hofman
Date:     2008-09-05 19:54:27 +0000 (Fri, 05 Sep 2008)

Log Message:
-----------
Move code to reset progress indicator for download t separate method.

Modified Paths:
--------------
    trunk/SKDownload.m

Modified: trunk/SKDownload.m
===================================================================
--- trunk/SKDownload.m  2008-09-05 19:41:55 UTC (rev 4566)
+++ trunk/SKDownload.m  2008-09-05 19:54:27 UTC (rev 4567)
@@ -107,6 +107,16 @@
     [self cancel];
 }
 
+- (void)resetProgressIndicator {
+    if (expectedContentLength > 0) {
+        [progressIndicator setIndeterminate:NO];
+        [progressIndicator setMaxValue:(double)expectedContentLength];
+    } else {
+        [progressIndicator setIndeterminate:YES];
+        [progressIndicator setMaxValue:1.0];
+    }
+}
+
 #pragma mark Accessors
 
 - (id)delegate {
@@ -178,13 +188,7 @@
 - (void)setExpectedContentLength:(long long)newExpectedContentLength {
     if (expectedContentLength != newExpectedContentLength) {
         expectedContentLength = newExpectedContentLength;
-        if (expectedContentLength > 0) {
-            [progressIndicator setIndeterminate:NO];
-            [progressIndicator setMaxValue:(double)expectedContentLength];
-        } else {
-            [progressIndicator setIndeterminate:YES];
-            [progressIndicator setMaxValue:1.0];
-        }
+        [self resetProgressIndicator];
     }
 }
 
@@ -210,14 +214,8 @@
         [progressIndicator setControlSize:NSSmallControlSize];
         [progressIndicator setUsesThreadedAnimation:YES];
         [progressIndicator sizeToFit];
-        if (expectedContentLength > 0) {
-            [progressIndicator setIndeterminate:NO];
-            [progressIndicator setMaxValue:(double)expectedContentLength];
-            [progressIndicator setDoubleValue:(double)receivedContentLength];
-        } else {
-            [progressIndicator setIndeterminate:YES];
-            [progressIndicator setMaxValue:1.0];
-        }
+        [self resetProgressIndicator];
+        [progressIndicator setDoubleValue:(double)receivedContentLength];
         [progressIndicator startAnimation:self];
     }
     return progressIndicator;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to