# HG changeset patch # User Christian Hammond # Date 1050454747 0 # Node ID d0182ae31ab8fe3e9e2e757b70d6bab3eb3e7a16 # Parent 5425bbaa26302231798636be7c4245034cddd7be [gaim-migrate @ 5503] Okay, some code cleanups! Yay! Oh yeah, and a fix for sound and logs not being saved. The problem was, when switching conversation tabs, the menu items would update to reflect the settings of the new conversation. When doing that, the callback was being called, and the settings in the conversation were being inversed. Fun. Now they're set to whatever the menu item's state is, which is the Correct Way To Do Things (CWTDT) (C) (R) (TM) committer: Tailor Script diff -r 5425bbaa2630 -r d0182ae31ab8 src/conversation.c --- a/src/conversation.c Tue Apr 15 05:53:54 2003 +0000 +++ b/src/conversation.c Wed Apr 16 00:59:07 2003 +0000 @@ -568,22 +568,16 @@ if (win == NULL || win->ui_ops == ops) return; - if (ops != NULL) { - if (ops->get_conversation_ui_ops != NULL) - conv_ops = ops->get_conversation_ui_ops(); - } - - if (win->ui_ops != NULL) { - if (win->ui_ops->destroy_window != NULL) - win->ui_ops->destroy_window(win); - } + if (ops != NULL && ops->get_conversation_ui_ops != NULL) + conv_ops = ops->get_conversation_ui_ops(); + + if (win->ui_ops != NULL && win->ui_ops->destroy_window != NULL) + win->ui_ops->destroy_window(win); win->ui_ops = ops; - if (win->ui_ops != NULL) { - if (win->ui_ops->new_window != NULL) - win->ui_ops->new_window(win); - } + if (win->ui_ops != NULL && win->ui_ops->new_window != NULL) + win->ui_ops->new_window(win); for (l = gaim_window_get_conversations(win); l != NULL; @@ -874,7 +868,7 @@ conv->title = g_strdup(name); conv->send_history = g_list_append(NULL, NULL); conv->history = g_string_new(""); - conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, + conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); if (type == GAIM_CONV_IM) @@ -907,8 +901,8 @@ * created window. */ if (windows == NULL || - (type == GAIM_CONV_IM && !(im_options & OPT_IM_ONE_WINDOW)) || - (type == GAIM_CONV_CHAT && !(chat_options & OPT_CHAT_ONE_WINDOW))) { + (type == GAIM_CONV_IM && !(im_options & OPT_IM_ONE_WINDOW)) || + (type == GAIM_CONV_CHAT && !(chat_options & OPT_CHAT_ONE_WINDOW))) { struct gaim_window *win; win = gaim_window_new(); diff -r 5425bbaa2630 -r d0182ae31ab8 src/gtkconv.c --- a/src/gtkconv.c Tue Apr 15 05:53:54 2003 +0000 +++ b/src/gtkconv.c Wed Apr 16 00:59:07 2003 +0000 @@ -326,7 +326,8 @@ conv = gaim_window_get_active_conversation(win); - gaim_conversation_set_logging(conv, !gaim_conversation_is_logging(conv)); + gaim_conversation_set_logging(conv, + gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); } static void @@ -343,7 +344,8 @@ gtkconv = GAIM_GTK_CONVERSATION(conv); - gtkconv->make_sound = !gtkconv->make_sound; + gtkconv->make_sound = + gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); } static gboolean @@ -1662,7 +1664,9 @@ new_win = gaim_window_new(); - gaim_window_add_conversation(new_win, gaim_window_remove_conversation(win, gaim_conversation_get_index(conv))); + gaim_window_add_conversation(new_win, + gaim_window_remove_conversation(win, + gaim_conversation_get_index(conv))); gtkconv->make_sound = noisy; @@ -3684,8 +3688,10 @@ /* go back to tabless if need be */ if (gaim_window_get_conversation_count(win) <= 2) { gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkwin->notebook), - ((conv_type == GAIM_CONV_IM && im_options & OPT_IM_ONE_WINDOW) || - (conv_type == GAIM_CONV_CHAT && im_options & OPT_CHAT_ONE_WINDOW))); + ((conv_type == GAIM_CONV_IM && + (im_options & OPT_IM_ONE_WINDOW)) || + (conv_type == GAIM_CONV_CHAT && + (im_options & OPT_CHAT_ONE_WINDOW)))); }