changeset 14439:300946b0f4a2

[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 <tailor@pidgin.im>
author Gary Kramlich <grim@reaperworld.com>
date Mon, 04 Sep 2006 04:11:51 +0000
parents 01915dd6ff85
children 7c8f9b010931
files gtk/gtkblist.c
diffstat 1 files changed, 13 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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") ?