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/Controller.m

    r4266 r4275  
    740740            location = [torrentPath stringByDeletingLastPathComponent];
    741741       
    742         if (tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info) == TR_EDUPLICATE)
     742        tr_ctor * ctor = tr_ctorNew(fLib);
     743        tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]);
     744        if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_EDUPLICATE)
    743745        {
    744746            [self duplicateOpenAlert: [NSString stringWithUTF8String: info.name]];
     
    747749        }
    748750        tr_metainfoFree(&info);
     751        tr_ctorFree(ctor);
    749752       
    750753        if (!(torrent = [[Torrent alloc] initWithPath: torrentPath location: location deleteTorrentFile: deleteTorrent lib: fLib]))
     
    807810    int canAdd;
    808811    tr_info info;
     812    tr_ctor * ctor;
    809813    while ([files count] > 0)
    810814    {
    811815        torrentPath = [[files objectAtIndex: 0] retain];
    812         canAdd = tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info);
     816       
     817        ctor = tr_ctorNew(fLib);
     818        tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]);
     819        canAdd = tr_torrentParseFromCtor(fLib, ctor, &info);
     820        tr_ctorFree(ctor);
     821       
    813822        if (canAdd == TR_OK)
    814823            break;
     
    23222331    NSEnumerator * enumerator = [newNames objectEnumerator];
    23232332    int canAdd, count;
     2333    tr_ctor * ctor;
    23242334    while ((file = [enumerator nextObject]))
    23252335    {
    2326         canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
     2336        tr_ctor * ctor = tr_ctorNew(fLib);
     2337        tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]);
     2338        canAdd = tr_torrentParseFromCtor(fLib, ctor, NULL);
     2339        tr_ctorFree(ctor);
     2340       
    23272341        if (canAdd == TR_OK)
    23282342        {
     
    24762490        BOOL torrent = NO;
    24772491        int canAdd;
     2492        tr_ctor * ctor;
    24782493        while ((file = [enumerator nextObject]))
    24792494        {
    24802495            if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
    24812496            {
    2482                 switch (canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL))
     2497                ctor = tr_ctorNew(fLib);
     2498                tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]);
     2499                switch (tr_torrentParseFromCtor(fLib, ctor, NULL))
    24832500                {
    24842501                    case TR_OK:
     
    24922509                        torrent = YES;
    24932510                }
     2511                tr_ctorFree(ctor);
    24942512            }
    24952513        }
     
    25392557        NSEnumerator * enumerator = [files objectEnumerator];
    25402558        NSString * file;
     2559        tr_ctor * ctor;
    25412560        while ((file = [enumerator nextObject]))
    25422561        {
    25432562            if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
    25442563            {
    2545                 switch(tr_torrentParse(fLib, [file UTF8String], NULL, NULL))
     2564                ctor = tr_ctorNew(fLib);
     2565                tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]);
     2566                switch (tr_torrentParseFromCtor(fLib, ctor, NULL))
    25462567                {
    25472568                    case TR_OK:
     
    25532574                        torrent = YES;
    25542575                }
     2576                tr_ctorFree(ctor);
    25552577            }
    25562578        }
Note: See TracChangeset for help on using the changeset viewer.