[gnome-todo] edit-pane: save loaded task on quit



commit 9232197203cda2026283e8e2cd80ccde35a01edc
Author: Victor Toso <me victortoso com>
Date:   Sun Oct 2 23:33:42 2016 +0200

    edit-pane: save loaded task on quit
    
    If we have a loaded task with changes, we should ensure to save this
    changes before quitting gnome-todo.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772178

 src/gtd-edit-pane.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/gtd-edit-pane.c b/src/gtd-edit-pane.c
index b7fe12e..9903e8a 100644
--- a/src/gtd-edit-pane.c
+++ b/src/gtd-edit-pane.c
@@ -193,6 +193,17 @@ gtd_edit_pane_finalize (GObject *object)
 }
 
 static void
+gtd_edit_pane_dispose (GObject *object)
+{
+  GtdEditPanePrivate *priv = GTD_EDIT_PANE (object)->priv;
+
+  if (priv->task)
+    gtd_edit_pane_set_task (GTD_EDIT_PANE (object), NULL);
+
+  G_OBJECT_CLASS (gtd_edit_pane_parent_class)->dispose (object);
+}
+
+static void
 gtd_edit_pane_get_property (GObject    *object,
                             guint       prop_id,
                             GValue     *value,
@@ -237,6 +248,7 @@ gtd_edit_pane_class_init (GtdEditPaneClass *klass)
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->finalize = gtd_edit_pane_finalize;
+  object_class->dispose = gtd_edit_pane_dispose;
   object_class->get_property = gtd_edit_pane_get_property;
   object_class->set_property = gtd_edit_pane_set_property;
 


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