[gnome-todo] edit-pane: fix signal emission
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] edit-pane: fix signal emission
- Date: Thu, 25 Jun 2015 01:12:30 +0000 (UTC)
commit 05402409888b818b4d5d954715b3eb7ced747631
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Jun 24 22:11:49 2015 -0300
edit-pane: fix signal emission
src/gtd-edit-pane.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gtd-edit-pane.c b/src/gtd-edit-pane.c
index 840eec7..3aaced9 100644
--- a/src/gtd-edit-pane.c
+++ b/src/gtd-edit-pane.c
@@ -34,6 +34,9 @@ typedef struct
GBinding *notes_binding;
GBinding *priority_binding;
+ /* flags */
+ gint should_save_task : 1;
+
GtdManager *manager;
GtdTask *task;
} GtdEditPanePrivate;
@@ -78,6 +81,7 @@ gtd_edit_pane__delete_button_clicked (GtkButton *button,
g_signal_emit (user_data, signals[REMOVE_TASK], 0, priv->task);
+ priv->should_save_task = FALSE;
gtd_edit_pane_set_task (GTD_EDIT_PANE (user_data), NULL);
}
@@ -91,11 +95,9 @@ gtd_edit_pane__close_button_clicked (GtkButton *button,
priv = GTD_EDIT_PANE (user_data)->priv;
- /* save the task */
- gtd_task_save (priv->task);
-
g_signal_emit (user_data, signals[EDIT_FINISHED], 0, priv->task);
+ priv->should_save_task = TRUE;
gtd_edit_pane_set_task (GTD_EDIT_PANE (user_data), NULL);
}
@@ -405,7 +407,8 @@ gtd_edit_pane_set_task (GtdEditPane *pane,
g_clear_pointer (&priv->notes_binding, g_binding_unbind);
g_clear_pointer (&priv->priority_binding, g_binding_unbind);
- g_signal_emit (pane, signals[EDIT_FINISHED], 0, priv->task);
+ if (priv->should_save_task)
+ g_signal_emit (pane, signals[EDIT_FINISHED], 0, priv->task);
}
priv->task = task;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]