Skip to content

Commit 4d03ca2

Browse files
committed
Packages stored in userdefaults removed on startup of test app.
Removed some commented code about installData in CCPackageInstaller.
1 parent 6a052b2 commit 4d03ca2

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

cocos2d-ui-tests/ios/AppDelegate.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#import "AppDelegate.h"
2828
#import "MainMenu.h"
2929
#import "TestBase.h"
30+
#import "CCPackageConstants.h"
3031

3132
@implementation AppController
3233

@@ -55,6 +56,9 @@ - (void)configureCocos2d
5556

5657
- (void)configureFileUtilsSearchPathAndRegisterSpriteSheets
5758
{
59+
[[NSUserDefaults standardUserDefaults] setValue:nil forKey:PACKAGE_STORAGE_USERDEFAULTS_KEY];
60+
[[NSUserDefaults standardUserDefaults] synchronize];
61+
5862
CCFileUtils* sharedFileUtils = [CCFileUtils sharedFileUtils];
5963

6064
sharedFileUtils.searchPath =

cocos2d/CCPackageInstaller.m

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#import "CCPackageConstants.h"
33
#import "CCPackage.h"
44
#import "ccMacros.h"
5+
#import "CCPackage_private.h"
56

67

78
@interface CCPackageInstaller ()
@@ -31,14 +32,6 @@ - (instancetype)initWithPackage:(CCPackage *)package installPath:(NSString *)ins
3132

3233
- (BOOL)installWithError:(NSError **)error
3334
{
34-
35-
/* TODO
36-
CCPackageInstallData *installData = [_package installData];
37-
38-
NSAssert(installData != nil, @"installData must not be nil");
39-
NSAssert(installData.unzipURL != nil, @"installData.unzipURL must not be nil");
40-
*/
41-
4235
if (![self unzippedPackageFolderExists:error])
4336
{
4437
[_package setValue:@(CCPackageStatusInstallationFailed) forKey:@"status"];
@@ -58,13 +51,10 @@ - (BOOL)installWithError:(NSError **)error
5851

5952
- (BOOL)movePackageToInstallPathWithError:(NSError **)error
6053
{
61-
// TODO
62-
// CCPackageInstallData *installData = [_package installData];
63-
6454
NSAssert(_package.unzipURL != nil, @"package.unzipURL must not be nil.");
6555
NSAssert(_package.folderName != nil, @"package.folderName must not be nil.");
6656

67-
[_package setValue:[NSURL fileURLWithPath:[_installPath stringByAppendingPathComponent:_package.folderName]] forKey:@"installURL"];
57+
_package.installURL = [NSURL fileURLWithPath:[_installPath stringByAppendingPathComponent:_package.folderName]];
6858

6959
NSError *errorMove;
7060
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -89,10 +79,6 @@ - (BOOL)movePackageToInstallPathWithError:(NSError **)error
8979

9080
- (BOOL)unzippedPackageFolderExists:(NSError **)error
9181
{
92-
/* TODO
93-
CCPackageInstallData *installData = [_package installData];
94-
NSAssert(installData.unzipURL, @"installData.unzipURL must not be nil");
95-
*/
9682
NSAssert(_package.unzipURL != nil, @"package.unzipURL must not be nil.");
9783

9884
NSFileManager *fileManager = [NSFileManager defaultManager];

0 commit comments

Comments
 (0)