Refactor download mechanism to allow multiple concurrent downloads. Allow downloads to be cancelled. Allow js to query if files exist in the cache. Fix some compiler warnings.

This commit is contained in:
Paul Chote
2010-11-19 13:41:24 +13:00
parent c3521a2490
commit 0ee1d39bac
10 changed files with 201 additions and 66 deletions

View File

@@ -9,8 +9,10 @@
#import <Cocoa/Cocoa.h>
@class Mod;
@class Controller;
@interface GameInstall : NSObject {
NSURL *gameURL;
Controller *controller;
NSMutableDictionary *downloadTasks;
}
@property(readonly) NSURL *gameURL;
@@ -20,5 +22,8 @@
- (NSString *)runUtilityQuery:(NSString *)arg;
- (NSArray *)installedMods;
- (NSDictionary *)infoForMods:(NSArray *)mods;
- (BOOL)downloadUrl:(NSString *)url toPath:(NSString *)filename withId:(NSString *)key;
- (NSTask *)runAsyncUtilityWithArg:(NSString *)arg
delegate:(id)object
responseSelector:(SEL)response
terminatedSelector:(SEL)terminated;
@end