From 0571151c5fb8ee3eee4a865c773c520ffb7d8c58 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 27 Nov 2011 12:54:58 -0500 Subject: [PATCH] Fixed delta columns. --- cocoa/base/ResultTable.h | 4 ++-- cocoa/base/ResultTable.m | 5 ++--- cocoa/base/ResultWindow.m | 2 +- core/tests/base.py | 2 +- core_me/app.py | 2 +- core_pe/app.py | 2 +- core_se/app.py | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cocoa/base/ResultTable.h b/cocoa/base/ResultTable.h index d05a4526..f5abe5a2 100644 --- a/cocoa/base/ResultTable.h +++ b/cocoa/base/ResultTable.h @@ -14,7 +14,7 @@ http://www.hardcoded.net/licenses/bsd_license @interface ResultTable : HSTable { - NSIndexSet *_deltaColumns; + NSSet *_deltaColumns; HSColumns *columns; } - (id)initWithPy:(id)aPy view:(NSTableView *)aTableView; @@ -24,7 +24,7 @@ http://www.hardcoded.net/licenses/bsd_license - (void)setPowerMarkerMode:(BOOL)aPowerMarkerMode; - (BOOL)deltaValuesMode; - (void)setDeltaValuesMode:(BOOL)aDeltaValuesMode; -- (void)setDeltaColumns:(NSIndexSet *)aDeltaColumns; +- (void)setDeltaColumns:(NSSet *)aDeltaColumns; - (NSInteger)selectedDupeCount; - (void)removeSelected; @end; \ No newline at end of file diff --git a/cocoa/base/ResultTable.m b/cocoa/base/ResultTable.m index 53e4e79d..91f62342 100644 --- a/cocoa/base/ResultTable.m +++ b/cocoa/base/ResultTable.m @@ -85,7 +85,7 @@ http://www.hardcoded.net/licenses/bsd_license [[self py] setDeltaValuesMode:aDeltaValuesMode]; } -- (void)setDeltaColumns:(NSIndexSet *)aDeltaColumns +- (void)setDeltaColumns:(NSSet *)aDeltaColumns { [_deltaColumns release]; _deltaColumns = [aDeltaColumns retain]; @@ -165,8 +165,7 @@ http://www.hardcoded.net/licenses/bsd_license } else if (isMarkable) { if ([self deltaValuesMode]) { - NSInteger i = [[column identifier] integerValue]; - if ([_deltaColumns containsIndex:i]) { + if ([_deltaColumns containsObject:[column identifier]]) { color = [NSColor orangeColor]; } } diff --git a/cocoa/base/ResultWindow.m b/cocoa/base/ResultWindow.m index 2fe8ca62..3e47f1a2 100644 --- a/cocoa/base/ResultWindow.m +++ b/cocoa/base/ResultWindow.m @@ -31,7 +31,7 @@ http://www.hardcoded.net/licenses/bsd_license [self fillColumnsMenu]; [matches setTarget:self]; [matches setDoubleAction:@selector(openClicked:)]; - [table setDeltaColumns:[Utils array2IndexSet:[py deltaColumns]]]; + [table setDeltaColumns:[NSSet setWithArray:[py deltaColumns]]]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobCompleted:) name:JobCompletedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil]; diff --git a/core/tests/base.py b/core/tests/base.py index 596e224b..9fa9daa4 100644 --- a/core/tests/base.py +++ b/core/tests/base.py @@ -43,7 +43,7 @@ class DupeGuru(DupeGuruBase): Column('size', 'Size (KB)'), Column('extension', 'Kind'), ] - DELTA_COLUMNS = {2,} + DELTA_COLUMNS = {'size', } METADATA_TO_READ = ['size'] def __init__(self): diff --git a/core_me/app.py b/core_me/app.py index d797c3bd..e8319c8a 100644 --- a/core_me/app.py +++ b/core_me/app.py @@ -16,7 +16,7 @@ from .result_table import ResultTable class DupeGuru(DupeGuruBase): NAME = __appname__ - DELTA_COLUMNS = {2, 3, 4, 5, 7} + DELTA_COLUMNS = {'size', 'duration', 'bitrate', 'samplerate', 'mtime'} METADATA_TO_READ = ['size', 'mtime', 'duration', 'bitrate', 'samplerate', 'title', 'artist', 'album', 'genre', 'year', 'track', 'comment'] diff --git a/core_pe/app.py b/core_pe/app.py index 48afe427..da430975 100644 --- a/core_pe/app.py +++ b/core_pe/app.py @@ -24,7 +24,7 @@ def get_delta_dimensions(value, ref_value): class DupeGuru(DupeGuruBase): NAME = __appname__ - DELTA_COLUMNS = {2, 4, 5} + DELTA_COLUMNS = {'size', 'dimensions', 'mtime'} METADATA_TO_READ = ['size', 'mtime', 'dimensions'] def __init__(self, view, appdata): diff --git a/core_se/app.py b/core_se/app.py index 8c0d37fd..274f3c87 100644 --- a/core_se/app.py +++ b/core_se/app.py @@ -15,7 +15,7 @@ from .result_table import ResultTable class DupeGuru(DupeGuruBase): NAME = __appname__ - DELTA_COLUMNS = {2, 4} + DELTA_COLUMNS = {'size', 'mtime'} METADATA_TO_READ = ['size', 'mtime'] def __init__(self, view, appdata):