[Pkg-gpe-maintainers] Bug#519869: fixed in svn 9452

Timo Juhani Lindfors timo.lindfors at iki.fi
Mon Mar 16 12:15:22 UTC 2009


Hi,

upstream just informed me that this bug has been fixed in SVN revision
9452 in 2008-07-16 with the following patch:

Index: base/gpe-calendar/ChangeLog
===================================================================
--- base/gpe-calendar/ChangeLog	(revision 9451)
+++ base/gpe-calendar/ChangeLog	(revision 9452)
@@ -1,3 +1,10 @@
+2008-07-15  Graham Cobb  <g+770 at cobb.uk.net>
+
+	* main.c (event_list_consider): Fix bug 70: do not manipulate event_list_container
+	when creating/destroying event_list and switching to/from event_view if the
+	container does not exist (e.g. no sidebar).  Make event_list_hidden into a true 
+	counter: incremented if either the sidebar is disabled or the event list view is displayed.
+
 2008-07-12  Graham Cobb  <g+770 at cobb.uk.net>
 
 	* main.c (main): Initialise categories library before processing command
Index: base/gpe-calendar/main.c
===================================================================
--- base/gpe-calendar/main.c	(revision 9451)
+++ base/gpe-calendar/main.c	(revision 9452)
@@ -148,8 +148,8 @@
 static GtkContainer *calendars_container;
 static GtkTreeView *calendars;
 static gboolean event_list_disabled;
-static int event_list_hidden;
-static GtkContainer *event_list_container;
+static int event_list_hidden = 1; // Initially hidden because no sidebar
+static GtkContainer *event_list_container = NULL;
 static EventList *event_list;
 
 static int main_toolbar_width;
@@ -970,10 +970,10 @@
 	/* Already destroyed, bye.  */
 	return FALSE;
 
-      gtk_container_remove (event_list_container,
-			    GTK_BIN (event_list_container)->child);
+      g_assert(event_list_container);
+      gtk_widget_destroy(GTK_WIDGET(event_list)); // Automatically removes it from event_list_container
       event_list = NULL;
-      gtk_widget_hide (GTK_WIDGET (event_list_container));
+      if (event_list_container) gtk_widget_hide (GTK_WIDGET (event_list_container));
 
       return FALSE;
     }
@@ -984,6 +984,7 @@
 	/* Already enabled, bye.  */
 	return TRUE;
 
+      g_assert(event_list_container);
       gtk_widget_show (GTK_WIDGET (event_list_container));
 
       event_list = EVENT_LIST (event_list_create (event_db));
@@ -1035,6 +1036,8 @@
 			    GTK_BIN (sidebar_container)->child);
       gtk_widget_hide (GTK_WIDGET (sidebar_container));
 
+      event_list_hidden ++;
+
       calendar_consider ();
       calendars_consider ();
       event_list_consider ();
@@ -1093,6 +1096,8 @@
       event_list_container = GTK_CONTAINER (f);
       gtk_paned_pack2 (pane2, GTK_WIDGET (f), TRUE, TRUE);
 
+      event_list_hidden --;
+
       event_list_consider ();
 
       return TRUE;
@@ -1177,11 +1182,15 @@
       if (IS_EVENT_LIST (current_view))
         {
           event_list_hidden --;
-          event_list = EVENT_LIST (current_view);
-          gtk_widget_reparent (GTK_WIDGET (event_list),
-                       GTK_WIDGET (event_list_container));
-          event_list_set_period_box_visible (event_list, FALSE);
-          gtk_widget_show (GTK_WIDGET (event_list_container));
+	  if (!event_list_hidden) {
+	    event_list = EVENT_LIST (current_view);
+	    gtk_widget_reparent (GTK_WIDGET (event_list),
+				 GTK_WIDGET (event_list_container));
+	    event_list_set_period_box_visible (event_list, FALSE);
+	    gtk_widget_show (GTK_WIDGET (event_list_container));
+	  }
+	  else
+	    gtk_container_remove (current_view_container, current_view);
         }
       else
         gtk_container_remove (current_view_container, current_view);




best regards,
Timo Lindfors








More information about the Pkg-gpe-maintainers mailing list