Changeset 459


Ignore:
Timestamp:
Jun 24, 2006, 6:28:50 PM (17 years ago)
Author:
livings124
Message:

Getting closer to a perfected queue.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r458 r459  
    579579        deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
    580580{
     581    //don't want any of these starting then stopping
     582    NSEnumerator * enumerator = [torrents objectEnumerator];
    581583    Torrent * torrent;
    582     NSEnumerator * enumerator = [torrents objectEnumerator];
     584    while ((torrent = [enumerator nextObject]))
     585        [torrent setWaitToStart: NO];
     586
     587    NSNumber * lowestOrderValue = [NSNumber numberWithInt: [torrents count]], * currentOrederValue;
     588
     589    enumerator = [torrents objectEnumerator];
    583590    while ((torrent = [enumerator nextObject]))
    584591    {
     
    589596        if (deleteTorrent)
    590597            [torrent trashTorrent];
     598       
     599        //determine lowest order value
     600        currentOrederValue = [torrent orderValue];
     601        if ([lowestOrderValue compare: currentOrederValue] == NSOrderedDescending)
     602            lowestOrderValue = currentOrederValue;
    591603
    592604        [torrent removeForever];
     
    594606    }
    595607    [torrents release];
     608
     609    //reset the order values if necessary
     610    if ([lowestOrderValue intValue] < [fTorrents count])
     611    {
     612        NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey:
     613                                                @"orderValue" ascending: YES] autorelease];
     614        NSArray * descriptors = [[NSArray alloc] initWithObjects: orderDescriptor, nil];
     615
     616        NSArray * tempTorrents = [fTorrents sortedArrayUsingDescriptors: descriptors];
     617        [descriptors release];
     618
     619        int i;
     620        for (i = [lowestOrderValue intValue]; i < [tempTorrents count]; i++)
     621            [[tempTorrents objectAtIndex: i] setOrderValue: i];
     622    }
    596623   
    597624    [self torrentNumberChanged];
  • trunk/macosx/English.lproj/PrefsWindow.nib/info.nib

    r455 r459  
    88        <dict>
    99                <key>28</key>
    10                 <string>321 472 535 212 0 0 1152 842 </string>
     10                <string>308 472 535 212 0 0 1152 842 </string>
    1111                <key>41</key>
    1212                <string>308 405 535 345 0 0 1152 842 </string>
     
    1919        <array>
    2020                <integer>41</integer>
     21                <integer>28</integer>
    2122        </array>
    2223        <key>IBSystem Version</key>
Note: See TracChangeset for help on using the changeset viewer.