Changeset 6244


Ignore:
Timestamp:
Jun 22, 2008, 1:31:50 AM (14 years ago)
Author:
livings124
Message:

don't allow quick look of folders that don't exist

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r6226 r6244  
    261261- (NSArray *) quickLookURLs;
    262262- (BOOL) canQuickLook;
     263- (BOOL) canQuickLookTorrent: (Torrent *) torrent;
    263264- (NSRect) quickLookFrameWithURL: (NSURL*) url;
    264265- (void) toggleQuickLook: (id) sender;
  • trunk/macosx/Controller.m

    r6242 r6244  
    474474    [self updateUI];
    475475    fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_UI_SECONDS target: self
    476         selector: @selector(updateUI) userInfo: nil repeats: YES];
     476                selector: @selector(updateUI) userInfo: nil repeats: YES];
    477477    [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
    478478    [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
     
    41044104   
    41054105    while ((torrent = [enumerator nextObject]))
    4106     {
    4107         if ([torrent isFolder] || [torrent isComplete])
     4106        if ([self canQuickLookTorrent: torrent])
    41084107            [urlArray addObject: [NSURL fileURLWithPath: [torrent dataLocation]]];
    4109     }
    41104108   
    41114109    return urlArray;
     
    41194117   
    41204118    while ((torrent = [enumerator nextObject]))
    4121     {
    4122         if ([torrent isFolder] || [torrent isComplete])
     4119        if ([self canQuickLookTorrent: torrent])
    41234120            return YES;
    4124     }
    41254121   
    41264122    return NO;
     4123}
     4124
     4125- (BOOL) canQuickLookTorrent: (Torrent *) torrent
     4126{
     4127    if (![[NSFileManager defaultManager] fileExistsAtPath: [torrent dataLocation]])
     4128        return NO;
     4129   
     4130    return [torrent isFolder] || [torrent isComplete];
    41274131}
    41284132
  • trunk/macosx/InfoWindowController.m

    r6219 r6244  
    7272
    7373- (NSView *) tabViewForTag: (int) tag;
     74- (void) setWebSeedTableHidden: (BOOL) hide animate: (BOOL) animate;
    7475- (NSArray *) peerSortDescriptors;
    75 - (void) setWebSeedTableHidden: (BOOL) hide animate: (BOOL) animate;
     76
     77- (BOOL) canQuickLookFile: (FileListNode *) item;
    7678
    7779- (void) addTrackers;
     
    10891091    {
    10901092        FileListNode * item = [fileOutlineView itemAtRow: i];
    1091         if ([item isFolder] || [torrent fileProgress: [[item indexes] firstIndex]] == 1.0)
     1093        if ([self canQuickLookFile: item])
    10921094            [urlArray addObject: [NSURL fileURLWithPath: [folder stringByAppendingPathComponent: [item fullPath]]]];
    10931095    }
     
    11041106    int i;
    11051107    for (i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i])
    1106     {
    1107         FileListNode * item = [fileOutlineView itemAtRow: i];
    1108         if ([item isFolder] || [torrent fileProgress: [[item indexes] firstIndex]] == 1.0)
     1108        if ([self canQuickLookFile: [fileOutlineView itemAtRow: i]])
    11091109            return YES;
    1110     }
    11111110   
    11121111    return NO;
     
    16011600}
    16021601
     1602- (BOOL) canQuickLookFile: (FileListNode *) item
     1603{
     1604    Torrent * torrent = [fTorrents objectAtIndex: 0];
     1605   
     1606    if (![[NSFileManager defaultManager] fileExistsAtPath: [[torrent downloadFolder] stringByAppendingPathComponent: [item fullPath]]])
     1607        return NO;
     1608   
     1609    return [item isFolder] || [torrent fileProgress: [[item indexes] firstIndex]] == 1.0;
     1610}
     1611
    16031612- (void) addTrackers
    16041613{
  • trunk/macosx/Torrent.m

    r6215 r6244  
    258258}
    259259
    260 #warning when queue and seeding options are folded into libt, no need to call this on all torrents - use tr_torrentGetStatus
    261260- (void) update
    262261{
Note: See TracChangeset for help on using the changeset viewer.