From: Mitchell Livingston Date: Sat, 29 Aug 2009 00:09:18 +0000 (+0000) Subject: remove a couple more deprecated methods and an unneed stringWithFormat: X-Git-Tag: 1.75~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cf26bd5db6ca2ccd303ccf9d402c5b0e1d0e2da;p=transmission remove a couple more deprecated methods and an unneed stringWithFormat: --- diff --git a/macosx/AboutWindowController.m b/macosx/AboutWindowController.m index c5291a639..6aa210138 100644 --- a/macosx/AboutWindowController.m +++ b/macosx/AboutWindowController.m @@ -71,7 +71,9 @@ AboutWindowController * fAboutBoxInstance = nil; - (IBAction) showLicense: (id) sender { - [fLicenseView setString: [NSString stringWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"COPYING" ofType: nil]]]; + NSString * licenseText = [NSString stringWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"COPYING" ofType: nil] + usedEncoding: nil error: NULL]; + [fLicenseView setString: licenseText]; [fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")]; [NSApp beginSheet: fLicenseSheet modalForWindow: [self window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index d8b73a77c..e0c1cbffa 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -334,11 +334,10 @@ { NSAlert * alert = [[NSAlert alloc] init]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Save log alert panel -> button")]; - [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Log Could Not Be Saved", - "Save log alert panel -> title")]]; - [alert setInformativeText: [NSString stringWithFormat: + [alert setMessageText: NSLocalizedString(@"Log Could Not Be Saved", "Save log alert panel -> title")]; + [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"There was a problem creating the file \"%@\".", - "Save log alert panel -> message"), [[panel filename] lastPathComponent]]]; + "Save log alert panel -> message"), [[panel filename] lastPathComponent]]]; [alert setAlertStyle: NSWarningAlertStyle]; [alert runModal]; diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 8fe111801..3d7d0e0d7 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -972,8 +972,8 @@ tr_session * fHandle; [fRPCWhitelistArray addObject: @""]; [fRPCWhitelistTable reloadData]; - int row = [fRPCWhitelistArray count] - 1; - [fRPCWhitelistTable selectRow: row byExtendingSelection: NO]; + const int row = [fRPCWhitelistArray count] - 1; + [fRPCWhitelistTable selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO]; [fRPCWhitelistTable editColumn: 0 row: row withEvent: nil select: YES]; } }