Changeset 3346
- Timestamp:
- 08/27/06 21:41:37 (2 years ago)
- Files:
-
- trunk/Additions/NSURLAdditions.m (modified) (3 diffs)
- trunk/Colloquy.pch (modified) (1 diff)
- trunk/Controllers/JVChatController.m (modified) (2 diffs)
- trunk/Controllers/JVChatWindowController.m (modified) (2 diffs)
- trunk/Controllers/MVApplicationController.m (modified) (1 diff)
- trunk/Controllers/MVConnectionsController.m (modified) (10 diffs)
- trunk/Controllers/MVFileTransferController.m (modified) (1 diff)
- trunk/Models/JVSQLChatTranscript.m (modified) (1 diff)
- trunk/Views/JVMarkedScroller.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Additions/NSURLAdditions.m
r3072 r3346 7 7 FSRef ref; 8 8 if( FSPathMakeRef( (UInt8 *)fileSystemPath, &ref, NULL ) ) { 9 NSLog( @"Couldn't make FSRef from: %@", path );9 if( NSDebugEnabled ) NSLog( @"Couldn't make FSRef from: %@", path ); 10 10 return nil; 11 11 } 12 12 13 13 short fileRefNum = 0; 14 if( ( fileRefNum = FSOpenResFile( &ref, fsRdPerm ) ) == -1 ) {15 NSLog(@"Couldn't open inetloc file at: %@", path);14 if( ( fileRefNum = FSOpenResFile( &ref, fsRdPerm ) ) == -1 ) { 15 if( NSDebugEnabled ) NSLog(@"Couldn't open inetloc file at: %@", path); 16 16 return nil; 17 17 } 18 18 19 19 if( ! Count1Resources('url ') ) { 20 NSLog(@"Inetloc file '%@' contains no 'url ' resources", path);20 if( NSDebugEnabled ) NSLog(@"Inetloc file '%@' contains no 'url ' resources", path); 21 21 CloseResFile( fileRefNum ); 22 22 return nil; … … 44 44 FSRef ref, parentRef; 45 45 if( FSPathMakeRef( (unsigned char *) fileSystemPath, &parentRef, FALSE ) ) { 46 NSLog( @"Couldn't make FSRef from: %@", parentPath );46 if( NSDebugEnabled ) NSLog( @"Couldn't make FSRef from: %@", parentPath ); 47 47 return; 48 48 } … … 55 55 56 56 if( ( fileRefNum = FSOpenResFile( &ref, fsWrPerm ) ) == -1 ) { 57 NSLog( @"Couldn't open inetloc at: %@", path );57 if( NSDebugEnabled ) NSLog( @"Couldn't open inetloc at: %@", path ); 58 58 [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; 59 59 return; trunk/Colloquy.pch
r3344 r3346 6 6 #import <AGRegex/AGRegex.h> 7 7 #import <ChatCore/ChatCore.h> 8 #import <Foundation/NSDebug.h> 8 9 9 10 #endif trunk/Controllers/JVChatController.m
r3259 r3346 195 195 windowController = [[[JVTabbedChatWindowController alloc] init] autorelease]; 196 196 else windowController = [[[JVChatWindowController alloc] init] autorelease]; 197 [_chatWindows addObject:windowController]; 197 if( windowController ) 198 [_chatWindows addObject:windowController]; 198 199 return windowController; 199 200 } … … 355 356 JVSmartTranscriptPanel *smartTranscript = nil; 356 357 357 while( ( smartTranscript = [enumerator nextObject] ) ) 358 [smartTranscripts addObject:[NSKeyedArchiver archivedDataWithRootObject:smartTranscript]]; 358 while( ( smartTranscript = [enumerator nextObject] ) ) { 359 NSData *archived = [NSKeyedArchiver archivedDataWithRootObject:smartTranscript] 360 if( archived ) [smartTranscripts addObject:archived]; 361 } 359 362 360 363 [[self class] refreshSmartTranscriptMenu]; trunk/Controllers/JVChatWindowController.m
r3325 r3346 451 451 [ret addObject:controller]; 452 452 453 return [NSArray arrayWithArray:ret];453 return ret; 454 454 } 455 455 … … 466 466 [ret addObject:controller]; 467 467 468 return [NSArray arrayWithArray:ret];468 return ret; 469 469 } 470 470 trunk/Controllers/MVApplicationController.m
r3310 r3346 24 24 25 25 #import <Sparkle/SUUpdater.h> 26 #import <Foundation/NSDebug.h>27 26 28 27 @interface WebCoreCache trunk/Controllers/MVConnectionsController.m
r3307 r3346 70 70 if( [[item pathExtension] isEqualToString:@"inetloc"] ) { 71 71 url = [NSURL URLWithInternetLocationFile:[[NSString stringWithFormat:@"~/Library/Application Support/Colloquy/Favorites/%@", item] stringByExpandingTildeInPath]]; 72 [rooms addObject:url]; 73 [roomNames addObject:[item stringByDeletingPathExtension]]; 72 if( url ) { 73 [rooms addObject:url]; 74 [roomNames addObject:[item stringByDeletingPathExtension]]; 75 } 74 76 } 75 77 } … … 413 415 MVChatUser *user; 414 416 415 if ( [users count] == 0 ) return;416 else if ( [users count] == 1 ) user = [users anyObject];417 if( [users count] == 0 ) return; 418 else if( [users count] == 1 ) user = [users anyObject]; 417 419 else { 418 420 [self _validateToolbar]; … … 482 484 BOOL accepted = NO; 483 485 484 if ( [sender tag] )486 if( [sender tag] ) 485 487 accepted = YES; 486 488 487 489 BOOL alwaysAccept = NO; 488 490 489 if ( [publicKeyAlwaysAccept state] == NSOnState )491 if( [publicKeyAlwaysAccept state] == NSOnState ) 490 492 alwaysAccept = YES; 491 493 … … 494 496 [publicKeyVerification orderOut:nil]; 495 497 496 if ( [_publicKeyRequestQueue count] ) {498 if( [_publicKeyRequestQueue count] ) { 497 499 NSNotification *note = [_publicKeyRequestQueue anyObject]; 498 500 499 if ( note ) {501 if( note ) { 500 502 [_publicKeyRequestQueue removeObject:note]; 501 503 [[NSNotificationCenter defaultCenter] postNotification:note]; … … 513 515 int row = [userSelectionTable selectedRow]; 514 516 515 if ( [sender tag] || row == -1 ) {517 if( [sender tag] || row == -1 ) { 516 518 [_userSelectionPossibleUsers release]; 517 519 _userSelectionPossibleUsers = nil; … … 533 535 id info = nil; 534 536 535 while( ( info = [enumerator nextObject] ) ) 536 [ret addObject:[info objectForKey:@"connection"]]; 537 538 return [[ret retain] autorelease]; 537 while( ( info = [enumerator nextObject] ) ) { 538 MVChatConnection *connection = [info objectForKey:@"connection"]; 539 if( connection ) [ret addObject:connection]; 540 } 541 542 return ret; 539 543 } 540 544 … … 545 549 546 550 while( ( info = [enumerator nextObject] ) ) 547 if( [[info objectForKey:@"connection"] isConnected] ) 548 [ret addObject:[info objectForKey:@"connection"]]; 549 550 return [[ret retain] autorelease]; 551 MVChatConnection *connection = [info objectForKey:@"connection"]; 552 if( [connection isConnected] ) 553 [ret addObject:connection]; 554 555 return ret; 551 556 } 552 557 553 558 - (MVChatConnection *) connectionForServerAddress:(NSString *) address { 554 MVChatConnection *ret = nil;555 559 NSEnumerator *enumerator = [_bookmarks objectEnumerator]; 556 560 id info = nil; 557 561 558 562 while( ( info = [enumerator nextObject] ) ) { 559 if( [[(MVChatConnection *)[info objectForKey:@"connection"] server] compare:address options:( NSCaseInsensitiveSearch | NSLiteralSearch | NSBackwardsSearch | NSAnchoredSearch )] == NSOrderedSame ) { 560 ret = [info objectForKey:@"connection"]; 561 if( [ret isConnected] ) return ret; 562 } 563 } 564 565 return ret; 563 MVChatConnection *connection = [info objectForKey:@"connection"]; 564 if( [[connection server] compare:address options:( NSCaseInsensitiveSearch | NSLiteralSearch | NSBackwardsSearch | NSAnchoredSearch )] == NSOrderedSame ) { 565 if( [connection isConnected] ) 566 return connection; 567 } 568 } 569 570 return nil; 566 571 } 567 572 … … 990 995 } else if( view == newJoinRooms ) { 991 996 return [_joinRooms objectAtIndex:row]; 992 } else if ( view == userSelectionTable ) {997 } else if( view == userSelectionTable ) { 993 998 MVChatUser *user = [_userSelectionPossibleUsers objectAtIndex:row]; 994 999 … … 1512 1517 KAIgnoreRule *rule = nil; 1513 1518 1514 while( ( rule = [ie nextObject] ) ) 1515 if( [rule isPermanent] ) 1516 [permIgnores addObject:[NSKeyedArchiver archivedDataWithRootObject:rule]]; 1519 while( ( rule = [ie nextObject] ) ) { 1520 if( [rule isPermanent] ) { 1521 NSData *archive = [NSKeyedArchiver archivedDataWithRootObject:rule]; 1522 if( archive ) [permIgnores addObject:archive]; 1523 } 1524 } 1517 1525 1518 1526 if( [permIgnores count] ) [data setObject:permIgnores forKey:@"ignores"]; … … 1569 1577 NSData *rule = nil; 1570 1578 1571 while( ( rule = [ie nextObject] ) ) 1572 [permIgnores addObject:[NSKeyedUnarchiver unarchiveObjectWithData:rule]]; 1579 while( ( rule = [ie nextObject] ) ) { 1580 NSData *archive = [NSKeyedUnarchiver unarchiveObjectWithData:rule]; 1581 if( archive ) [permIgnores addObject:archive]; 1582 } 1573 1583 1574 1584 [info setObject:permIgnores forKey:@"ignores"]; trunk/Controllers/MVFileTransferController.m
r3325 r3346 267 267 268 268 - (void) addFileTransfer:(id) transfer { 269 NSEnumerator *enumerator = nil; 269 NSParameterAssert( transfer != nil ); 270 271 NSEnumerator *enumerator = [_transferStorage objectEnumerator]; 270 272 NSMutableDictionary *info = nil; 271 NSParameterAssert( transfer != nil );272 273 enumerator = [_transferStorage objectEnumerator];274 273 while( ( info = [enumerator nextObject] ) ) 275 274 if( [[info objectForKey:@"transfer"] isEqualTo:transfer] ) trunk/Models/JVSQLChatTranscript.m
r3345 r3346 6 6 #import "NSAttributedStringMoreAdditions.h" 7 7 8 #import <Foundation/NSDebug.h>9 8 #import <sys/stat.h> 10 9 #import <unistd.h> trunk/Views/JVMarkedScroller.m
r3259 r3346 113 113 114 114 if( ! NSPointInRect( point, knobRect ) ) { 115 if( mark.color != nil) {115 if( mark.color ) { 116 116 NSBezierPath *line = [NSBezierPath bezierPath]; 117 117 [line moveToPoint:point];
