mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#55 state:fixed] fixed a crash after makeReference when the action would make the dupe list smaller.
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40161
This commit is contained in:
parent
e7cdec93c0
commit
f739580db0
@ -244,9 +244,19 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
- (IBAction)switchSelected:(id)sender
|
||||
{
|
||||
// It might look like a complicated way to get the length of the current dupe list on the py side
|
||||
// but after a lot of fussing around, believe it or not, it actually is.
|
||||
int matchesTag = _powerMode ? 2 : 0;
|
||||
int startLen = [[py getOutlineView:matchesTag childCountsForPath:[NSArray array]] count];
|
||||
[self performPySelection:[self getSelectedPaths:YES]];
|
||||
[py makeSelectedReference];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsUpdatedNotification object:self];
|
||||
// In some cases (when in a filtered view in Power Marker mode, it's possible that the demoted
|
||||
// ref is not a part of the filter, making the table smaller. In those cases, we want to do a
|
||||
// complete reload of the table to avoid a crash.
|
||||
if ([[py getOutlineView:matchesTag childCountsForPath:[NSArray array]] count] == startLen)
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsUpdatedNotification object:self];
|
||||
else
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
|
||||
}
|
||||
|
||||
- (IBAction)togglePowerMarker:(id)sender
|
||||
|
Loading…
x
Reference in New Issue
Block a user