1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 14:13:23 +00:00

remove most instances of deprecated filename and filenames methods

This commit is contained in:
Mitchell Livingston 2011-10-06 02:16:19 +00:00
parent b0ef96516d
commit bc5b4be310
7 changed files with 13 additions and 13 deletions

View file

@ -230,7 +230,7 @@
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo
{
if (code == NSOKButton)
[self setDestinationPath: [[openPanel filenames] objectAtIndex: 0]];
[self setDestinationPath: [[[openPanel URLs] objectAtIndex: 0] path]];
else
{
if (!fDestination)

View file

@ -327,7 +327,7 @@
if (code == NSOKButton)
{
fLockDestination = NO;
[self setDestinationPath: [[openPanel filenames] objectAtIndex: 0]];
[self setDestinationPath: [[[openPanel URLs] objectAtIndex: 0] path]];
}
else
{

View file

@ -1445,7 +1445,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
if (code == NSOKButton)
{
for (Torrent * torrent in torrents)
[torrent moveTorrentDataFileTo: [[panel filenames] objectAtIndex: 0]];
[torrent moveTorrentDataFileTo: [[[panel URLs] objectAtIndex: 0] path]];
}
[torrents release];
@ -1501,7 +1501,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
{
//copy torrent to new location with name of data file
if (code == NSOKButton)
[[torrents objectAtIndex: 0] copyTorrentFileTo: [panel filename]];
[[torrents objectAtIndex: 0] copyTorrentFileTo: [[panel URL] path]];
[torrents removeObjectAtIndex: 0];
[self performSelectorOnMainThread: @selector(copyTorrentFileForTorrents:) withObject: torrents waitUntilDone: NO];

View file

@ -404,7 +404,7 @@
[panel setMessage: NSLocalizedString(@"Select a file or folder for the torrent file.", "Create torrent -> select file")];
BOOL success = [panel runModal] == NSOKButton;
return success ? [[panel filenames] objectAtIndex: 0] : nil;
return success ? [[[panel URLs] objectAtIndex: 0] path] : nil;
}
- (void) locationSheetClosed: (NSSavePanel *) panel returnCode: (NSInteger) code contextInfo: (void *) info
@ -412,7 +412,7 @@
if (code == NSOKButton)
{
[fLocation release];
fLocation = [[panel filename] retain];
fLocation = [[[panel URL] path] retain];
[fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
[fLocationField setToolTip: fLocation];

View file

@ -221,7 +221,7 @@
NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]];
if (code == NSOKButton)
{
NSString * path = [[openPanel filenames] objectAtIndex: 0];
NSString * path = [[[openPanel URLs] objectAtIndex: 0] path];
[[GroupsController groups] setCustomDownloadLocation: path forIndex: index];
[[GroupsController groups] setUsesCustomDownloadLocation: YES forIndex: index];
}

View file

@ -404,14 +404,14 @@
NSString * fileString = [messageStrings componentsJoinedByString: @"\n"];
if (![fileString writeToFile: [panel filename] atomically: YES encoding: NSUTF8StringEncoding error: nil])
if (![fileString writeToFile: [[panel URL] path] atomically: YES encoding: NSUTF8StringEncoding error: nil])
{
NSAlert * alert = [[NSAlert alloc] init];
[alert addButtonWithTitle: NSLocalizedString(@"OK", "Save log alert panel -> button")];
[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 URL] path] lastPathComponent]]];
[alert setAlertStyle: NSWarningAlertStyle];
[alert runModal];

View file

@ -1387,7 +1387,7 @@ tr_session * fHandle;
{
[fFolderPopUp selectItemAtIndex: DOWNLOAD_FOLDER];
NSString * folder = [[openPanel filenames] objectAtIndex: 0];
NSString * folder = [[[openPanel URLs] objectAtIndex: 0] path];
[fDefaults setObject: folder forKey: @"DownloadFolder"];
[fDefaults setObject: @"Constant" forKey: @"DownloadChoice"];
@ -1404,7 +1404,7 @@ tr_session * fHandle;
{
if (code == NSOKButton)
{
NSString * folder = [[openPanel filenames] objectAtIndex: 0];
NSString * folder = [[[openPanel URLs] objectAtIndex: 0] path];
[fDefaults setObject: folder forKey: @"IncompleteDownloadFolder"];
tr_sessionSetIncompleteDir(fHandle, [folder UTF8String]);
@ -1421,7 +1421,7 @@ tr_session * fHandle;
if (path)
[sharedQueue removePathFromQueue: [path stringByExpandingTildeInPath]];
path = [[openPanel filenames] objectAtIndex: 0];
path = [[[openPanel URLs] objectAtIndex: 0] path];
[fDefaults setObject: path forKey: @"AutoImportDirectory"];
[sharedQueue addPath: [path stringByExpandingTildeInPath]];
@ -1437,7 +1437,7 @@ tr_session * fHandle;
{
if (code == NSOKButton)
{
NSString * filePath = [[openPanel filenames] objectAtIndex: 0];
NSString * filePath = [[[openPanel URLs] objectAtIndex: 0] path];
if ([[NSFileManager defaultManager] fileExistsAtPath: filePath]) // script file exists
{