[g-a-devel]Fix for at-poke crash (bug 91996)



I propose to apply the attached patch unless there are objections.

Padraig
? config.h.in
? icons/Makefile
? icons/Makefile.in
cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/at-poke/ChangeLog,v
retrieving revision 1.33
diff -u -p -r1.33 ChangeLog
--- ChangeLog	12 Sep 2002 08:52:08 -0000	1.33
+++ ChangeLog	12 Sep 2002 13:59:44 -0000
@@ -1,5 +1,16 @@
 2002-09-12  Padraig O'Briain   <padraig obriain sun com>
 
+	* src/poke.c 
+	(poker_tree_selection_changed): Set poker->selected
+	to NULL if nothing is selected
+	(poker_tree_row_collapsed): Set selected row to be the collapsed
+	row if poker->selected is NULL
+	(init_accessible_tree): Add signal handler, poker_tree_row_collapsed,
+	for row_collapsed signal.
+	This fixes bug #91996 by ensuring that there is always a selected row.
+
+2002-09-12  Padraig O'Briain   <padraig obriain sun com>
+
 	* src/main.c (main): Output informative message if unable to exec
 	gtk-demo.
 
cvs server: Diffing glade
cvs server: Diffing icons
cvs server: Diffing src
Index: src/poke.c
===================================================================
RCS file: /cvs/gnome/at-poke/src/poke.c,v
retrieving revision 1.23
diff -u -p -r1.23 poke.c
--- src/poke.c	10 Jul 2002 10:17:26 -0000	1.23
+++ src/poke.c	12 Sep 2002 13:59:45 -0000
@@ -942,6 +942,7 @@ poker_tree_selection_changed (GtkTreeSel
 	GtkTreeModel *model;
 	
 	if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
+		poker->selected = NULL;
 		return;
 	}
 
@@ -956,6 +957,14 @@ poker_tree_selection_changed (GtkTreeSel
 }
 
 static void
+poker_tree_row_collapsed (GtkTreeView *view, GtkTreeIter *iter, GtkTreePath *path, Poker *poker)
+{
+	if (!poker->selected) {
+		gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), iter);
+	}
+}
+
+static void
 refresh_clicked_cb (GtkButton *button, Poker *poker)
 {
 	update_frame_visibility (poker, poker->selected);
@@ -1078,6 +1087,12 @@ init_accessible_tree (Poker *poker, Acce
 		gtk_tree_view_get_selection (poker->tree_view),
 		"changed",
 		G_CALLBACK (poker_tree_selection_changed),
+		poker);
+
+	g_signal_connect (
+		poker->tree_view,
+		"row-collapsed",
+		G_CALLBACK (poker_tree_row_collapsed),
 		poker);
 
 	if (gtk_tree_model_get_iter_root (


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