Changeset 4277
- Timestamp:
- 06/09/06 19:38:09 (2 years ago)
- Files:
-
- WiredServer/trunk/PreferencePane/English.lproj/Localizable.strings (modified) (1 diff)
- WiredServer/trunk/WCAccounts.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredServer/trunk/PreferencePane/English.lproj/Localizable.strings
r4276 r4277 1 1 /* File comment (application, date) */ 2 2 "# This file was generated by %@ at %@" = "# This file was generated by %1$@ at %2$@"; 3 4 /* File comment */5 "# This file was generated by %@ at %@\n" = "# This file was generated by %1$@ at %2$@\n";6 3 7 4 /* Certificate */ WiredServer/trunk/WCAccounts.m
r4251 r4277 561 561 562 562 - (BOOL)writeToFile:(NSString *)file { 563 NSEnumerator *enumerator; 564 NSFileHandle *fileHandle; 565 NSString *comment, *line; 566 WCAccount *account; 563 NSEnumerator *enumerator; 564 NSMutableString *string; 565 WCAccount *account; 567 566 568 567 if(![[NSFileManager defaultManager] fileExistsAtPath:file]) { … … 571 570 attributes:NULL]; 572 571 } 573 574 fileHandle = [NSFileHandle fileHandleForWritingAtPath:file]; 575 576 if(!fileHandle) 577 return NO; 578 579 comment = [NSSWF: 580 WCLS(@"# This file was generated by %@ at %@\n", @"File comment"), 581 [[NSBundle bundleForClass:[self class]] objectForInfoDictionaryKey:@"CFBundleExecutable"], 572 573 string = [NSMutableString string]; 574 [string appendFormat:WCLS(@"# This file was generated by %@ at %@", @"File comment (application, date)"), 575 [[self bundle] objectForInfoDictionaryKey:@"CFBundleExecutable"], 582 576 [[NSDate date] fullDateStringWithSeconds:YES]]; 583 [ fileHandle writeData:[comment dataUsingEncoding:NSUTF8StringEncoding]];577 [string appendString:@"\n"]; 584 578 585 579 enumerator = [[_accounts sortedArrayUsingSelector:@selector(compareName:)] objectEnumerator]; 586 580 587 while((account = [enumerator nextObject])) { 588 line = [NSSWF:@"%@\n", [account description]]; 589 [fileHandle writeData:[line dataUsingEncoding:NSUTF8StringEncoding]]; 590 } 591 592 [fileHandle closeFile]; 593 594 return YES; 581 while((account = [enumerator nextObject])) 582 [string appendFormat:@"%@\n", [account description]]; 583 584 return [[string dataUsingEncoding:NSUTF8StringEncoding] writeToFile:file atomically:YES]; 595 585 } 596 586
