IndexController: Add methods to stop tracking the Index

This is useful when changing large portions of the index
at once, as refreshing the tables in those cases can
become a large burden.
This commit is contained in:
Pieter de Bie
2009-04-28 16:38:54 +01:00
parent d40af770f7
commit 91c11358f1
+18
View File
@@ -12,6 +12,11 @@
#define FileChangesTableViewType @"GitFileChangedType"
@interface PBGitIndexController (PrivateMethods)
- (void)stopTrackingIndex;
- (void)resumeTrackingIndex;
@end
@implementation PBGitIndexController
@synthesize contextSize;
@@ -386,4 +391,17 @@ writeRowsWithIndexes:(NSIndexSet *)rowIndexes
return NO;
}
#pragma mark Private Methods
- (void)stopTrackingIndex
{
[stagedFilesController setAutomaticallyRearrangesObjects:NO];
[unstagedFilesController setAutomaticallyRearrangesObjects:NO];
}
- (void)resumeTrackingIndex
{
[stagedFilesController setAutomaticallyRearrangesObjects:YES];
[unstagedFilesController setAutomaticallyRearrangesObjects:YES];
[stagedFilesController rearrangeObjects];
[unstagedFilesController rearrangeObjects];
}
@end