]> git.0d.be Git - empathy.git/commitdiff
Adding sanity checks to public functions.
authorXavier Claessens <xclaesse@gmail.com>
Mon, 1 Oct 2007 12:30:46 +0000 (12:30 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 1 Oct 2007 12:30:46 +0000 (12:30 +0000)
2007-10-01  Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-chat-window.c: Adding sanity checks to public
functions.

svn path=/trunk/; revision=349

ChangeLog
libempathy-gtk/empathy-chat-window.c

index 7a8452521cb59e6a3dca99f396b699e0e806fbb1..a6522a34e1bfa1849ca5ee2994a670d5a20ac9fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-01  Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-chat-window.c: Adding sanity checks to public
+       functions.
+
 2007-10-01  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-accounts-dialog.c:
 2007-10-01  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-accounts-dialog.c:
index 5d5a1eafef8289464e937430172ec8c0211c5938..911fc51f3091686fe0915084eea829e61233ab8c 100644 (file)
@@ -1758,12 +1758,15 @@ empathy_chat_window_get_dialog (EmpathyChatWindow *window)
 
 void
 empathy_chat_window_add_chat (EmpathyChatWindow *window,
 
 void
 empathy_chat_window_add_chat (EmpathyChatWindow *window,
-                            EmpathyChat              *chat)
+                             EmpathyChat       *chat)
 {
        EmpathyChatWindowPriv *priv;
        GtkWidget            *label;
        GtkWidget            *child;
 
 {
        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 */
        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,
 
 void
 empathy_chat_window_remove_chat (EmpathyChatWindow *window,
-                               EmpathyChat      *chat)
+                                EmpathyChat       *chat)
 {
        EmpathyChatWindowPriv *priv;
        gint                  position;
 
 {
        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),
        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,
 
 void
 empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
-                             EmpathyChatWindow *new_window,
-                             EmpathyChat       *chat)
+                              EmpathyChatWindow *new_window,
+                              EmpathyChat       *chat)
 {
        GtkWidget *widget;
 
 {
        GtkWidget *widget;
 
@@ -1859,11 +1865,14 @@ empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
 
 void
 empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
 
 void
 empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
-                                  EmpathyChat      *chat)
+                                   EmpathyChat       *chat)
 {
        EmpathyChatWindowPriv *priv;
        gint                  page_num;
 
 {
        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),
        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,
 
 EmpathyChat *
 empathy_chat_window_find_chat (McAccount   *account,
-                             const gchar *id)
+                              const gchar *id)
 {
        GList *l;
 
 {
        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;
        for (l = chat_windows; l; l = l->next) {
                EmpathyChatWindowPriv *priv;
                EmpathyChatWindow     *window;