[gnome-todo] eds: remove task from tasklist if fails to create



commit 548d5da2d57538eb651bf760ca8013f4ada2ba01
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Oct 8 11:53:57 2016 -0300

    eds: remove task from tasklist if fails to create

 plugins/eds/gtd-provider-eds.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/eds/gtd-provider-eds.c b/plugins/eds/gtd-provider-eds.c
index c2abfcd..cfb8a64 100644
--- a/plugins/eds/gtd-provider-eds.c
+++ b/plugins/eds/gtd-provider-eds.c
@@ -541,11 +541,17 @@ gtd_provider_eds_create_task_finished (GObject      *client,
 
   if (error)
     {
+      GtdTask *task = GTD_TASK (data->data);
+
       g_warning ("%s: %s: %s",
                  G_STRFUNC,
                  _("Error creating task"),
                  error->message);
 
+      /* Remove from the tasklist */
+      gtd_task_list_remove_task (gtd_task_get_list (task), task);
+
+      /* Display a notification */
       gtd_manager_emit_error_message (gtd_manager_get_default (),
                                       _("Error creating task"),
                                       error->message);


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