Mercurial > pidgin
changeset 10359:242b5482910e
[gaim-migrate @ 11577]
leak & compile warning fixes, and death-to-extra-typing-notification-pixels
from Gary.
I noticed we were installing core header files twice, so now we don't.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Mon, 13 Dec 2004 14:58:33 +0000 |
parents | 524674a4f6bb |
children | c5c5c3206fd0 |
files | src/Makefile.am src/gtkconv.c src/gtkconv.h src/status.c |
diffstat | 4 files changed, 47 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Makefile.am Mon Dec 13 06:29:45 2004 +0000 +++ b/src/Makefile.am Mon Dec 13 14:58:33 2004 +0000 @@ -177,7 +177,6 @@ session.c gaim_headers = \ - $(gaim_coreheaders) \ gaim.h \ gtkaccount.h \ gtkcellrendererprogress.h \
--- a/src/gtkconv.c Mon Dec 13 06:29:45 2004 +0000 +++ b/src/gtkconv.c Mon Dec 13 14:58:33 2004 +0000 @@ -2924,29 +2924,21 @@ gtkwin->menu.typing_icon = NULL; } if(im && gaim_conv_im_get_typing_state(im) == GAIM_TYPING) { - gtkwin->menu.typing_icon = gtk_image_menu_item_new(); - gtk_image_menu_item_set_image( - GTK_IMAGE_MENU_ITEM(gtkwin->menu.typing_icon), - gtk_image_new_from_stock(GAIM_STOCK_TYPING, - GTK_ICON_SIZE_MENU)); + gtkwin->menu.typing_icon = gtk_image_new_from_stock(GAIM_STOCK_TYPING, + GTK_ICON_SIZE_MENU); gtk_tooltips_set_tip(gtkconv->tooltips, gtkwin->menu.typing_icon, _("User is typing..."), NULL); } else if(im && gaim_conv_im_get_typing_state(im) == GAIM_TYPED) { - gtkwin->menu.typing_icon = gtk_image_menu_item_new(); - gtk_image_menu_item_set_image( - GTK_IMAGE_MENU_ITEM(gtkwin->menu.typing_icon), - gtk_image_new_from_stock(GAIM_STOCK_TYPED, - GTK_ICON_SIZE_MENU)); + gtkwin->menu.typing_icon = gtk_image_new_from_stock(GAIM_STOCK_TYPED, + GTK_ICON_SIZE_MENU); gtk_tooltips_set_tip(gtkconv->tooltips, gtkwin->menu.typing_icon, _("User has typed something and paused"), NULL); } if(gtkwin->menu.typing_icon) { - gtk_menu_item_set_right_justified( - GTK_MENU_ITEM(gtkwin->menu.typing_icon), TRUE); - gtk_widget_show_all(gtkwin->menu.typing_icon); - gtk_menu_shell_append(GTK_MENU_SHELL(gtkwin->menu.menubar), - gtkwin->menu.typing_icon); + gtk_widget_show(gtkwin->menu.typing_icon); + gtk_box_pack_end(GTK_BOX(gtkwin->menu.menubox), gtkwin->menu.typing_icon, + FALSE, FALSE, 0); } } @@ -3565,6 +3557,8 @@ { GaimGtkWindow *gtkwin; GtkAccelGroup *accel_group; + GtkWidget *box_item; + gtkwin = GAIM_GTK_WINDOW(win); accel_group = gtk_accel_group_new (); @@ -3660,6 +3654,15 @@ generate_send_as_items(win, NULL); + box_item = gtk_menu_item_new(); + gtk_menu_item_set_right_justified(GTK_MENU_ITEM(box_item), TRUE); + gtk_menu_shell_append(GTK_MENU_SHELL(gtkwin->menu.menubar), box_item); + gtk_widget_show(box_item); + + gtkwin->menu.menubox = gtk_hbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(box_item), gtkwin->menu.menubox); + gtk_widget_show(gtkwin->menu.menubox); + gtk_widget_show(gtkwin->menu.menubar); return gtkwin->menu.menubar;
--- a/src/gtkconv.h Mon Dec 13 06:29:45 2004 +0000 +++ b/src/gtkconv.h Mon Dec 13 14:58:33 2004 +0000 @@ -69,6 +69,7 @@ struct { + GtkWidget *menubox; GtkWidget *menubar; GtkWidget *view_log;
--- a/src/status.c Mon Dec 13 06:29:45 2004 +0000 +++ b/src/status.c Mon Dec 13 14:58:33 2004 +0000 @@ -1805,7 +1805,7 @@ { GaimStatusSavedSub *ret; xmlnode *node; - const char *tmp; + char *data = NULL; ret = g_new0(GaimStatusSavedSub, 1); @@ -1813,12 +1813,13 @@ node = xmlnode_get_child(substatus, "account"); if (node != NULL) { - const char *acct_name; + char *acct_name; const char *protocol; acct_name = xmlnode_get_data(node); protocol = xmlnode_get_attrib(node, "protocol"); if ((acct_name != NULL) && (protocol != NULL)) ret->account = gaim_accounts_find(acct_name, protocol); + g_free(acct_name); } if (ret->account == NULL) @@ -1830,17 +1831,20 @@ /* Read the state */ node = xmlnode_get_child(substatus, "state"); if (node != NULL) - tmp = xmlnode_get_data(node); - if (tmp != NULL) + data = xmlnode_get_data(node); + if (data != NULL) { ret->type = gaim_status_type_find_with_id(ret->account->status_types, - tmp); + data); + g_free(data); + data = NULL; + } /* Read the message */ node = xmlnode_get_child(substatus, "message"); if (node != NULL) - tmp = xmlnode_get_data(node); - if (tmp != NULL) - ret->message = g_strdup(tmp); + data = xmlnode_get_data(node); + if (data != NULL) + ret->message = data; return ret; } @@ -1874,38 +1878,42 @@ { GaimStatusSaved *ret; xmlnode *node; - const char *tmp; + const char *attrib; + char *data = NULL; int i; ret = g_new0(GaimStatusSaved, 1); /* Read the title */ - tmp = xmlnode_get_attrib(status, "name"); - if (tmp == NULL) - tmp = "No Title"; + attrib = xmlnode_get_attrib(status, "name"); + if (attrib == NULL) + attrib = "No Title"; /* Ensure the title is unique */ - ret->title = g_strdup(tmp); + ret->title = g_strdup(attrib); i = 2; while (gaim_statuses_find_saved(ret->title) != NULL) { g_free(ret->title); - ret->title = g_strdup_printf("%s %d", tmp, i); + ret->title = g_strdup_printf("%s %d", attrib, i); i++; } /* Read the primitive status type */ node = xmlnode_get_child(status, "state"); if (node != NULL) - tmp = xmlnode_get_data(node); - if (tmp != NULL) - ret->type = gaim_primitive_get_type(tmp); + data = xmlnode_get_data(node); + if (data != NULL) { + ret->type = gaim_primitive_get_type(data); + g_free(data); + data = NULL; + } /* Read the message */ node = xmlnode_get_child(status, "message"); if (node != NULL) - tmp = xmlnode_get_data(node); - if (tmp != NULL) - ret->message = g_strdup(tmp); + data = xmlnode_get_data(node); + if (data != NULL) + ret->message = data; /* Read substatuses */ for (node = xmlnode_get_child(status, "status"); node != NULL;