mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Index: Don't rearrange on every object
We used to change the PBFile status every time we found a similarly named file. Because the unstagedFilesController had a filter and sort predicate for these, the array was rearranged every time an existing file was found. This quickly leads to stalling. We fix it by temporarily disabling the automatic rearranging and then reenabling it when we're finished.
This commit is contained in:
@@ -139,6 +139,7 @@
|
||||
|
||||
- (void) readOtherFiles:(NSNotification *)notification;
|
||||
{
|
||||
[unstagedFilesController setAutomaticallyRearrangesObjects:NO];
|
||||
NSArray *lines = [self linesFromNotification:notification];
|
||||
for (NSString *line in lines) {
|
||||
if ([line length] == 0)
|
||||
@@ -153,7 +154,7 @@
|
||||
file.status = NEW;
|
||||
file.hasCachedChanges = NO;
|
||||
file.hasUnstagedChanges = YES;
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +168,8 @@
|
||||
file.hasUnstagedChanges = YES;
|
||||
[files addObject: file];
|
||||
}
|
||||
|
||||
[unstagedFilesController setAutomaticallyRearrangesObjects:YES];
|
||||
[unstagedFilesController rearrangeObjects];
|
||||
[self doneProcessingIndex];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user