Skip to content

Commit 6a052b2

Browse files
committed
CCPackageDownload cancelling will reset status to initial.
Documentation headers updated.
1 parent edcf969 commit 6a052b2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

UnitTests/CCPackageDownloadTests.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ - (void)testCancelDownload
294294

295295
NSFileManager *fileManager = [NSFileManager defaultManager];
296296
XCTAssertFalse([fileManager fileExistsAtPath:_download.localURL.path]);
297+
XCTAssertEqual(_package.status, CCPackageStatusInitial);
297298
}
298299

299300
- (void)testPauseDownload

cocos2d/CCPackageDownload.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@
4949

5050
/**
5151
* Stops the download and deletes the download file
52+
* Status of package is reset to CCPackageStatusInitial.
5253
*/
5354
- (void)cancel;
5455

5556
/**
56-
* Stops the download
57+
* Pauses the download.
5758
*/
5859
- (void)pause;
5960

cocos2d/CCPackageDownload.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ @implementation CCPackageDownload
2727
- (instancetype)initWithPackage:(CCPackage *)package localURL:(NSURL *)localURL
2828
{
2929
NSAssert(package != nil, @"package must not be nil");
30-
NSAssert(localURL != nil, @"installURL must not be nil");
30+
NSAssert(localURL != nil, @"localURL must not be nil");
3131

3232
self = [super init];
3333
if (self)
@@ -63,6 +63,8 @@ - (void)cancel
6363
[self closeConnectionAndFileHandle];
6464

6565
[self removeTempAndDownloadFile];
66+
67+
_package.status = CCPackageStatusInitial;
6668
}
6769

6870
- (void)pause

0 commit comments

Comments
 (0)