Changeset 2022


Ignore:
Timestamp:
Jun 10, 2007, 4:13:02 AM (15 years ago)
Author:
livings124
Message:

better setting of file priorities internally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/macosx/Torrent.m

    r2021 r2022  
    13521352- (void) setFileCheckState: (int) state forFileItem: (NSDictionary *) item
    13531353{
    1354     #warning use index set
    13551354    if (![[item objectForKey: @"IsFolder"] boolValue])
    1356         tr_torrentSetFilePriority(fHandle, [[item objectForKey: @"Index"] intValue],
    1357                                     state == NSOnState ? TR_PRI_NORMAL : TR_PRI_DND);
     1355    {
     1356        tr_priority_t actualPriority;
     1357        if (state == NSOnState)
     1358        {
     1359            int priority = [[item objectForKey: @"Priority"] intValue];
     1360            if (priority == PRIORITY_HIGH)
     1361                actualPriority = TR_PRI_HIGH;
     1362            else if (priority == PRIORITY_LOW)
     1363                actualPriority = TR_PRI_LOW;
     1364            else
     1365                actualPriority = TR_PRI_NORMAL;
     1366        }
     1367        else
     1368            actualPriority = TR_PRI_DND;
     1369       
     1370        tr_torrentSetFilePriority(fHandle, [[item objectForKey: @"Index"] intValue], actualPriority);
     1371    }
    13581372    else
    13591373    {
Note: See TracChangeset for help on using the changeset viewer.