Changeset 6803
- Timestamp:
- Sep 26, 2008, 9:09:15 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/PrefsController.m
r6739 r6803 889 889 NSString * string = [components componentsJoinedByString: @","]; 890 890 891 char * error = NULL; 892 if (tr_sessionSetRPCACL(fHandle, [string UTF8String], &error)) 893 { 894 NSLog([NSString stringWithUTF8String: error]); 895 tr_free(error); 896 } 891 tr_sessionSetRPCACL(fHandle, [string UTF8String]); 897 892 } 898 893 … … 976 971 NSString * newIP = [newComponents componentsJoinedByString: @"."]; 977 972 978 //verify ip string 979 if (!tr_sessionTestRPCACL(fHandle, [[@"+" stringByAppendingString: newIP] UTF8String], NULL)) 980 { 981 NSDictionary * newDict = [NSDictionary dictionaryWithObjectsAndKeys: newIP, @"IP", 982 [oldDict objectForKey: @"Allow"], @"Allow", nil]; 983 [fRPCAccessArray replaceObjectAtIndex: row withObject: newDict]; 984 985 NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"IP" ascending: YES 986 selector: @selector(compareNumeric:)] autorelease]; 987 [fRPCAccessArray sortUsingDescriptors: [NSArray arrayWithObject: descriptor]]; 988 } 989 else 990 { 991 NSBeep(); 992 993 if ([[oldDict objectForKey: @"IP"] isEqualToString: @""]) 994 [fRPCAccessArray removeObjectAtIndex: row]; 995 } 973 NSDictionary * newDict = [NSDictionary dictionaryWithObjectsAndKeys: newIP, @"IP", 974 [oldDict objectForKey: @"Allow"], @"Allow", nil]; 975 [fRPCAccessArray replaceObjectAtIndex: row withObject: newDict]; 976 977 NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"IP" ascending: YES 978 selector: @selector(compareNumeric:)] autorelease]; 979 [fRPCAccessArray sortUsingDescriptors: [NSArray arrayWithObject: descriptor]]; 996 980 997 981 [fRPCAccessTable deselectAll: self];
Note: See TracChangeset
for help on using the changeset viewer.