From: Christian H. <ch...@us...> - 2003-06-02 22:30:30
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv27857 Modified Files: conversation.c gtkconv.c Log Message: Fixed some warnings found by the new sanity checks. Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.520 retrieving revision 1.521 diff -u -d -r1.520 -r1.521 --- conversation.c 2 Jun 2003 22:13:42 -0000 1.520 +++ conversation.c 2 Jun 2003 22:30:25 -0000 1.521 @@ -754,7 +754,8 @@ GaimWindowUiOps *ops; g_return_if_fail(win != NULL); - g_return_if_fail(index >= 0 &&gaim_window_get_conversation_count(win)); + g_return_if_fail(index >= 0 && + index < gaim_window_get_conversation_count(win)); ops = gaim_window_get_ui_ops(win); @@ -771,6 +772,9 @@ GaimWindowUiOps *ops; g_return_val_if_fail(win != NULL, NULL); + + if (gaim_window_get_conversation_count(win) == 0) + return NULL; ops = gaim_window_get_ui_ops(win); Index: gtkconv.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkconv.c,v retrieving revision 1.131 retrieving revision 1.132 diff -u -d -r1.131 -r1.132 --- gtkconv.c 2 Jun 2003 22:17:30 -0000 1.131 +++ gtkconv.c 2 Jun 2003 22:30:25 -0000 1.132 @@ -331,6 +331,9 @@ conv = gaim_window_get_active_conversation(win); + if (conv == NULL) + return; + gaim_conversation_set_logging(conv, gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))); } @@ -3732,10 +3735,17 @@ gaim_gtk_get_active_index(const GaimWindow *win) { GaimGtkWindow *gtkwin; + int index; gtkwin = GAIM_GTK_WINDOW(win); - return gtk_notebook_get_current_page(GTK_NOTEBOOK(gtkwin->notebook)); + index = gtk_notebook_get_current_page(GTK_NOTEBOOK(gtkwin->notebook)); + + /* + * A fix, because the first conversation may be active, but not + * appear in the notebook just yet. -- ChipX86 + */ + return (index == -1 ? 0 : index); } static GaimWindowUiOps window_ui_ops = |