1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 06:00:41 +00:00

#4694 replace more reloadData table calls with setNeedsDisplay:

This commit is contained in:
Mitchell Livingston 2012-01-04 00:36:21 +00:00
parent 16e70167d0
commit 9353eba3cd
6 changed files with 13 additions and 14 deletions

View file

@ -276,7 +276,7 @@
{ {
[fTorrent update]; [fTorrent update];
[fFileController reloadData]; [fFileController refresh];
if ([fTorrent isChecking]) if ([fTorrent isChecking])
{ {

View file

@ -45,7 +45,7 @@
- (void) setFilterText: (NSString *) text; - (void) setFilterText: (NSString *) text;
- (void) reloadData; - (void) refresh;
- (void) setCheck: (id) sender; - (void) setCheck: (id) sender;
- (void) setOnlySelectedCheck: (id) sender; - (void) setOnlySelectedCheck: (id) sender;

View file

@ -238,14 +238,14 @@ typedef enum
fFilterText = [text retain]; fFilterText = [text retain];
} }
- (void) reloadData - (void) refresh
{ {
[fTorrent updateFileStat]; [fTorrent updateFileStat];
while (![fLock tryLock]) while (![fLock tryLock])
tr_wait_msec(100); tr_wait_msec(100);
[fOutline reloadData]; [fOutline setNeedsDisplay: YES];
[fLock unlock]; [fLock unlock];
} }
@ -285,8 +285,7 @@ typedef enum
return item; return item;
} }
- (void) outlineView: (NSOutlineView *) outlineView willDisplayCell: (id) cell - (void) outlineView: (NSOutlineView *) outlineView willDisplayCell: (id) cell forTableColumn: (NSTableColumn *) tableColumn item: (id) item
forTableColumn: (NSTableColumn *) tableColumn item: (id) item
{ {
NSString * identifier = [tableColumn identifier]; NSString * identifier = [tableColumn identifier];
if ([identifier isEqualToString: @"Check"]) if ([identifier isEqualToString: @"Check"])
@ -301,8 +300,7 @@ typedef enum
else; else;
} }
- (void) outlineView: (NSOutlineView *) outlineView setObjectValue: (id) object - (void) outlineView: (NSOutlineView *) outlineView setObjectValue: (id) object forTableColumn: (NSTableColumn *) tableColumn byItem: (id) item
forTableColumn: (NSTableColumn *) tableColumn byItem: (id) item
{ {
NSString * identifier = [tableColumn identifier]; NSString * identifier = [tableColumn identifier];
if ([identifier isEqualToString: @"Check"]) if ([identifier isEqualToString: @"Check"])
@ -314,7 +312,7 @@ typedef enum
indexSet = [(FileListNode *)item indexes]; indexSet = [(FileListNode *)item indexes];
[fTorrent setFileCheckState: [object intValue] != NSOffState ? NSOnState : NSOffState forIndexes: indexSet]; [fTorrent setFileCheckState: [object intValue] != NSOffState ? NSOnState : NSOffState forIndexes: indexSet];
[fOutline reloadData]; [fOutline setNeedsDisplay: YES];
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateUI" object: nil]; [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateUI" object: nil];
} }
@ -396,7 +394,7 @@ typedef enum
[itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]];
[fTorrent setFileCheckState: state forIndexes: itemIndexes]; [fTorrent setFileCheckState: state forIndexes: itemIndexes];
[fOutline reloadData]; [fOutline setNeedsDisplay: YES];
[fLock unlock]; [fLock unlock];
} }
@ -417,7 +415,7 @@ typedef enum
[remainingItemIndexes removeIndexes: itemIndexes]; [remainingItemIndexes removeIndexes: itemIndexes];
[fTorrent setFileCheckState: NSOffState forIndexes: remainingItemIndexes]; [fTorrent setFileCheckState: NSOffState forIndexes: remainingItemIndexes];
[fOutline reloadData]; [fOutline setNeedsDisplay: YES];
[fLock unlock]; [fLock unlock];
} }
@ -446,7 +444,7 @@ typedef enum
[itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]];
[fTorrent setFilePriority: priority forIndexes: itemIndexes]; [fTorrent setFilePriority: priority forIndexes: itemIndexes];
[fOutline reloadData]; [fOutline setNeedsDisplay: YES];
[fLock unlock]; [fLock unlock];
} }

View file

@ -85,7 +85,7 @@
[torrent setFilePriority: priority forIndexes: [(FileListNode *)[self representedObject] indexes]]; [torrent setFilePriority: priority forIndexes: [(FileListNode *)[self representedObject] indexes]];
FileOutlineView * controlView = (FileOutlineView *)[self controlView]; FileOutlineView * controlView = (FileOutlineView *)[self controlView];
[controlView reloadData]; [controlView setNeedsDisplay: YES];
} }
- (void) addTrackingAreasForView: (NSView *) controlView inRect: (NSRect) cellFrame withUserInfo: (NSDictionary *) userInfo - (void) addTrackingAreasForView: (NSView *) controlView inRect: (NSRect) cellFrame withUserInfo: (NSDictionary *) userInfo

View file

@ -49,6 +49,7 @@
- (IBAction) updatedDisplayString: (id) sender - (IBAction) updatedDisplayString: (id) sender
{ {
#warning setNeedsDisplay: instead of reloadData?
[[NSNotificationCenter defaultCenter] postNotificationName: @"ReloadTorrentTable" object: nil]; [[NSNotificationCenter defaultCenter] postNotificationName: @"ReloadTorrentTable" object: nil];
} }

View file

@ -83,7 +83,7 @@
[self setupInfo]; [self setupInfo];
if ([fTorrents count] == 1) if ([fTorrents count] == 1)
[fFileController reloadData]; [fFileController refresh];
} }
- (void) saveViewSize - (void) saveViewSize