[tomboy] Call Save and high-profile Find on main thread



commit 9861cef7299c47434a7489222e97d2a28390b567
Author: Aaron Borden <adborden live com>
Date:   Sun Dec 18 16:28:12 2011 -0800

    Call Save and high-profile Find on main thread

 Tomboy/Synchronization/SyncManager.cs |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/Tomboy/Synchronization/SyncManager.cs b/Tomboy/Synchronization/SyncManager.cs
index 4e44ec0..b90f6b5 100644
--- a/Tomboy/Synchronization/SyncManager.cs
+++ b/Tomboy/Synchronization/SyncManager.cs
@@ -486,7 +486,9 @@ namespace Tomboy.Sync
 						// template notes (if a note with a new tag syncs
 						// before its associated template). So check by
 						// title and delete if necessary.
-						existingNote = NoteMgr.Find (noteUpdate.Title);
+						GuiUtils.GtkInvokeAndWait (() => {
+							existingNote = NoteMgr.Find (noteUpdate.Title);
+						});
 						if (existingNote != null) {
 							Logger.Debug ("SyncManager: Deleting auto-generated note: " + noteUpdate.Title);
 							RecreateNoteInMainThread (existingNote, noteUpdate);
@@ -553,13 +555,17 @@ namespace Tomboy.Sync
 						// This is a new note that has never been synchronized to the server
 						// TODO: *OR* this is a note that we lost revision info for!!!
 						// TODO: Do the above NOW!!! (don't commit this dummy)
-						note.Save ();
+						GuiUtils.GtkInvokeAndWait (() => {
+							note.Save ();
+						});
 						newOrModifiedNotes.Add (note);
 						if (syncUI != null)
 							syncUI.NoteSynchronized (note.Title, NoteSyncType.UploadNew);
 					} else if (client.GetRevision (note) <= client.LastSynchronizedRevision &&
 					                note.MetadataChangeDate > client.LastSyncDate) {
-						note.Save ();
+						GuiUtils.GtkInvokeAndWait (() => {
+							note.Save ();
+						});
 						newOrModifiedNotes.Add (note);
 						if (syncUI != null)
 							syncUI.NoteSynchronized (note.Title, NoteSyncType.UploadModified);



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