Changeset 10539
- Timestamp:
- Apr 28, 2010, 11:03:38 AM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/BlocklistDownloader.h
r9844 r10539 40 40 BlocklistDownloaderViewController * fViewController; 41 41 42 NSString * fDestination; 42 43 NSUInteger fCurrentSize; 43 44 long long fExpectedSize; -
trunk/macosx/BlocklistDownloader.m
r9844 r10539 29 29 30 30 #define LIST_URL @"http://update.transmissionbt.com/level1.gz" 31 #define DESTINATION [NSTemporaryDirectory() stringByAppendingPathComponent: @"level1.gz"]31 #define FILE_NAME @"level1.gz" 32 32 33 33 @interface BlocklistDownloader (Private) … … 80 80 { 81 81 [fDownload release]; 82 [fDestination release]; 82 83 [super dealloc]; 83 84 } … … 93 94 fDownloader = nil; 94 95 [self release]; 96 } 97 98 - (void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path 99 { 100 fDestination = [path retain]; 95 101 } 96 102 … … 140 146 141 147 fDownload = [[NSURLDownload alloc] initWithRequest: request delegate: self]; 142 [fDownload setDestination: DESTINATION allowOverwrite: YES];148 [fDownload setDestination: [NSTemporaryDirectory() stringByAppendingPathComponent: FILE_NAME] allowOverwrite: NO]; 143 149 } 144 150 … … 150 156 151 157 //process data 152 tr_blocklistSetContent([PrefsController handle], [DESTINATION UTF8String]); 158 NSAssert(fDestination != nil, @"the blocklist file destination has not been specified"); 159 tr_blocklistSetContent([PrefsController handle], [fDestination UTF8String]); 153 160 154 161 //delete downloaded file 155 [[NSFileManager defaultManager] removeItemAtPath: DESTINATIONerror: NULL];162 [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL]; 156 163 157 164 [fViewController setFinished];
Note: See TracChangeset
for help on using the changeset viewer.