#import "NSMutableArrayAdditions.h"
#import <Quartz/Quartz.h>
+#import "utils.h"
+
#define ROW_SMALL_HEIGHT 18.0
typedef enum
[fOutline setMenu: [self menu]];
- #warning needed?
fLock = [[NSRecursiveLock alloc] init];
+ [fLock setName: @"File Table"];
[self setTorrent: nil];
}
[fFilterText release];
fFilterText = nil;
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
[fOutline deselectAll: nil];
[fOutline reloadData];
const BOOL onLion = [NSApp isOnLionOrBetter];
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
if (onLion)
{
- [[NSAnimationContext currentContext] setCompletionHandler: ^{ [fLock unlock]; NSLog(@"called"); }];
+ [[NSAnimationContext currentContext] setCompletionHandler: ^{ [fLock unlock]; }];
[NSAnimationContext beginGrouping];
[fOutline beginUpdates];
{
[fTorrent updateFileStat];
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
[fOutline reloadData];
- (void) setCheck: (id) sender
{
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
NSInteger state = [sender tag] == FILE_UNCHECK_TAG ? NSOffState : NSOnState;
- (void) setOnlySelectedCheck: (id) sender
{
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
NSIndexSet * indexSet = [fOutline selectedRowIndexes];
NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet];
priority = TR_PRI_LOW;
}
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
NSIndexSet * indexSet = [fOutline selectedRowIndexes];
NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet];
- (void) revealFile: (id) sender
{
- [fLock lock];
+ while (![fLock tryLock])
+ tr_wait_msec(100);
NSIndexSet * indexes = [fOutline selectedRowIndexes];
if ([NSApp isOnSnowLeopardOrBetter])