# HG changeset patch # User Gary Kramlich # Date 1157343111 0 # Node ID 300946b0f4a229e861d22c50776a7fe0a00c7bad # Parent 01915dd6ff85d4452c449283547437a10ef9512d [gaim-migrate @ 17153] Let's not even bother creating and assigning variables until we need them and when we're sure we won't crash when already trying to get them. committer: Tailor Script diff -r 01915dd6ff85 -r 300946b0f4a2 gtk/gtkblist.c --- a/gtk/gtkblist.c Mon Sep 04 04:08:07 2006 +0000 +++ b/gtk/gtkblist.c Mon Sep 04 04:11:51 2006 +0000 @@ -4366,13 +4366,6 @@ int count; gboolean show = FALSE; GaimBlistNode* gnode; - GdkColor bgcolor; - GdkColor textcolor; - - if (gtkblist) { - bgcolor = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; - textcolor = gtkblist->treeview->style->text[GTK_STATE_ACTIVE]; - } g_return_if_fail(node != NULL); @@ -4403,12 +4396,17 @@ GtkTreeIter iter; GtkTreePath *path; gboolean expanded; - + GdkColor bgcolor; + GdkColor textcolor; + if(!insert_node(list, gnode, &iter)) return; - path = gtk_tree_model_get_path(gtkblist->treemodel, &iter); - expanded = gtk_tree_view_row_expanded(gtkblist->treeview, path); + bgcolor = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; + textcolor = gtkblist->treeview->style->text[GTK_STATE_ACTIVE]; + + path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); + expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(gtkblist->treeview), path); gtk_tree_path_free(path); esc = g_markup_escape_text(group->name, -1); @@ -4518,13 +4516,6 @@ GaimContact *contact; GaimBuddy *buddy; struct _gaim_gtk_blist_node *gtknode; - GdkColor bgcolor; - GdkColor textcolor; - - if (gtkblist) { - bgcolor = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; - textcolor = gtkblist->treeview->style->text[GTK_STATE_ACTIVE]; - } if (GAIM_BLIST_NODE_IS_BUDDY(node)) cnode = node->parent; @@ -4555,6 +4546,11 @@ GdkPixbuf *status; char *mark; char *white; + GdkColor bgcolor; + GdkColor textcolor; + + bgcolor = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; + textcolor = gtkblist->treeview->style->text[GTK_STATE_ACTIVE]; status = gaim_gtk_blist_get_status_icon(cnode, (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons") ?