From: <the...@us...> - 2006-06-27 16:29:19
|
Revision: 16359 Author: thekingant Date: 2006-06-27 09:29:17 -0700 (Tue, 27 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16359&view=rev Log Message: ----------- Backport SVN revision #16358 from HEAD To v2_0_0 Original commit message: Fix an assertion failure when adding a buddy to your buddy list and you have an open conversation with that buddy and you don't have an icon for them. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16358&view=rev Modified Paths: -------------- branches/v2_0_0/src/gtkblist.c Modified: branches/v2_0_0/src/gtkblist.c =================================================================== --- branches/v2_0_0/src/gtkblist.c 2006-06-27 16:28:20 UTC (rev 16358) +++ branches/v2_0_0/src/gtkblist.c 2006-06-27 16:29:17 UTC (rev 16359) @@ -4461,9 +4461,10 @@ add_buddy_cb(GtkWidget *w, int resp, GaimGtkAddBuddyData *data) { const char *grp, *who, *whoalias; + GaimGroup *g; + GaimBuddy *b; GaimConversation *c; - GaimBuddy *b; - GaimGroup *g; + GaimBuddyIcon *icon; if (resp == GTK_RESPONSE_OK) { @@ -4500,7 +4501,9 @@ c = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, data->account); if (c != NULL) { - gaim_buddy_icon_update(gaim_conv_im_get_icon(GAIM_CONV_IM(c))); + icon = gaim_conv_im_get_icon(GAIM_CONV_IM(c)); + if (icon != NULL) + gaim_buddy_icon_update(icon); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-18 06:40:22
|
Revision: 16832 Author: thekingant Date: 2006-08-17 23:40:16 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16832&view=rev Log Message: ----------- Backport SVN revision 16818 and parts of 16827 from HEAD to v2_0_0 Original commit messages are below. datallah, you'll have to check if I missed anything from 16827... it was kinda hard to follow, and I think a lot of the changes were to blist efficiency code which isn't in v2_0_0. 16818: Remove a g_main_iteration, replace with an idle handler. Fixes the thread freeze on expanding contacts 16827: A couple of leak fixes, some avoidance of unnecessary memory allocation/freeing and some cleanup. There are a lot fewer changes if you ignore space changes. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16818&view=rev Modified Paths: -------------- branches/v2_0_0/src/gtkblist.c Modified: branches/v2_0_0/src/gtkblist.c =================================================================== --- branches/v2_0_0/src/gtkblist.c 2006-08-18 06:18:38 UTC (rev 16831) +++ branches/v2_0_0/src/gtkblist.c 2006-08-18 06:40:16 UTC (rev 16832) @@ -846,6 +846,25 @@ } } +struct _expand { + GtkTreeView *treeview; + GtkTreePath *path; + GaimBlistNode *node; +}; + +static gboolean +scroll_to_expanded_cell(gpointer data) +{ + struct _expand *ex = data; + gtk_tree_view_scroll_to_cell(ex->treeview, ex->path, NULL, FALSE, 0, 0); + gaim_gtk_blist_update(NULL, ex->node); + + gtk_tree_path_free(ex->path); + g_free(ex); + + return FALSE; +} + static void gaim_gtk_blist_expand_contact_cb(GtkWidget *w, GaimBlistNode *node) { @@ -854,6 +873,8 @@ GaimBlistNode *bnode; GtkTreePath *path; + struct _expand *ex = g_new0(struct _expand, 1); + if(!GAIM_BLIST_NODE_IS_CONTACT(node)) return; @@ -870,14 +891,12 @@ gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1); path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); + /* Let the treeview draw so it knows where to scroll */ - while (gtk_events_pending()) - gtk_main_iteration(); - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0); - - - gaim_gtk_blist_update(NULL, node); - gtk_tree_path_free(path); + ex->treeview = GTK_TREE_VIEW(gtkblist->treeview); + ex->path = path; + ex->node = node; + g_idle_add(scroll_to_expanded_cell, ex); } static void @@ -1636,7 +1655,7 @@ buddy->alias); } - str = g_string_append(str, "\r\n"); + g_string_append(str, "\r\n"); gtk_selection_data_set(data, gdk_atom_intern("application/x-im-contact", FALSE), @@ -2439,7 +2458,7 @@ { N_("/Buddies/Add C_hat..."), NULL, gaim_gtk_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD }, { N_("/Buddies/Add _Group..."), NULL, gaim_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD }, { "/Buddies/sep3", NULL, NULL, 0, "<Separator>", NULL }, - { N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT }, + { N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT }, /* Accounts menu */ { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL }, @@ -3242,7 +3261,7 @@ } if(tooltip_text->len > 0) { /* get rid of the last newline */ - tooltip_text = g_string_truncate(tooltip_text, tooltip_text->len -1); + g_string_truncate(tooltip_text, tooltip_text->len -1); img = gtk_image_new_from_stock(GAIM_STOCK_PENDING, GTK_ICON_SIZE_MENU); gtkblist->menutrayicon = gtk_event_box_new(); @@ -3715,6 +3734,8 @@ G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER); gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW(gtkblist->treeview), TRUE); + gtk_widget_show(gtkblist->treeview); gtk_widget_set_name(gtkblist->treeview, "gaim_gtkblist_treeview"); @@ -3800,9 +3821,9 @@ gtkblist->statusbox = gtk_gaim_status_box_new(); gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); gtk_widget_set_name(gtkblist->statusbox, "gaim_gtkblist_statusbox"); - gtk_gaim_status_box_set_buddy_icon(gtkblist->statusbox, gaim_prefs_get_string("/gaim/gtk/accounts/buddyicon")); + gtk_gaim_status_box_set_buddy_icon(GTK_GAIM_STATUS_BOX(gtkblist->statusbox), gaim_prefs_get_string("/gaim/gtk/accounts/buddyicon")); gtk_widget_show(gtkblist->statusbox); - + /* set the Show Offline Buddies option. must be done * after the treeview or faceprint gets mad. -Robot101 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |