From: <rl...@us...> - 2006-04-20 05:19:40
|
Revision: 16072 Author: rlaager Date: 2006-04-19 22:19:34 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16072&view=rev Log Message: ----------- CID 103: Description: Variable "my_buddy" tracked as NULL was passed to a function that dereferences it. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-04-20 05:19:12 UTC (rev 16071) +++ trunk/src/gtkblist.c 2006-04-20 05:19:34 UTC (rev 16072) @@ -5377,9 +5377,7 @@ } name_cmp = gaim_utf8_strcasecmp( - (my_buddy - ? gaim_contact_get_alias(gaim_buddy_get_contact(my_buddy)) - : NULL), + gaim_contact_get_alias(gaim_buddy_get_contact(my_buddy)), (this_buddy ? gaim_contact_get_alias(gaim_buddy_get_contact(this_buddy)) : NULL)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-04-21 03:54:38
|
Revision: 16076 Author: thekingant Date: 2006-04-20 20:54:35 -0700 (Thu, 20 Apr 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16076&view=rev Log Message: ----------- When the system tray plugin is enabled and the buddy list is hidden, unhide the buddy list when unloading the plugin Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-04-21 03:06:19 UTC (rev 16075) +++ trunk/src/gtkblist.c 2006-04-21 03:54:35 UTC (rev 16076) @@ -5040,7 +5040,7 @@ if (visibility_manager_count) visibility_manager_count--; if (!visibility_manager_count) - gaim_blist_set_visible(gaim_prefs_get_bool("/gaim/gtk/blist/list_visible")); + gaim_blist_set_visible(TRUE); gaim_debug_info("gtkblist", "removed visibility manager: %d\n", visibility_manager_count); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-04-24 20:51:48
|
Revision: 16092 Author: rlaager Date: 2006-04-24 13:51:45 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16092&view=rev Log Message: ----------- Resolve (the other half of) CID 103: "Variable "this_buddy" tracked as NULL was passed to a function that dereferences it." Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-04-24 20:41:15 UTC (rev 16091) +++ trunk/src/gtkblist.c 2006-04-24 20:51:45 UTC (rev 16092) @@ -5384,7 +5384,7 @@ presence_cmp = gaim_presence_compare( gaim_buddy_get_presence(my_buddy), - gaim_buddy_get_presence(this_buddy)); + this_buddy ? gaim_buddy_get_presence(this_buddy) : NULL); if (this_buddy == NULL || (presence_cmp < 0 || This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-05-09 01:22:44
|
Revision: 16162 Author: rlaager Date: 2006-05-08 18:22:33 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16162&view=rev Log Message: ----------- SF Patch #1483688 from Sadrul "This plugs a small leak from the prpl-actions in the buddy-list's Accounts-> menu." Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-05-09 00:24:39 UTC (rev 16161) +++ trunk/src/gtkblist.c 2006-05-09 01:22:33 UTC (rev 16162) @@ -5648,7 +5648,7 @@ gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(plugin_act), action); - g_object_set_data(G_OBJECT(menuitem), "plugin_action", action); + g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", action, gaim_plugin_action_free); gtk_widget_show(menuitem); } else gaim_separator(submenu); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-05-09 04:05:20
|
Revision: 16166 Author: thekingant Date: 2006-05-08 21:05:04 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16166&view=rev Log Message: ----------- Get rid of a little warninget Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-05-09 03:29:08 UTC (rev 16165) +++ trunk/src/gtkblist.c 2006-05-09 04:05:04 UTC (rev 16166) @@ -5648,7 +5648,7 @@ gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(plugin_act), action); - g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", action, gaim_plugin_action_free); + g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", action, (GDestroyNotify)gaim_plugin_action_free); gtk_widget_show(menuitem); } else gaim_separator(submenu); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-05-12 02:34:12
|
Revision: 16178 Author: datallah Date: 2006-05-11 19:34:07 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16178&view=rev Log Message: ----------- Workaround for win32 GTK+ bug causing the maximized window size to be saved Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-05-11 17:02:46 UTC (rev 16177) +++ trunk/src/gtkblist.c 2006-05-12 02:34:07 UTC (rev 16178) @@ -212,6 +212,15 @@ else return FALSE; /* carry on normally */ +#ifdef _WIN32 + /* Workaround for GTK+ bug # 169811 - "configure_event" is fired + * when the window is being maximized */ + if (gdk_window_get_state(w->window) + & GDK_WINDOW_STATE_MAXIMIZED) { + return FALSE; + } +#endif + /* don't save if nothing changed */ if (x == gaim_prefs_get_int("/gaim/gtk/blist/x") && y == gaim_prefs_get_int("/gaim/gtk/blist/y") && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-05-29 17:54:33
|
Revision: 16202 Author: rlaager Date: 2006-05-29 10:53:50 -0700 (Mon, 29 May 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16202&view=rev Log Message: ----------- SF Patch #1496688 from coweater "Gaim wasn't removing carriage returns on a yahoo account's away message causing a rather large buddy list entry. The stripping was being done in the code for pre-gtk 2.6.0 but not newer versions. This patch adds that strip for the newer version too." Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-05-29 17:18:17 UTC (rev 16201) +++ trunk/src/gtkblist.c 2006-05-29 17:53:50 UTC (rev 16202) @@ -2938,8 +2938,10 @@ g_free(tmp); } #else - if(tmp) + if(tmp) { g_strdelimit(tmp, "\n", ' '); + gaim_str_strip_char(tmp, '\r'); + } statustext = tmp; #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-11 00:11:13
|
Revision: 16251 Author: rlaager Date: 2006-06-10 17:11:00 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16251&view=rev Log Message: ----------- Having the idle time in the buddy list mean minutes without a colon and hours:minutes with confuses me. It's quite possible I'm just dumb. Let me know if you object. I know I talked about this a couple months ago and nobody objected strongly, but I apparently never committed it. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-06-11 00:06:02 UTC (rev 16250) +++ trunk/src/gtkblist.c 2006-06-11 00:11:00 UTC (rev 16251) @@ -4162,10 +4162,7 @@ ihrs = (t - idle_secs) / 3600; imin = ((t - idle_secs) / 60) % 60; - if (ihrs > 0) - idle = g_strdup_printf("%d:%02d", ihrs, imin); - else - idle = g_strdup_printf("%d", imin); + idle = g_strdup_printf("%d:%02d", ihrs, imin); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-19 05:17:57
|
Revision: 16281 Author: rlaager Date: 2006-06-18 22:17:54 -0700 (Sun, 18 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16281&view=rev Log Message: ----------- SF Patch #1500640 from bsponline Fixes SF Bug #1493888 The bug description is: "These are the steps you need to take to reproduce the bug in beta3: 1. expand a contact. 2. re-arrange the protocol order for the contact. 3. do NOT collapse the contact. 4. hover over another contact. The other contact will auto-expand too, which it should not." Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-06-19 04:49:12 UTC (rev 16280) +++ trunk/src/gtkblist.c 2006-06-19 05:17:54 UTC (rev 16281) @@ -1659,6 +1659,11 @@ static void gaim_gtk_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, guint info, guint t) { + if (gtkblist->drag_timeout) { + g_source_remove(gtkblist->drag_timeout); + gtkblist->drag_timeout = 0; + } + if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE) && sd->data) { GaimBlistNode *n = NULL; GtkTreePath *path = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-06-27 16:28:27
|
Revision: 16358 Author: thekingant Date: 2006-06-27 09:28:20 -0700 (Tue, 27 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16358&view=rev Log 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. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-06-27 06:52:23 UTC (rev 16357) +++ trunk/src/gtkblist.c 2006-06-27 16:28:20 UTC (rev 16358) @@ -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: <aar...@us...> - 2006-07-05 17:42:12
|
Revision: 16432 Author: aaronsheldon Date: 2006-07-05 10:41:37 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16432&view=rev Log Message: ----------- Fixes potential segfaults. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-07-05 00:42:58 UTC (rev 16431) +++ trunk/src/gtkblist.c 2006-07-05 17:41:37 UTC (rev 16432) @@ -4106,14 +4106,16 @@ gboolean show = FALSE; GaimBlistNode* gnode; + g_return_if_fail(node != NULL); if (GAIM_BLIST_NODE_IS_GROUP(node)) gnode = node; - else if (GAIM_BLIST_NODE_IS_BUDDY(node)) /* maybe OR'ed with IS_CHAT? */ + else if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CHAT(node)) gnode = node->parent->parent; else if (GAIM_BLIST_NODE_IS_CONTACT(node)) gnode = node->parent; - g_return_if_fail(GAIM_BLIST_NODE_IS_GROUP(gnode)); + else + return; group = (GaimGroup*)gnode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-07-06 00:32:45
|
Revision: 16434 Author: aaronsheldon Date: 2006-07-05 17:32:38 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16434&view=rev Log Message: ----------- A group is a chat's parent, not a chat's grandparent. (Thanks, Sadrul). Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-07-05 23:55:22 UTC (rev 16433) +++ trunk/src/gtkblist.c 2006-07-06 00:32:38 UTC (rev 16434) @@ -4110,9 +4110,9 @@ if (GAIM_BLIST_NODE_IS_GROUP(node)) gnode = node; - else if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CHAT(node)) + else if (GAIM_BLIST_NODE_IS_BUDDY(node)) gnode = node->parent->parent; - else if (GAIM_BLIST_NODE_IS_CONTACT(node)) + else if (GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_CHAT(node)) gnode = node->parent; else return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-11 01:14:12
|
Revision: 16695 Author: datallah Date: 2006-08-10 18:14:07 -0700 (Thu, 10 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16695&view=rev Log Message: ----------- CID 261 (DEADCODE) Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-08-11 01:10:18 UTC (rev 16694) +++ trunk/src/gtkblist.c 2006-08-11 01:14:07 UTC (rev 16695) @@ -3002,10 +3002,8 @@ else if (!selected && !text) { text = g_strdup_printf("%s\n" - "<span color='%s' size='smaller'>%s%s%s</span>", + "<span color='%s' size='smaller'>%s</span>", esc, dim_grey(), - idletime != NULL ? idletime : "", - (idletime != NULL && statustext != NULL) ? " - " : "", statustext != NULL ? statustext : ""); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-11 01:30:27
|
Revision: 16696 Author: datallah Date: 2006-08-10 18:30:22 -0700 (Thu, 10 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16696&view=rev Log Message: ----------- Fix CID 254 - We're assuming that an account has an offline status (perhaps it isn't too bad of an assumption, but lets not make it) Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-08-11 01:14:07 UTC (rev 16695) +++ trunk/src/gtkblist.c 2006-08-11 01:30:22 UTC (rev 16696) @@ -3598,15 +3598,16 @@ hbox = gtk_hbox_new(FALSE, 0); /* Create the icon */ - status_type = gaim_account_get_status_type_with_primitive(account, - GAIM_STATUS_OFFLINE); - pixbuf = gaim_gtk_create_prpl_icon_with_status(account, status_type, 0.5); - if (pixbuf != NULL) { - image = gtk_image_new_from_pixbuf(pixbuf); - g_object_unref(pixbuf); + if ((status_type = gaim_account_get_status_type_with_primitive(account, + GAIM_STATUS_OFFLINE))) { + pixbuf = gaim_gtk_create_prpl_icon_with_status(account, status_type, 0.5); + if (pixbuf != NULL) { + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); - gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, - GAIM_HIG_BOX_SPACE); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, + GAIM_HIG_BOX_SPACE); + } } /* Create the text */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-16 03:18:48
|
Revision: 16779 Author: datallah Date: 2006-08-15 20:18:43 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16779&view=rev Log Message: ----------- It seems like I only got half of CID 261 the first time. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-08-16 02:44:21 UTC (rev 16778) +++ trunk/src/gtkblist.c 2006-08-16 03:18:43 UTC (rev 16779) @@ -2991,10 +2991,8 @@ text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); else if (!selected && !text) text = g_strdup_printf("<span color='%s'>%s</span>\n" - "<span color='%s' size='smaller'>%s%s%s</span>", + "<span color='%s' size='smaller'>%s</span>", dim_grey(), esc, dim_grey(), - idletime != NULL ? idletime : "", - (idletime != NULL && statustext != NULL) ? " - " : "", statustext != NULL ? statustext : ""); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-08-17 21:16:54
|
Revision: 16818 Author: seanegan Date: 2006-08-17 14:16:50 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16818&view=rev Log Message: ----------- Remove a g_main_iteration, replace with an idle handler. Fixes the thread freeze on expanding contacts Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-08-17 15:46:58 UTC (rev 16817) +++ trunk/src/gtkblist.c 2006-08-17 21:16:50 UTC (rev 16818) @@ -867,6 +867,24 @@ } } +struct _expand { + GtkTreeView *treeview; + GtkTreePath *path; + GaimBlistNode *node; +}; + +static gboolean +scroll_to_expanded_cell(struct _expand *ex) +{ + gtk_tree_view_scroll_to_cell(ex->treeview, ex->path, NULL, FALSE, 0, 0); + gaim_gtk_blist_update_contact(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) { @@ -875,6 +893,8 @@ GaimBlistNode *bnode; GtkTreePath *path; + struct _expand *ex = g_new0(struct _expand, 1); + if(!GAIM_BLIST_NODE_IS_CONTACT(node)) return; @@ -891,13 +911,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_contact(NULL, node->child); - gtk_tree_path_free(path); + ex->treeview = GTK_TREE_VIEW(gtkblist->treeview); + ex->path = path; + ex->node = node->child; + g_idle_add(scroll_to_expanded_cell, ex); } static void @@ -3933,6 +3952,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"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-18 03:59:07
|
Revision: 16827 Author: datallah Date: 2006-08-17 20:59:01 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16827&view=rev Log Message: ----------- 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. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-08-18 03:49:38 UTC (rev 16826) +++ trunk/src/gtkblist.c 2006-08-18 03:59:01 UTC (rev 16827) @@ -120,7 +120,6 @@ static GaimGtkBuddyList *gtkblist = NULL; static gboolean gaim_gtk_blist_refresh_timer(GaimBuddyList *list); -static void gaim_gtk_blist_update_buddy_status_icon_key(GaimBlistNode *node, GaimStatusIconSize size); static void gaim_gtk_blist_update_buddy(GaimBuddyList *list, GaimBlistNode *node, gboolean statusChange); static void gaim_gtk_blist_selection_changed(GtkTreeSelection *selection, gpointer data); static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node); @@ -141,7 +140,10 @@ GString *status_icon_key; }; +static void gaim_gtk_blist_update_buddy_status_icon_key(struct _gaim_gtk_blist_node *gtkbuddynode, + GaimBuddy *buddy, GaimStatusIconSize size); + static char dim_grey_string[8] = ""; static char *dim_grey() { @@ -167,7 +169,7 @@ else if (gtk_blist_obscured) { gtk_blist_obscured = FALSE; gaim_gtk_blist_refresh_timer(gaim_get_blist()); - } + } /* continue to handle event normally */ return FALSE; @@ -190,13 +192,13 @@ else gaim_prefs_set_bool("/gaim/gtk/blist/list_maximized", FALSE); } - + /* Refresh gtkblist if un-iconifying */ if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED){ if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)) gaim_gtk_blist_refresh_timer(gaim_get_blist()); } - + return FALSE; } @@ -873,15 +875,16 @@ GaimBlistNode *node; }; -static gboolean -scroll_to_expanded_cell(struct _expand *ex) +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_contact(NULL, ex->node); gtk_tree_path_free(ex->path); g_free(ex); - + return FALSE; } @@ -894,7 +897,7 @@ GtkTreePath *path; struct _expand *ex = g_new0(struct _expand, 1); - + if(!GAIM_BLIST_NODE_IS_CONTACT(node)) return; @@ -1675,7 +1678,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), @@ -2478,7 +2481,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 }, @@ -2723,40 +2726,28 @@ static void g_string_destroy(GString *destroyable) { g_string_free(destroyable, TRUE); - return; } static void -gaim_gtk_blist_update_buddy_status_icon_key(GaimBlistNode *node, GaimStatusIconSize size) +gaim_gtk_blist_update_buddy_status_icon_key(struct _gaim_gtk_blist_node *gtkbuddynode, GaimBuddy *buddy, GaimStatusIconSize size) { - int i; - GaimAccount *account; - GaimPlugin *prpl; - GaimPluginProtocolInfo *prpl_info; GString *key = g_string_sized_new(16); - GaimBuddy *buddy; - const char *protoname = NULL; - struct _gaim_gtk_blist_node *gtknode = node->ui_data; - struct _gaim_gtk_blist_node *gtkbuddynode = NULL; - struct _emblem_data emblems[4] = {{NULL, 15, 15}, {NULL, 0, 15}, - {NULL, 0, 0}, {NULL, 15, 0}}; - buddy = (GaimBuddy*)node; - gtkbuddynode = node->ui_data; - - if (gtkbuddynode && gtkbuddynode->recent_signonoff) { - if (GAIM_BUDDY_IS_ONLINE(buddy)) + if(gtkbuddynode && gtkbuddynode->recent_signonoff) { + if(GAIM_BUDDY_IS_ONLINE(buddy)) g_string_printf(key, "login"); else g_string_printf(key, "logout"); } else { - GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, - gaim_buddy_get_name(buddy), - gaim_buddy_get_account(buddy)); + int i; + const char *protoname = NULL; + GaimAccount *account = buddy->account; + GaimPlugin *prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); + GaimPluginProtocolInfo *prpl_info; + GaimConversation *conv; + struct _emblem_data emblems[4] = {{NULL, 15, 15}, {NULL, 0, 15}, + {NULL, 0, 0}, {NULL, 15, 0}}; - account = buddy->account; - prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); - if(!prpl) return; @@ -2766,24 +2757,26 @@ protoname = prpl_info->list_icon(account, buddy); } if(prpl_info && prpl_info->list_emblems) { - if(gtknode) - prpl_info->list_emblems(buddy, &emblems[0].filename, - &emblems[1].filename, &emblems[2].filename, - &emblems[3].filename); + prpl_info->list_emblems(buddy, &emblems[0].filename, + &emblems[1].filename, &emblems[2].filename, + &emblems[3].filename); } g_string_assign(key, protoname); + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, + gaim_buddy_get_name(buddy), account); + if(conv != NULL) { GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); - if(gtkconv != NULL && gaim_gtkconv_is_hidden(gtkconv)) { + if(gaim_gtkconv_is_hidden(gtkconv)) { /* add pending emblem */ if(size == GAIM_STATUS_ICON_SMALL) { - emblems[0].filename="pending"; + emblems[0].filename = "pending"; } else { - emblems[3].filename=emblems[2].filename; - emblems[2].filename="pending"; + emblems[3].filename = emblems[2].filename; + emblems[2].filename = "pending"; } } } @@ -2793,30 +2786,24 @@ emblems[1].filename = emblems[2].filename = emblems[3].filename = NULL; } - for(i=0; i<4; i++) { - if(emblems[i].filename) { + for(i = 0; i < 4; i++) { + if(emblems[i].filename) g_string_append_printf(key, "/%s", emblems[i].filename); - } } } - if (!GAIM_BUDDY_IS_ONLINE(buddy)) { - key = g_string_append(key, "/off"); - } else if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) { - key = g_string_append(key, "/idle"); - } - if (!gaim_privacy_check(buddy->account, gaim_buddy_get_name(buddy))) { - key = g_string_append(key, "/priv"); - } + if (!GAIM_BUDDY_IS_ONLINE(buddy)) + g_string_append(key, "/off"); + else if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) + g_string_append(key, "/idle"); - if (gtkbuddynode) { - if (gtkbuddynode->status_icon_key) - g_string_free(gtkbuddynode->status_icon_key, TRUE); - gtkbuddynode->status_icon_key = g_string_new(key->str); - } + if (!gaim_privacy_check(buddy->account, gaim_buddy_get_name(buddy))) + g_string_append(key, "/priv"); - g_string_free(key, TRUE); - return; + if (gtkbuddynode->status_icon_key) + g_string_free(gtkbuddynode->status_icon_key, TRUE); + gtkbuddynode->status_icon_key = key; + } GdkPixbuf * @@ -2854,13 +2841,13 @@ (GEqualFunc)g_string_equal, (GDestroyNotify)g_string_destroy, (GDestroyNotify)gdk_pixbuf_unref); - + } else if (buddy && gtkbuddynode->status_icon_key && gtkbuddynode->status_icon_key->str) { key = g_string_new(gtkbuddynode->status_icon_key->str); /* Respect the size request given */ if (size == GAIM_STATUS_ICON_SMALL) { - key = g_string_append(key, "/tiny"); + g_string_append(key, "/tiny"); } scale = g_hash_table_lookup(status_icon_hash_table, key); @@ -2900,8 +2887,8 @@ /* Begin Generating Lookup Key */ if (buddy) { - gaim_gtk_blist_update_buddy_status_icon_key(node, size); - g_string_printf(key, "%s", strdup(gtkbuddynode->status_icon_key->str)); + gaim_gtk_blist_update_buddy_status_icon_key(gtkbuddynode, buddy, size); + g_string_assign(key, gtkbuddynode->status_icon_key->str); } /* There are only two options for chat or gaimdude - big or small */ else if (chat) { @@ -2923,14 +2910,14 @@ g_string_append_printf(key, "%s-chat", protoname); } else - key = g_string_append(key, "gaimdude"); + g_string_append(key, "gaimdude"); /* If the icon is small, we do not store this into the status_icon_key - * in the gtkbuddynode. This way we can respect the size value on cache + * in the gtkbuddynode. This way we can respect the size value on cache * lookup. Otherwise, different sized icons could not be stored easily. */ if (size == GAIM_STATUS_ICON_SMALL) { - key = g_string_append(key, "/tiny"); + g_string_append(key, "/tiny"); } /* End Generating Lookup Key */ @@ -2945,46 +2932,46 @@ /* Create a new composite icon */ - if(buddy) { - GaimAccount *account; - GaimPlugin *prpl; - GaimPluginProtocolInfo *prpl_info; - GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, - gaim_buddy_get_name(buddy), - gaim_buddy_get_account(buddy)); + if(buddy) { + GaimAccount *account; + GaimPlugin *prpl; + GaimPluginProtocolInfo *prpl_info; + GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, + gaim_buddy_get_name(buddy), + gaim_buddy_get_account(buddy)); - account = buddy->account; + account = buddy->account; - prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); - if(!prpl) - return NULL; + prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); + if(!prpl) + return NULL; - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); - if(prpl_info && prpl_info->list_icon) { - protoname = prpl_info->list_icon(account, buddy); - } - if(prpl_info && prpl_info->list_emblems) { - if(gtknode && !gtknode->recent_signonoff) - prpl_info->list_emblems(buddy, &emblems[0].filename, - &emblems[1].filename, &emblems[2].filename, - &emblems[3].filename); - } - - if(conv != NULL) { - GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); - if(gtkconv != NULL && gaim_gtkconv_is_hidden(gtkconv)) { - /* add pending emblem */ - if(size == GAIM_STATUS_ICON_SMALL) { - emblems[0].filename="pending"; - } - else { - emblems[3].filename=emblems[2].filename; - emblems[2].filename="pending"; - } + if(prpl_info && prpl_info->list_icon) { + protoname = prpl_info->list_icon(account, buddy); + } + if(prpl_info && prpl_info->list_emblems) { + if(gtknode && !gtknode->recent_signonoff) + prpl_info->list_emblems(buddy, &emblems[0].filename, + &emblems[1].filename, &emblems[2].filename, + &emblems[3].filename); + } + + if(conv != NULL) { + GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); + if(gtkconv != NULL && gaim_gtkconv_is_hidden(gtkconv)) { + /* add pending emblem */ + if(size == GAIM_STATUS_ICON_SMALL) { + emblems[0].filename="pending"; } + else { + emblems[3].filename=emblems[2].filename; + emblems[2].filename="pending"; + } } } + } if(size == GAIM_STATUS_ICON_SMALL) { scalesize = 15; @@ -2992,8 +2979,6 @@ emblems[1].filename = emblems[2].filename = emblems[3].filename = NULL; } - - if(buddy && GAIM_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff) { filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "login.png", NULL); } else if(buddy && !GAIM_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff) { @@ -3010,8 +2995,10 @@ status = gdk_pixbuf_new_from_file(filename, NULL); g_free(filename); - if(!status) + if(!status) { + g_string_free(key, TRUE); return NULL; + } scale = gdk_pixbuf_scale_simple(status, scalesize, scalesize, GDK_INTERP_BILINEAR); @@ -3079,7 +3066,7 @@ } } - /* Insert the new icon into the status icon hash table */ + /* Insert the new icon into the status icon hash table */ g_hash_table_insert (status_icon_hash_table, key, scale); gdk_pixbuf_ref(scale); @@ -3318,7 +3305,7 @@ gtkblist->selected_node = NULL; if (get_iter_from_node(node, &iter)) { gtk_tree_store_remove(gtkblist->treemodel, &iter); - if(update && (GAIM_BLIST_NODE_IS_CONTACT(node) || + if(update && (GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CHAT(node))) { gaim_gtk_blist_update(list, node->parent); } @@ -3438,7 +3425,7 @@ return TRUE; } -static void +static void conversation_updated_cb(GaimConversation *conv, GaimConvUpdateType type, GaimGtkBuddyList *gtkblist) { @@ -3479,7 +3466,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(); @@ -4040,7 +4027,7 @@ gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); gtk_widget_set_name(gtkblist->statusbox, "gaim_gtkblist_statusbox"); gtk_widget_show(gtkblist->statusbox); - + /* set the Show Offline Buddies option. must be done * after the treeview or faceprint gets mad. -Robot101 */ @@ -4330,7 +4317,7 @@ return TRUE; } -/*This version of gaim_gtk_blist_update_group can take the original buddy +/*This version of gaim_gtk_blist_update_group can take the original buddy or a group, but has much better algorithmic performance with a pre-known buddy*/ static void gaim_gtk_blist_update_group(GaimBuddyList *list, GaimBlistNode *node) { @@ -4461,7 +4448,7 @@ cnode = node->parent; else cnode = node; - + g_return_if_fail(GAIM_BLIST_NODE_IS_CONTACT(cnode)); /* First things first, update the group */ @@ -4516,6 +4503,7 @@ { GaimBuddy *buddy; struct _gaim_gtk_blist_node *gtkparentnode; + struct _gaim_gtk_blist_node *gtknode = node->ui_data; g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); @@ -4525,7 +4513,8 @@ buddy = (GaimBuddy*)node; if (statusChange) - gaim_gtk_blist_update_buddy_status_icon_key(node, (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons") + gaim_gtk_blist_update_buddy_status_icon_key(gtknode, buddy, + (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons") ? GAIM_STATUS_ICON_LARGE : GAIM_STATUS_ICON_SMALL)); /* First things first, update the contact */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |