Skip to content

Commit

Permalink
Renamed „downloadPaused“ to „suspended“ to use homonym naming with NS…
Browse files Browse the repository at this point in the history
…OperationQueue, refactored this property to just forward the suspended state of the download queue
  • Loading branch information
Lars Blumberg authored and Lars Blumberg committed Aug 18, 2014
1 parent 760331f commit fb854ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/shared/AFCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ typedef struct NetworkTimeoutIntervals {
/*
* pause the downloads. cancels any running downloads and puts them back into the queue
*/
@property (nonatomic, assign) BOOL downloadPaused;
@property (nonatomic, assign, getter=suspended, setter=setSuspended:) BOOL suspended;

/*
* check if we have an internet connection. can be observed
Expand Down
14 changes: 7 additions & 7 deletions src/shared/AFCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ - (id)initWithContext:(NSString*)context {
}

- (void)initialize {
_downloadPaused = NO;
_downloadPermission = YES;
_wantsToArchive = NO;
_connectedToNetwork = NO;
Expand Down Expand Up @@ -1359,13 +1358,15 @@ - (BOOL)hasCachedItemForURL:(NSURL *)url

#pragma mark - offline mode & pause methods

- (void)setDownloadPaused:(BOOL)pause
{
_downloadPaused = pause;
[self.packageArchiveQueue setSuspended:pause];
- (BOOL)suspended {
return [self.downloadOperationQueue isSuspended];
}

- (void)setSuspended:(BOOL)pause {
[self.downloadOperationQueue setSuspended:pause];
[self.packageArchiveQueue setSuspended:pause];

// TODO: Do we really need to cancel already running downloads? If not, just remove the following lines
if (pause) {
// TODO: Cancel current downloads and add running download operations to a list...
}
Expand Down Expand Up @@ -1408,8 +1409,7 @@ - (BOOL)isConnectedToNetwork {

- (void)setConnectedToNetwork:(BOOL)connected
{
if (_connectedToNetwork != connected)
{
if (_connectedToNetwork != connected) {
[self willChangeValueForKey:@"connectedToNetwork"];
_connectedToNetwork = connected;
[self didChangeValueForKey:@"connectedToNetwork"];
Expand Down

0 comments on commit fb854ba

Please sign in to comment.