tomboy r1745 - in trunk: . Tomboy



Author: btimothy
Date: Mon Jan  7 17:11:11 2008
New Revision: 1745
URL: http://svn.gnome.org/viewvc/tomboy?rev=1745&view=rev

Log:
2008-01-07  Boyd Timothy <btimothy gmail com> 

        * Tomboy/Note.cs: Added a boolean to track when we're
          deleting a note.  Use this boolean in the Save ()
          method from preventing any other condition from
          causing a save once Delete () has been called.



Modified:
   trunk/ChangeLog
   trunk/Tomboy/Note.cs

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Mon Jan  7 17:11:11 2008
@@ -1,3 +1,10 @@
+2008-01-07  Boyd Timothy <btimothy gmail com> 
+
+	* Tomboy/Note.cs: Added a boolean to track when we're
+	  deleting a note.  Use this boolean in the Save ()
+	  method from preventing any other condition from
+	  causing a save once Delete () has been called.
+
 2008-01-07  Sandy Armstrong <sanfordarmstrong gmail com> 
 
 	* Tomboy/ActionManager.cs: Add ActionManager.GetPlaceholderChildren method,

Modified: trunk/Tomboy/Note.cs
==============================================================================
--- trunk/Tomboy/Note.cs	(original)
+++ trunk/Tomboy/Note.cs	Mon Jan  7 17:11:11 2008
@@ -322,6 +322,7 @@
 		string filepath;
 
 		bool save_needed;
+		bool is_deleting;
 
 		NoteManager manager;
 		NoteWindow window;
@@ -360,6 +361,8 @@
 			save_timeout.Timeout += SaveTimeout;
 
 			childWidgetQueue = new Queue <ChildWidgetData> ();
+			
+			is_deleting = false;
 		}
 
 		static string UrlFromPath (string filepath)
@@ -392,6 +395,7 @@
 
 		public void Delete ()
 		{
+			is_deleting = true;
 			save_timeout.Cancel ();
 
 			// Remove the note from all the tags
@@ -419,6 +423,11 @@
 
 		public void Save ()
 		{
+			// Prevent any other condition forcing a save on the note
+			// if Delete has been called.
+			if (is_deleting)
+				return;
+			
 			// Do nothing if we don't need to save.  Avoids unneccessary saves
 			// e.g on forced quit when we call save for every note.
 			if (!save_needed)



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