Changeset 25602
- Timestamp:
- 11/20/2008 04:02:04 AM (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m
r25598 r25602 18 18 #import <Adium/AIAccount.h> 19 19 #import <Adium/AIListObject.h> 20 #import <Adium/AIListContact.h> 20 21 #import <Adium/AIMessageEntryTextView.h> 21 22 #import <Adium/AIPreferenceControllerProtocol.h> trunk/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m
r25599 r25602 101 101 NSFileManager *fileManager = [NSFileManager defaultManager]; 102 102 103 boolisDirectory = NO;104 boolexists = [fileManager fileExistsAtPath:localFilename isDirectory:&isDirectory];103 BOOL isDirectory = NO; 104 BOOL exists = [fileManager fileExistsAtPath:localFilename isDirectory:&isDirectory]; 105 105 if (exists && isDirectory) { 106 106 /*We need to remove this file*/ … … 133 133 134 134 /*Call downloadFolder:path:url: for file children */ 135 enumerator = [[root elementsForName:@"file"] objectEnumerator]; 136 while (nextElement = [enumerator nextObject]) { 135 for (NSXMLElement *nextElement in [root elementsForName:@"file"]) { 137 136 fileSuccess = [self downloadFolder:nextElement path:localFilename url:[self url]]; 138 137 } … … 141 140 142 141 /*Now go through itemsToDownload and download the files*/ 143 NSEnumerator *enumerator = [itemsToDownload keyEnumerator]; 144 NSString *path; 145 NSURL *url; 146 while ((path = [enumerator nextObject])) { 142 NSURL *downloadURL; 143 for (NSString* path in [itemsToDownload keyEnumerator]) { 147 144 /* code that uses the returned key */ 148 url= [itemsToDownload valueForKey:path];149 if ( url) {150 [self downloadURL: urltoPath:path];151 url= nil;145 downloadURL = [itemsToDownload valueForKey:path]; 146 if (downloadURL) { 147 [self downloadURL:downloadURL toPath:path]; 148 downloadURL = nil; 152 149 } else { 153 [[[[self manager] client] client] reportError:[NSString stringWithFormat:@"Error downloading file from %@ to %@", url, path] ofLevel:AWEzvError];150 [[[[self manager] client] client] reportError:[NSString stringWithFormat:@"Error downloading file from %@ to %@", downloadURL, path] ofLevel:AWEzvError]; 154 151 [[[[self manager] client] client] remoteCanceledFileTransfer:self]; 155 152 } … … 216 213 /* Now call downloadFolder for dir and file children */ 217 214 NSString *newURL = [rootURL stringByAppendingPathComponent:[name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 218 NSEnumerator *enumerator = [[root elementsForName:@"dir"] objectEnumerator]; 219 NSXMLElement *nextElement; 220 while (nextElement = [enumerator nextObject]) { 215 216 for (NSXMLElement *nextElement in [root elementsForName:@"dir"]) { 221 217 folderSuccess = [self downloadFolder:nextElement path:newPath url:newURL]; 222 218 } 223 enumerator = [[root elementsForName:@"file"] objectEnumerator]; 224 while (nextElement = [enumerator nextObject]) { 219 for (NSXMLElement *nextElement in [root elementsForName:@"file"]) { 225 220 fileSuccess = [self downloadFolder:nextElement path:newPath url:newURL]; 226 221 } 227 return (fileSuccess && folderSuccess);228 } else {222 return fileSuccess && folderSuccess; 223 } else { 229 224 [[[[self manager] client] client] reportError:@"Error, attempting to download something which is not a directory or a file." ofLevel: AWEzvError]; 230 225 … … 246 241 if (posixFlags) { 247 242 NSScanner *scanner; 248 inttempInt;243 unsigned tempInt; 249 244 250 245 scanner = [NSScanner scannerWithString:posixFlags]; 251 246 [scanner scanHexInt:&tempInt]; 252 NSNumber *number = [NSNumber numberWith Int:tempInt];247 NSNumber *number = [NSNumber numberWithUnsignedInt:tempInt]; 253 248 254 249 attributes = [NSMutableDictionary dictionary]; trunk/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m
r25599 r25602 273 273 - (id)initWithAsyncSocket:(AsyncSocket *)newSocket forServer:(HTTPServer *)myServer 274 274 { 275 if ( self = [super init])275 if ((self = [super init])) 276 276 { 277 277 // Take over ownership of the socket