aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-09-08 23:19:16 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-09-08 23:19:16 +0800
commitbd607fd9224d6c27510d8de8f68f7e70e686708c (patch)
treef3a2dff613ea5336e0bf23701ff371298cba5688 /libempathy-gtk
parent93e73142ee4d7f6f0463c1ab6ba5c6931116ab22 (diff)
downloadgsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.tar
gsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.tar.gz
gsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.tar.bz2
gsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.tar.lz
gsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.tar.xz
gsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.tar.zst
gsoc2013-empathy-bd607fd9224d6c27510d8de8f68f7e70e686708c.zip
Fix crash if there is no date for a conversation. Fixes bug #473510.
2007-09-08 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-log-window.c: Fix crash if there is no date for a conversation. Fixes bug #473510. svn path=/trunk/; revision=289
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-log-window.c121
1 files changed, 53 insertions, 68 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index b50ab9faf..da553075f 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -72,68 +72,48 @@ typedef struct {
EmpathyLogManager *log_manager;
} EmpathyLogWindow;
-static void
-log_window_destroy_cb (GtkWidget *widget,
- EmpathyLogWindow *window);
-static void
-log_window_entry_find_changed_cb (GtkWidget *entry,
- EmpathyLogWindow *window);
-static void
-log_window_find_changed_cb (GtkTreeSelection *selection,
- EmpathyLogWindow *window);
-static void
-log_window_find_populate (EmpathyLogWindow *window,
- const gchar *search_criteria);
-static void
-log_window_find_setup (EmpathyLogWindow *window);
-static void
-log_window_button_find_clicked_cb (GtkWidget *widget,
- EmpathyLogWindow *window);
-static void
-log_window_button_next_clicked_cb (GtkWidget *widget,
- EmpathyLogWindow *window);
-static void
-log_window_button_previous_clicked_cb (GtkWidget *widget,
- EmpathyLogWindow *window);
-static void
-log_window_chats_changed_cb (GtkTreeSelection *selection,
- EmpathyLogWindow *window);
-static void
-log_window_chats_populate (EmpathyLogWindow *window);
-static void
-log_window_chats_setup (EmpathyLogWindow *window);
-static void
-log_window_chats_accounts_changed_cb (GtkWidget *combobox,
- EmpathyLogWindow *window);
-static void
-log_window_chats_new_message_cb (EmpathyContact *own_contact,
- EmpathyMessage *message,
- EmpathyLogWindow *window);
-static void
-log_window_chats_set_selected (EmpathyLogWindow *window,
- McAccount *account,
- const gchar *chat_id,
- gboolean is_chatroom);
-static gboolean
-log_window_chats_get_selected (EmpathyLogWindow *window,
- McAccount **account,
- gchar **chat_id,
- gboolean *is_chatroom);
-static void
-log_window_chats_get_messages (EmpathyLogWindow *window,
- const gchar *date_to_show);
-static void
-log_window_calendar_chats_day_selected_cb (GtkWidget *calendar,
- EmpathyLogWindow *window);
-static void
-log_window_calendar_chats_month_changed_cb (GtkWidget *calendar,
- EmpathyLogWindow *window);
-static void
-log_window_entry_chats_changed_cb (GtkWidget *entry,
- EmpathyLogWindow *window);
-static void
-log_window_entry_chats_activate_cb (GtkWidget *entry,
- EmpathyLogWindow *window);
+static void log_window_destroy_cb (GtkWidget *widget,
+ EmpathyLogWindow *window);
+static void log_window_entry_find_changed_cb (GtkWidget *entry,
+ EmpathyLogWindow *window);
+static void log_window_find_changed_cb (GtkTreeSelection *selection,
+ EmpathyLogWindow *window);
+static void log_window_find_populate (EmpathyLogWindow *window,
+ const gchar *search_criteria);
+static void log_window_find_setup (EmpathyLogWindow *window);
+static void log_window_button_find_clicked_cb (GtkWidget *widget,
+ EmpathyLogWindow *window);
+static void log_window_button_next_clicked_cb (GtkWidget *widget,
+ EmpathyLogWindow *window);
+static void log_window_button_previous_clicked_cb (GtkWidget *widget,
+ EmpathyLogWindow *window);
+static void log_window_chats_changed_cb (GtkTreeSelection *selection,
+ EmpathyLogWindow *window);
+static void log_window_chats_populate (EmpathyLogWindow *window);
+static void log_window_chats_setup (EmpathyLogWindow *window);
+static void log_window_chats_accounts_changed_cb (GtkWidget *combobox,
+ EmpathyLogWindow *window);
+static void log_window_chats_new_message_cb (EmpathyContact *own_contact,
+ EmpathyMessage *message,
+ EmpathyLogWindow *window);
+static void log_window_chats_set_selected (EmpathyLogWindow *window,
+ McAccount *account,
+ const gchar *chat_id,
+ gboolean is_chatroom);
+static gboolean log_window_chats_get_selected (EmpathyLogWindow *window,
+ McAccount **account,
+ gchar **chat_id,
+ gboolean *is_chatroom);
+static void log_window_chats_get_messages (EmpathyLogWindow *window,
+ const gchar *date_to_show);
+static void log_window_calendar_chats_day_selected_cb (GtkWidget *calendar,
+ EmpathyLogWindow *window);
+static void log_window_calendar_chats_month_changed_cb (GtkWidget *calendar,
+ EmpathyLogWindow *window);
+static void log_window_entry_chats_changed_cb (GtkWidget *entry,
+ EmpathyLogWindow *window);
+static void log_window_entry_chats_activate_cb (GtkWidget *entry,
+ EmpathyLogWindow *window);
enum {
COL_FIND_ACCOUNT_ICON,
@@ -957,10 +937,15 @@ log_window_chats_get_messages (EmpathyLogWindow *window,
gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), day);
}
+
g_signal_handlers_unblock_by_func (window->calendar_chats,
log_window_calendar_chats_day_selected_cb,
window);
+ if (!date) {
+ goto OUT;
+ }
+
/* Clear all current messages shown in the textview */
empathy_chat_view_clear (window->chatview_chats);
@@ -982,12 +967,6 @@ log_window_chats_get_messages (EmpathyLogWindow *window,
}
g_list_free (messages);
- g_list_foreach (dates, (GFunc) g_free, NULL);
- g_list_free (dates);
-
- g_object_unref (account);
- g_free (chat_id);
-
/* Turn back on scrolling */
empathy_chat_view_scroll (window->chatview_find, TRUE);
@@ -996,6 +975,12 @@ log_window_chats_get_messages (EmpathyLogWindow *window,
/* Give the search entry main focus */
gtk_widget_grab_focus (window->entry_chats);
+
+OUT:
+ g_list_foreach (dates, (GFunc) g_free, NULL);
+ g_list_free (dates);
+ g_object_unref (account);
+ g_free (chat_id);
}
static void