Mercurial > pidgin.yaz
comparison gtk/gtkblist.c @ 14686:7c47556216ec
[gaim-migrate @ 17438]
Fix Coverity CID 144 - return value of "get_iter_from_node" should be checked
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 07 Oct 2006 17:03:26 +0000 |
parents | 477a2d0ad133 |
children | 4138063d89c9 |
comparison
equal
deleted
inserted
replaced
14685:972ff6ca923f | 14686:7c47556216ec |
---|---|
905 struct _gaim_gtk_blist_node *gtknode; | 905 struct _gaim_gtk_blist_node *gtknode; |
906 GtkTreeIter iter, parent; | 906 GtkTreeIter iter, parent; |
907 GaimBlistNode *bnode; | 907 GaimBlistNode *bnode; |
908 GtkTreePath *path; | 908 GtkTreePath *path; |
909 | 909 |
910 struct _expand *ex = g_new0(struct _expand, 1); | |
911 | |
912 if(!GAIM_BLIST_NODE_IS_CONTACT(node)) | 910 if(!GAIM_BLIST_NODE_IS_CONTACT(node)) |
913 return; | 911 return; |
914 | 912 |
915 gtknode = (struct _gaim_gtk_blist_node *)node->ui_data; | 913 gtknode = (struct _gaim_gtk_blist_node *)node->ui_data; |
916 | 914 |
919 for(bnode = node->child; bnode; bnode = bnode->next) { | 917 for(bnode = node->child; bnode; bnode = bnode->next) { |
920 gaim_gtk_blist_update(NULL, bnode); | 918 gaim_gtk_blist_update(NULL, bnode); |
921 } | 919 } |
922 | 920 |
923 /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */ | 921 /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */ |
924 get_iter_from_node(node, &parent); | 922 if (get_iter_from_node(node, &parent)) { |
925 gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, | 923 struct _expand *ex = g_new0(struct _expand, 1); |
926 gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1); | 924 |
927 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); | 925 gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, |
928 | 926 gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1); |
929 /* Let the treeview draw so it knows where to scroll */ | 927 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
930 ex->treeview = GTK_TREE_VIEW(gtkblist->treeview); | 928 |
931 ex->path = path; | 929 /* Let the treeview draw so it knows where to scroll */ |
932 ex->node = node->child; | 930 ex->treeview = GTK_TREE_VIEW(gtkblist->treeview); |
933 g_idle_add(scroll_to_expanded_cell, ex); | 931 ex->path = path; |
932 ex->node = node->child; | |
933 g_idle_add(scroll_to_expanded_cell, ex); | |
934 } | |
934 } | 935 } |
935 | 936 |
936 static void | 937 static void |
937 gaim_gtk_blist_collapse_contact_cb(GtkWidget *w, GaimBlistNode *node) | 938 gaim_gtk_blist_collapse_contact_cb(GtkWidget *w, GaimBlistNode *node) |
938 { | 939 { |