Ignore:
Timestamp:
Dec 22, 2007, 3:31:22 AM (15 years ago)
Author:
livings124
Message:

get rid of all the deprecated functions for the ctor versions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/DragOverlayWindow.m

    r4183 r4275  
    8383    NSString * file;
    8484    NSEnumerator * enumerator = [files objectEnumerator];
     85    tr_ctor * ctor;
    8586    tr_info info;
    8687    while ((file = [enumerator nextObject]))
    8788    {
    88         if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame
    89             && tr_torrentParse(fLib, [file UTF8String], NULL, &info) == TR_OK)
     89        if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
    9090        {
    91             count++;
    92             size += info.totalSize;
    93             fileCount += info.fileCount;
    94            
    95             //only useful when one torrent
    96             if (count == 1)
     91            ctor = tr_ctorNew(fLib);
     92            tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]);
     93            if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_OK)
    9794            {
    98                 name = [NSString stringWithUTF8String: info.name];
    99                 folder = info.isMultifile;
     95                count++;
     96                size += info.totalSize;
     97                fileCount += info.fileCount;
     98               
     99                //only useful when one torrent
     100                if (count == 1)
     101                {
     102                    name = [NSString stringWithUTF8String: info.name];
     103                    folder = info.isMultifile;
     104                }
    100105            }
     106            tr_metainfoFree(&info);
    101107        }
    102         tr_metainfoFree(&info);
    103108    }
    104109   
Note: See TracChangeset for help on using the changeset viewer.