Changeset 7318
- Timestamp:
- Dec 8, 2008, 4:11:08 AM (13 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/GroupsController.m
r7315 r7318 443 443 while ((rule = [iterator nextObject])) 444 444 { 445 NSString * type = [rule objectAtIndex: 0], * place = [rule objectAtIndex: 1], * match = [rule objectAtIndex: 2],446 * value = nil;445 NSString * type = [rule objectAtIndex: 0], * place = [rule objectAtIndex: 1], * givenValue = [rule objectAtIndex: 2]; 446 NSArray * values; 447 447 if ([type isEqualToString: @"title"]) 448 value = [torrent name];448 values = [NSArray arrayWithObject: [torrent name]]; 449 449 else if ([type isEqualToString: @"tracker"]) 450 { 451 #warning consider all trackers 452 value = [torrent trackerAddressAnnounce]; 453 } 450 values = [torrent allTrackers: NO]; 454 451 else 455 452 continue; … … 458 455 if ([place isEqualToString: @"ends"]) 459 456 options += NSBackwardsSearch; 460 461 NSRange result = [value rangeOfString: match options: options]; 462 if ([place isEqualToString: @"begins"]) 457 BOOL match = NO; 458 459 NSEnumerator * enumerator = [values objectEnumerator]; 460 NSString * value; 461 while (!match && (value = [enumerator nextObject])) 463 462 { 464 if (result.location != 0) 465 return NO; 463 NSRange result = [value rangeOfString: givenValue options: options]; 464 if ([place isEqualToString: @"begins"]) 465 { 466 if (result.location == 0) 467 match = YES; 468 } 469 else if ([place isEqualToString: @"contains"]) 470 { 471 if (result.location != NSNotFound) 472 match = YES; 473 } 474 else if ([place isEqualToString: @"ends"]) 475 { 476 if (NSMaxRange(result) == [value length]) 477 match = YES; 478 } 479 else 480 break; 466 481 } 467 else if ([place isEqualToString: @"contains"]) 468 { 469 if (result.location == NSNotFound) 470 return NO; 471 } 472 else if ([place isEqualToString: @"ends"]) 473 { 474 if (NSMaxRange(result) == [value length]) 475 return NO; 476 } 477 else 478 continue; 482 483 if (!match) 484 return NO; 479 485 } 480 486 return YES; -
trunk/macosx/GroupsPrefsController.m
r7317 r7318 227 227 [[GroupsController groups] setCustomDownloadLocation: path forIndex: index]; 228 228 [[GroupsController groups] setUsesCustomDownloadLocation: YES forIndex: index]; 229 [self updateSelectedGroup]; // 229 [self updateSelectedGroup]; //update the popup's icon/title 230 230 } 231 231 else if (!path)
Note: See TracChangeset
for help on using the changeset viewer.