tasque r44 - in branches/brainshare08: . src/Backends/Sqlite



Author: calvinrg
Date: Thu Mar 20 16:23:53 2008
New Revision: 44
URL: http://svn.gnome.org/viewvc/tasque?rev=44&view=rev

Log:
* src/Backends/Sqlite/SqliteBackend.cs: added delete to SQLite backend

Modified:
   branches/brainshare08/ChangeLog
   branches/brainshare08/src/Backends/Sqlite/SqliteBackend.cs

Modified: branches/brainshare08/src/Backends/Sqlite/SqliteBackend.cs
==============================================================================
--- branches/brainshare08/src/Backends/Sqlite/SqliteBackend.cs	(original)
+++ branches/brainshare08/src/Backends/Sqlite/SqliteBackend.cs	Thu Mar 20 16:23:53 2008
@@ -112,7 +112,20 @@
 		}
 		
 		public void DeleteTask(ITask task)
-		{}
+		{
+			SqliteTask sqtask = task as SqliteTask;
+			
+			string command = String.Format("DELETE FROM Tasks WHERE ID='{0}'", sqtask.Id);
+			this.db.ExecuteScalar(command);
+
+			if(taskIters.ContainsKey(sqtask.Id)) {
+				Gtk.TreeIter iter = taskIters[sqtask.Id];
+				
+				taskStore.Remove(ref iter);
+				taskIters.Remove(sqtask.Id);
+			}
+			//Logger.Debug("Inserted task named: {0} with id {1}", name, id);			
+		}
 		
 		public void Refresh()
 		{}
@@ -249,6 +262,10 @@
 				iter = categoryListStore.Append ();
 				categoryListStore.SetValue (iter, 0, newCategory);
 
+				newCategory = new SqliteCategory (this, "Brainshare Demo 08");
+				iter = categoryListStore.Append ();
+				categoryListStore.SetValue (iter, 0, newCategory);
+				
 				newCategory = new SqliteCategory (this, "Personal");
 				iter = categoryListStore.Append ();
 				categoryListStore.SetValue (iter, 0, newCategory);



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