[tomboy] Improve speed while deleting 100+ notes. #518431 The problem was that RecentChanges was updating th



commit d7bdc43f2fc196f57b9501248c2a426159ab9a6c
Author: Jared Jennings <jjennings src gnome org>
Date:   Sat May 26 23:05:09 2012 -0500

    Improve speed while deleting 100+ notes. #518431 The problem
     was that RecentChanges was updating the search results
     after every delete. It's not perfect, but it now takes
     about 00:00.015 per note instead of 00:00.100.

 Tomboy/RecentChanges.cs |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/Tomboy/RecentChanges.cs b/Tomboy/RecentChanges.cs
index 1a7f41c..819d701 100644
--- a/Tomboy/RecentChanges.cs
+++ b/Tomboy/RecentChanges.cs
@@ -150,7 +150,7 @@ namespace Tomboy
 			status_bar.Show ();
 
 			// Update on changes to notes
-			manager.NoteDeleted += OnNotesChanged;
+			manager.NoteDeleted += OnNotesDeleted;
 			manager.NoteAdded += OnNotesChanged;
 			manager.NoteRenamed += OnNoteRenamed;
 			manager.NoteSaved += OnNoteSaved;
@@ -725,6 +725,11 @@ namespace Tomboy
 		{
 			PerformSearch ();
 		}
+		
+		void OnNotesDeleted (object sender, Note deleted)
+		{
+			RestoreMatchesWindow ();
+		}
 
 		void OnNotesChanged (object sender, Note changed)
 		{
@@ -1098,8 +1103,9 @@ namespace Tomboy
 			List<Note> selected_notes = GetSelectedNotes ();
 			if (selected_notes == null || selected_notes.Count == 0)
 				return;
-
-	       		NoteUtils.ShowDeletionDialog (selected_notes, this);
+			
+			NoteUtils.ShowDeletionDialog (selected_notes, this);
+			UpdateResults (); //Update results after all notes have been deleted
 		}
 
 		void OnCloseWindow (object sender, EventArgs args)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]