From e7731797506c69ab97ae6f758cc3ec1b6557456b Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 1 Oct 2007 12:30:46 +0000 Subject: Adding sanity checks to public functions. 2007-10-01 Xavier Claessens * libempathy-gtk/empathy-chat-window.c: Adding sanity checks to public functions. svn path=/trunk/; revision=349 --- libempathy-gtk/empathy-chat-window.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'libempathy-gtk/empathy-chat-window.c') diff --git a/libempathy-gtk/empathy-chat-window.c b/libempathy-gtk/empathy-chat-window.c index 5d5a1eafe..911fc51f3 100644 --- a/libempathy-gtk/empathy-chat-window.c +++ b/libempathy-gtk/empathy-chat-window.c @@ -1758,12 +1758,15 @@ empathy_chat_window_get_dialog (EmpathyChatWindow *window) void empathy_chat_window_add_chat (EmpathyChatWindow *window, - EmpathyChat *chat) + EmpathyChat *chat) { EmpathyChatWindowPriv *priv; GtkWidget *label; GtkWidget *child; + g_return_if_fail (window != NULL); + g_return_if_fail (EMPATHY_IS_CHAT (chat)); + priv = GET_PRIV (window); /* Reference the chat object */ @@ -1808,11 +1811,14 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window, void empathy_chat_window_remove_chat (EmpathyChatWindow *window, - EmpathyChat *chat) + EmpathyChat *chat) { EmpathyChatWindowPriv *priv; gint position; + g_return_if_fail (window != NULL); + g_return_if_fail (EMPATHY_IS_CHAT (chat)); + priv = GET_PRIV (window); position = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), @@ -1828,8 +1834,8 @@ empathy_chat_window_remove_chat (EmpathyChatWindow *window, void empathy_chat_window_move_chat (EmpathyChatWindow *old_window, - EmpathyChatWindow *new_window, - EmpathyChat *chat) + EmpathyChatWindow *new_window, + EmpathyChat *chat) { GtkWidget *widget; @@ -1859,11 +1865,14 @@ empathy_chat_window_move_chat (EmpathyChatWindow *old_window, void empathy_chat_window_switch_to_chat (EmpathyChatWindow *window, - EmpathyChat *chat) + EmpathyChat *chat) { EmpathyChatWindowPriv *priv; gint page_num; + g_return_if_fail (window != NULL); + g_return_if_fail (EMPATHY_IS_CHAT (chat)); + priv = GET_PRIV (window); page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), @@ -1889,10 +1898,13 @@ empathy_chat_window_has_focus (EmpathyChatWindow *window) EmpathyChat * empathy_chat_window_find_chat (McAccount *account, - const gchar *id) + const gchar *id) { GList *l; + g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL); + g_return_val_if_fail (!G_STR_EMPTY (id), NULL); + for (l = chat_windows; l; l = l->next) { EmpathyChatWindowPriv *priv; EmpathyChatWindow *window; -- cgit v1.2.3