[gnome-todo] task-row: don't warn when removing hidden row



commit abd9cc311fe81a154c16a32a6cb94bf577514130
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Feb 29 22:56:45 2016 -0300

    task-row: don't warn when removing hidden row

 src/gtd-task-row.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/gtd-task-row.c b/src/gtd-task-row.c
index 4dbd075..0c18576 100644
--- a/src/gtd-task-row.c
+++ b/src/gtd-task-row.c
@@ -667,12 +667,18 @@ void
 gtd_task_row_destroy (GtdTaskRow *row)
 {
   g_return_if_fail (GTD_IS_TASK_ROW (row));
-  g_return_if_fail (gtk_revealer_get_child_revealed (row->priv->revealer));
 
-  g_signal_connect_swapped (row->priv->revealer,
-                            "notify::child-revealed",
-                            G_CALLBACK (gtk_widget_destroy),
-                            row);
+  if (gtk_revealer_get_child_revealed (row->priv->revealer))
+    {
+      gtk_widget_destroy (GTK_WIDGET (row));
+    }
+  else
+    {
+      g_signal_connect_swapped (row->priv->revealer,
+                                "notify::child-revealed",
+                                G_CALLBACK (gtk_widget_destroy),
+                                row);
 
-  gtk_revealer_set_reveal_child (row->priv->revealer, FALSE);
+      gtk_revealer_set_reveal_child (row->priv->revealer, FALSE);
+    }
 }


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