mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
NSArray subscripting
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
[fDefaults setObject: blocklistDate forKey: @"BlocklistNewLastUpdate"];
|
||||
[fDefaults removeObjectForKey: @"BlocklistLastUpdate"];
|
||||
|
||||
NSURL * blocklistDir = [[[[NSFileManager defaultManager] URLsForDirectory: NSApplicationDirectory inDomains: NSUserDomainMask] objectAtIndex: 0] URLByAppendingPathComponent: @"Transmission/blocklists/"];
|
||||
NSURL * blocklistDir = [[[NSFileManager defaultManager] URLsForDirectory: NSApplicationDirectory inDomains: NSUserDomainMask][0] URLByAppendingPathComponent: @"Transmission/blocklists/"];
|
||||
[[NSFileManager defaultManager] moveItemAtURL: [blocklistDir URLByAppendingPathComponent: @"level1.bin"]
|
||||
toURL: [blocklistDir URLByAppendingPathComponent: [NSString stringWithUTF8String: DEFAULT_BLOCKLIST_FILENAME]]
|
||||
error: nil];
|
||||
@@ -838,7 +838,7 @@
|
||||
{
|
||||
[fFolderPopUp selectItemAtIndex: DOWNLOAD_FOLDER];
|
||||
|
||||
NSString * folder = [[[panel URLs] objectAtIndex: 0] path];
|
||||
NSString * folder = [[panel URLs][0] path];
|
||||
[fDefaults setObject: folder forKey: @"DownloadFolder"];
|
||||
[fDefaults setBool: YES forKey: @"DownloadLocationConstant"];
|
||||
[self updateShowAddMagnetWindowField];
|
||||
@@ -867,7 +867,7 @@
|
||||
[panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) {
|
||||
if (result == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
NSString * folder = [[[panel URLs] objectAtIndex: 0] path];
|
||||
NSString * folder = [[panel URLs][0] path];
|
||||
[fDefaults setObject: folder forKey: @"IncompleteDownloadFolder"];
|
||||
|
||||
assert(folder.length > 0);
|
||||
@@ -890,7 +890,7 @@
|
||||
[panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) {
|
||||
if (result == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
NSString * filePath = [[[panel URLs] objectAtIndex: 0] path];
|
||||
NSString * filePath = [[panel URLs][0] path];
|
||||
|
||||
assert(filePath.length > 0);
|
||||
|
||||
@@ -981,7 +981,7 @@
|
||||
VDKQueue * watcherQueue = [(Controller *)[NSApp delegate] fileWatcherQueue];
|
||||
[watcherQueue removeAllPaths];
|
||||
|
||||
NSString * path = [[[panel URLs] objectAtIndex: 0] path];
|
||||
NSString * path = [[panel URLs][0] path];
|
||||
[fDefaults setObject: path forKey: @"AutoImportDirectory"];
|
||||
[watcherQueue addPath: [path stringByExpandingTildeInPath] notifyingAbout: VDKQueueNotifyAboutWrite];
|
||||
|
||||
@@ -1126,7 +1126,7 @@
|
||||
|
||||
- (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row
|
||||
{
|
||||
return [fRPCWhitelistArray objectAtIndex: row];
|
||||
return fRPCWhitelistArray[row];
|
||||
}
|
||||
|
||||
- (void) tableView: (NSTableView *) tableView setObjectValue: (id) object forTableColumn: (NSTableColumn *) tableColumn
|
||||
@@ -1164,19 +1164,19 @@
|
||||
newIP = [newComponents componentsJoinedByString: @"."];
|
||||
|
||||
//don't allow the same ip address
|
||||
if ([fRPCWhitelistArray containsObject: newIP] && ![[fRPCWhitelistArray objectAtIndex: row] isEqualToString: newIP])
|
||||
if ([fRPCWhitelistArray containsObject: newIP] && ![fRPCWhitelistArray[row] isEqualToString: newIP])
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if (valid)
|
||||
{
|
||||
[fRPCWhitelistArray replaceObjectAtIndex: row withObject: newIP];
|
||||
fRPCWhitelistArray[row] = newIP;
|
||||
[fRPCWhitelistArray sortUsingSelector: @selector(compareNumeric:)];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSBeep();
|
||||
if ([[fRPCWhitelistArray objectAtIndex: row] isEqualToString: @""])
|
||||
if ([fRPCWhitelistArray[row] isEqualToString: @""])
|
||||
[fRPCWhitelistArray removeObjectAtIndex: row];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user