Ignore:
Timestamp:
Jul 23, 2006, 9:29:24 PM (16 years ago)
Author:
livings124
Message:

Ignore case when sorting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentTableView.m

    r680 r682  
    155155{
    156156    unichar newChar = [[event characters] characterAtIndex: 0];
    157     if (newChar == ' ' || [[NSCharacterSet alphanumericCharacterSet] characterIsMember: newChar])
     157    if (newChar == ' ' || [[NSCharacterSet alphanumericCharacterSet] characterIsMember: newChar]
     158        || [[NSCharacterSet symbolCharacterSet] characterIsMember: newChar]
     159        || [[NSCharacterSet punctuationCharacterSet] characterIsMember: newChar])
    158160    {
    159161        if ([fKeyStrokes count] > 0 && [event timestamp] - [[fKeyStrokes lastObject] timestamp] > 1.0)
     
    174176- (void) insertText: (NSString *) text
    175177{
    176     NSLog(text);
    177    
    178178    //sort torrents by name before finding closest match
    179     NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"name" ascending: YES] autorelease];
     179    NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"name" ascending: YES
     180                                            selector: @selector(caseInsensitiveCompare:)] autorelease];
    180181    NSArray * descriptors = [[NSArray alloc] initWithObjects: nameDescriptor, nil];
    181182
     
    187188    Torrent * torrent;
    188189    while ((torrent = [enumerator nextObject]))
    189     {
     190    {NSLog([[torrent name] lowercaseString]);
    190191        if ([[torrent name] caseInsensitiveCompare: text] != NSOrderedAscending)
    191192        {
Note: See TracChangeset for help on using the changeset viewer.