Permalink
Browse files

resize the deleted notes window only when new deleted notes are actua…

…lly added
  • Loading branch information...
1 parent aa3bfb1 commit 40123597ef5923058b0239c3253eb09519a93a8b Zachary Schneirov committed Feb 1, 2010
Showing with 10 additions and 5 deletions.
  1. +10 −5 DeletionManager.m
View
@@ -67,16 +67,21 @@ - (void)addDeletedNotes:(NSArray*)array {
[self performSelector:@selector(processDeletedNotes) withObject:nil afterDelay:0];
}
+ BOOL didAddDeletedNote = NO;
unsigned int i;
for (i=0; i<[array count]; i++) {
NoteObject *aNote = [array objectAtIndex:i];
- if (![self noteFileIsAlreadyDeleted:aNote])
+ if (![self noteFileIsAlreadyDeleted:aNote]) {
[deletedNotes addObject:aNote];
+ didAddDeletedNote = YES;
+ }
}
[array makeObjectsPerformSelector:@selector(invalidateFSRef)];
- [self _updateSheetForNotes];
+ if (didAddDeletedNote) {
+ [self _updateSheetForNotes];
+ }
}
}
@@ -87,14 +92,14 @@ - (void)addDeletedNote:(NoteObject*)aNote {
[self performSelector:@selector(processDeletedNotes) withObject:nil afterDelay:0];
}
//filter dups or remove these notes from allNotes before adding them here!
- if (![self noteFileIsAlreadyDeleted:aNote])
+ if (![self noteFileIsAlreadyDeleted:aNote]) {
[deletedNotes addObject:aNote];
+ [self _updateSheetForNotes];
+ }
//clear fsref to ensure that files are re-created if they are restored
//if they are to be deleted, we don't care about them, anyway--they should already be gone
[aNote invalidateFSRef];
-
- [self _updateSheetForNotes];
}
}

0 comments on commit 4012359

Please sign in to comment.