fix bug where inspector would reset when changing transfer state (at the cost of the inspector not updating when a group is selected and a its content changes)

This commit is contained in:
Mitchell Livingston 2008-07-01 15:11:58 +00:00
parent 51535b4bf9
commit c180a6fdf8
3 changed files with 13 additions and 26 deletions

View File

@ -2048,10 +2048,12 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
int groupValue = [torrent groupValue];
if (groupValue != oldGroupValue)
{
TorrentGroup * group = [TorrentGroup groupForIndex: groupValue];
[fDisplayedTorrents addObject: group];
TorrentGroup * group = [[TorrentGroup alloc] initWithGroup: groupValue];
groupTorrents = [group torrents];
[fDisplayedTorrents addObject: group];
[group release];
oldGroupValue = groupValue;
}
@ -2064,7 +2066,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
//actually sort
[self sortTorrentsIgnoreSelected];
[fTableView selectValues: selectedValues];
[self resetInfo]; //if group is already selected, but the torrents in it change
//[self resetInfo]; //if group is already selected, but the torrents in it change
//reset expanded/collapsed rows
if (groupRows)

View File

@ -30,7 +30,7 @@
NSMutableArray * fTorrents;
}
+ (id) groupForIndex: (int) group;
- (id) initWithGroup: (int) group;
- (NSInteger) groupIndex;
- (NSMutableArray *) torrents;

View File

@ -24,17 +24,16 @@
#import "TorrentGroup.h"
@interface TorrentGroup (Private)
- (id) initWithGroup: (int) group;
@end
@implementation TorrentGroup
+ (id) groupForIndex: (int) group
- (id) initWithGroup: (int) group
{
return [[[self alloc] initWithGroup: group] autorelease];
if ((self = [super init]))
{
fGroup = group;
fTorrents = [[NSMutableArray alloc] init];
}
return self;
}
- (void) dealloc
@ -54,17 +53,3 @@
}
@end
@implementation TorrentGroup (Private)
- (id) initWithGroup: (int) group
{
if ((self = [super init]))
{
fGroup = group;
fTorrents = [[NSMutableArray alloc] init];
}
return self;
}
@end