From 4ab941838f7cf450a42a6ccca9b46c14250ef4de Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Fri, 17 Aug 2001 21:18:01 +0000 Subject: Don't allow nonroot nodes to be selected svn path=/trunk/; revision=12178 --- my-evolution/e-summary-preferences.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'my-evolution/e-summary-preferences.c') diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 5cd7099d36..da4f6176f4 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -917,6 +917,14 @@ weather_all_select_row_cb (GtkCTree *ctree, int column, PropertyData *pd) { + ESummaryWeatherLocation *location; + + location = gtk_ctree_node_get_row_data (GTK_CTREE (pd->weather->all), row); + if (location == NULL) { + gtk_ctree_unselect (ctree, row); + return; + } + gtk_widget_set_sensitive (pd->weather->add, TRUE); pd->weather->selected_node = row; } @@ -965,6 +973,8 @@ weather_add_clicked_cb (GtkButton *button, location = gtk_ctree_node_get_row_data (GTK_CTREE (pd->weather->all), pd->weather->selected_node); + g_return_if_fail (location != NULL); + for (p = pd->summary->preferences->stations; p; p = p->next) { if (strcmp (location->code, p->data) == 0) { return; /* Already have it */ -- cgit v1.2.3