Changeset 4879


Ignore:
Timestamp:
Jan 31, 2008, 4:02:26 AM (15 years ago)
Author:
livings124
Message:

fix up the code to get the selected torrent when a group is selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentTableView.m

    r4846 r4879  
    3434#define ACTION_MENU_LIMIT_TAG 103
    3535
    36 #define PIECE_INCREASE 0.1
     36#define PIECE_CHANGE 0.1
    3737#define PIECE_TIME 0.01
    3838
     
    314314    for (i = [selectedIndexes firstIndex]; i != NSNotFound; i = [selectedIndexes indexGreaterThanIndex: i])
    315315    {
    316        
    317316        if (![fGroupIndexes containsIndex: i])
    318317            [indexSet addIndex: i];
    319318        else
    320319        {
    321             NSUInteger nextGroup = [fGroupIndexes indexGreaterThanIndex: i],
    322                         count = (nextGroup != NSNotFound ? nextGroup : [fTorrents count]) - i - 1;
    323             [indexSet addIndexesInRange: NSMakeRange(i+1, count)];
    324             i = nextGroup-1;
     320            NSUInteger nextGroup = [fGroupIndexes indexGreaterThanIndex: i];
     321            if (nextGroup == NSNotFound)
     322                nextGroup = [fTorrents count];
     323           
     324            [indexSet addIndexesInRange: NSMakeRange(i+1, nextGroup - i - 1)];
     325           
     326             i = nextGroup - 1;
    325327        }
    326328    }
     
    331333{
    332334    int row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
    333    
    334335    if (row >= 0)
    335336    {
     
    665666{
    666667    int row = [self rowAtPoint: point];
    667     if (row < 0  || [fGroupIndexes containsIndex: row] || [fDefaults boolForKey: @"SmallView"])
     668    if (row < 0 || [fGroupIndexes containsIndex: row] || [fDefaults boolForKey: @"SmallView"])
    668669        return NO;
    669670   
     
    682683{
    683684    int row = [self rowAtPoint: point];
    684     if (row < 0  || [fGroupIndexes containsIndex: row] || ![fDefaults boolForKey: @"SmallView"])
     685    if (row < 0 || [fGroupIndexes containsIndex: row] || ![fDefaults boolForKey: @"SmallView"])
    685686        return NO;
    686687   
     
    748749    if ([fDefaults boolForKey: @"PiecesBar"])
    749750    {
    750         fPiecesBarPercent = MIN(fPiecesBarPercent + PIECE_INCREASE, 1.0);
     751        fPiecesBarPercent = MIN(fPiecesBarPercent + PIECE_CHANGE, 1.0);
    751752        done = fPiecesBarPercent == 1.0;
    752753    }
    753754    else
    754755    {
    755         fPiecesBarPercent = MAX(fPiecesBarPercent - PIECE_INCREASE, 0.0);
     756        fPiecesBarPercent = MAX(fPiecesBarPercent - PIECE_CHANGE, 0.0);
    756757        done = fPiecesBarPercent == 0.0;
    757758    }
Note: See TracChangeset for help on using the changeset viewer.