[tasque/transition: 192/213] [RTM] Backend: Implement OnDeleteTask override



commit 58cf1022ae720b81b1655604450d83e5226e1b40
Author: Antonius Riha <antoniusriha gmail com>
Date:   Sun Aug 19 11:02:29 2012 +0200

    [RTM] Backend: Implement OnDeleteTask override

 src/Addins/RtmBackend/RtmBackend.cs |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)
---
diff --git a/src/Addins/RtmBackend/RtmBackend.cs b/src/Addins/RtmBackend/RtmBackend.cs
index c8aa8c5..8574299 100644
--- a/src/Addins/RtmBackend/RtmBackend.cs
+++ b/src/Addins/RtmBackend/RtmBackend.cs
@@ -79,34 +79,19 @@ namespace Tasque.Backends.RtmBackend
 			return rtmTask;
 		}
 		
-		public void DeleteTask (Task task)
+		protected override void OnDeleteTask (Task task)
 		{
-			RtmTask rtmTask = task as RtmTask;
+			var rtmTask = task as RtmTask;
 			if (rtm != null) {
 				try {
-					rtm.TasksDelete (
-						timeline,
-						rtmTask.ListID,
-						rtmTask.SeriesTaskID,
-						rtmTask.TaskTaskID
-					);
-
-					lock (taskLock) {
-						Gtk.Application.Invoke (delegate {
-							if (taskIters.ContainsKey (rtmTask.ID)) {
-								Gtk.TreeIter iter = taskIters [rtmTask.ID];
-								Tasks.Remove (ref iter);
-								taskIters.Remove (rtmTask.ID);
-							}
-						}
-						);
-					}
+					rtm.TasksDelete (timeline, rtmTask.ListID, rtmTask.SeriesTaskID, rtmTask.TaskTaskID);
 				} catch (Exception e) {
 					Debug.WriteLine ("Unable to delete task: " + task.Name);
 					Debug.WriteLine (e.ToString ());
 				}
 			} else
 				throw new Exception ("Unable to communicate with Remember The Milk");
+			base.OnDeleteTask (task);
 		}
 		
 		public override void Refresh ()



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