Changeset 3816


Ignore:
Timestamp:
Nov 13, 2007, 12:56:58 AM (15 years ago)
Author:
livings124
Message:

when dragging a file on the window, check if it has the .torrent extension; smaller changes

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/appcast.xml

    r3813 r3816  
    77    <language>en</language>
    88    <pubDate>Tue, 23 Oct 2007 23:20:00 -0400</pubDate>
    9     <lastBuildDate>Tue, 12 Nov 2007 16:22:00 -0400</lastBuildDate>
     9    <lastBuildDate>Mon, 12 Nov 2007 16:22:00 -0400</lastBuildDate>
    1010
    1111        <item>
     
    2323
    2424<h4>TRANSMISSION 0.72 AND EARLIER: COMPLETE YOUR DOWNLOADS BEFORE UPGRADING OR YOU WILL LOSE DATA!</h4>]]></description>
    25       <pubDate>Tue, 12 Nov 2007 16:22:00 -0400</pubDate>
     25      <pubDate>Mon, 12 Nov 2007 16:22:00 -0400</pubDate>
    2626      <enclosure sparkle:version="3811" sparkle:shortVersionString="0.93" url="http://mirrors.m0k.org/transmission/files/Transmission-0.93.dmg" length="2142946" type="application/octet-stream"/>
    2727    </item>
  • trunk/macosx/BadgeView.m

    r3754 r3816  
    7373        if (uploadRateString || downloadRateString)
    7474        {
    75             NSRect badgeRect;
     75            NSRect badgeRect = NSZeroRect;
    7676            badgeRect.size = [[NSImage imageNamed: @"UploadBadge"] size];
    77             badgeRect.origin = NSZeroPoint;
    7877           
    7978            //ignore shadow of badge when placing string
  • trunk/macosx/Controller.m

    r3793 r3816  
    21992199       
    22002200        //determine where to move them
    2201         int i, decrease = 0;
     2201        int i;
    22022202        for (i = [indexes firstIndex]; i < newRow && i != NSNotFound; i = [indexes indexGreaterThanIndex: i])
    22032203            newRow--;
     
    22682268        while ((file = [enumerator nextObject]))
    22692269        {
    2270             canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
    2271             if (canAdd == TR_OK)
     2270            if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
    22722271            {
    2273                 if (!fOverlayWindow)
    2274                     fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
    2275                 [fOverlayWindow setTorrents: files];
    2276                
    2277                 return NSDragOperationCopy;
     2272                switch (canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL))
     2273                {
     2274                    case TR_OK:
     2275                        if (!fOverlayWindow)
     2276                            fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
     2277                        [fOverlayWindow setTorrents: files];
     2278                       
     2279                        return NSDragOperationCopy;
     2280                   
     2281                    case TR_EDUPLICATE:
     2282                        torrent = YES;
     2283                }
    22782284            }
    2279             else if (canAdd == TR_EDUPLICATE)
    2280                 torrent = YES;
    2281             else;
    22822285        }
    22832286       
     
    23052308}
    23062309
     2310#warning when dragging a torrent file that already exists, it gives a weird result
    23072311- (void) draggingExited: (id <NSDraggingInfo>) info
    23082312{
     
    23212325        BOOL torrent = NO, accept = YES;
    23222326       
    2323         #warning replace ifs with switch
    23242327        //create an array of files that can be opened
    23252328        NSMutableArray * filesToOpen = [[NSMutableArray alloc] init];
     
    23302333        while ((file = [enumerator nextObject]))
    23312334        {
    2332             canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
    2333             if (canAdd == TR_OK)
     2335            if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
    23342336            {
    2335                 [filesToOpen addObject: file];
    2336                 torrent = YES;
     2337                switch(tr_torrentParse(fLib, [file UTF8String], NULL, NULL))
     2338                {
     2339                    case TR_OK:
     2340                        [filesToOpen addObject: file];
     2341                        torrent = YES;
     2342                        break;
     2343                       
     2344                    case TR_EDUPLICATE:
     2345                        torrent = YES;
     2346                }
    23372347            }
    2338             else if (canAdd == TR_EDUPLICATE)
    2339                 torrent = YES;
    2340             else;
    23412348        }
    23422349       
  • trunk/macosx/DragOverlayWindow.m

    r3427 r3816  
    8686    while ((file = [enumerator nextObject]))
    8787    {
    88         if (tr_torrentParse(fLib, [file UTF8String], NULL, &info) == TR_OK)
     88        if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame
     89            && tr_torrentParse(fLib, [file UTF8String], NULL, &info) == TR_OK)
    8990        {
    9091            count++;
  • trunk/macosx/Torrent.m

    r3790 r3816  
    750750- (float) notAvailableDesired
    751751{
    752     //NSLog(@"not available %f", (float)(fStat->desiredSize - fStat->desiredAvailable) / [self size]);
    753752    return (float)(fStat->desiredSize - fStat->desiredAvailable) / [self size];
    754753}
Note: See TracChangeset for help on using the changeset viewer.