~ubuntu-branches/ubuntu/natty/transmission/natty

« back to all changes in this revision

Viewing changes to macosx/Torrent.m

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda, Krzysztof Klimonda, Chris Coulson
  • Date: 2010-01-21 18:23:05 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: james.westby@ubuntu.com-20100121182305-1q0tx3lxrwiy0ahe
Tags: 1.83-0ubuntu1
[ Krzysztof Klimonda ]
* New upstream release (LP: #512391)
* Fixes bugs:
  - transmission consistently reports having downloading 115-130% of the
    required data with no corresponding corrupt download data numbers
    (LP: #499964)
* debian/patches/99_autoreconf.patch:
  - Refreshed for the new changes

[ Chris Coulson ]
* debian/patches/01_lpi.patch:
  - Updated to use a pkg-config check at configure time, and not hard
    code the library name in transmission_LDADD
* debian/patches/dont_build_libevent.patch:
  - Updated to patch configure.ac rather than configure. This stops
    it from breaking with an autoconf run (LP: #510776)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: Torrent.m 9908 2010-01-10 16:26:30Z livings124 $
 
2
 * $Id: Torrent.m 9997 2010-01-23 00:30:04Z livings124 $
3
3
 *
4
4
 * Copyright (c) 2006-2010 Transmission authors and contributors
5
5
 *
631
631
    for (NSUInteger i=0; i < oldTrackerCount; ++i)
632
632
    {
633
633
        trackerStructs[i] = fInfo->trackers[i];
634
 
        trackerStructs[i].identifier = i;
 
634
        trackerStructs[i].id = i;
635
635
    }
636
636
    
637
637
    trackerStructs[oldTrackerCount].announce = (char *)[tracker UTF8String];
638
638
    trackerStructs[oldTrackerCount].tier = trackerStructs[oldTrackerCount-1].tier + 1;
639
 
    trackerStructs[oldTrackerCount].identifier = oldTrackerCount;
 
639
    trackerStructs[oldTrackerCount].id = oldTrackerCount;
640
640
    
641
641
    const BOOL success = tr_torrentSetAnnounceList(fHandle, trackerStructs, oldTrackerCount+1);
642
642
    tr_free(trackerStructs);
652
652
    NSUInteger newCount = 0;
653
653
    for (NSUInteger i = 0; i < fInfo->trackerCount; i++)
654
654
    {
655
 
        if (![removeIdentifiers containsIndex: fInfo->trackers[i].identifier])
 
655
        if (![removeIdentifiers containsIndex: fInfo->trackers[i].id])
656
656
        {
657
657
            trackerStructs[newCount] = fInfo->trackers[i];
658
 
            trackerStructs[newCount].identifier = newCount++;
 
658
            trackerStructs[newCount].id = newCount++;
659
659
        }
660
660
    }
661
661
    
1262
1262
 
1263
1263
- (NSArray *) fileList
1264
1264
{
1265
 
    if (!fFileList && ![self isMagnet])
1266
 
        [self createFileList];
1267
 
    
1268
1265
    return fFileList;
1269
1266
}
1270
1267
 
1271
1268
- (NSArray *) flatFileList
1272
1269
{
1273
 
    if (!fFlatFileList && ![self isMagnet])
1274
 
        [self createFileList];
1275
 
    
1276
1270
    return fFlatFileList;
1277
1271
}
1278
1272
 
1449
1443
 
1450
1444
- (NSInteger) stalledMinutes
1451
1445
{
1452
 
    time_t start = fStat->startDate;
 
1446
    const time_t start = fStat->startDate;
1453
1447
    if (start == 0)
1454
1448
        return -1;
1455
1449
    
1457
1451
            * activity = [self dateActivity];
1458
1452
    
1459
1453
    NSDate * laterDate = activity ? [started laterDate: activity] : started;
1460
 
    return -1 * [laterDate timeIntervalSinceNow] / 60;
 
1454
    
 
1455
    return ABS([laterDate timeIntervalSinceNow]) / 60;
1461
1456
}
1462
1457
 
1463
1458
- (BOOL) isStalled
1596
1591
    
1597
1592
    fWaitToStart = waitToStart && [waitToStart boolValue];
1598
1593
    fResumeOnWake = NO;
 
1594
    
 
1595
    //don't do after this point - it messes with auto-group functionality
 
1596
    if (![self isMagnet])
 
1597
        [self createFileList];
1599
1598
        
1600
1599
    fGroupValue = groupValue ? [groupValue intValue] : [[GroupsController groups] groupIndexForTorrent: self]; 
1601
1600
    
1745
1744
{
1746
1745
    fStat = tr_torrentStat(fHandle);
1747
1746
    
 
1747
    [self createFileList];
 
1748
    
1748
1749
    [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self];
1749
1750
}
1750
1751