diff options
author | Sankar P <psankar@novell.com> | 2008-06-20 18:37:08 +0800 |
---|---|---|
committer | Sankarasivasubramanian Pasupathilingam <psankar@src.gnome.org> | 2008-06-20 18:37:08 +0800 |
commit | fff94b888b4a28cf757b94732a1909973abc165e (patch) | |
tree | 1da6057e9287201f5f9284f9c5527fb118464025 /plugins | |
parent | 93117671d6bf682f22c4ead67c2fb4c080b157dd (diff) | |
download | gsoc2013-evolution-fff94b888b4a28cf757b94732a1909973abc165e.tar.gz gsoc2013-evolution-fff94b888b4a28cf757b94732a1909973abc165e.tar.zst gsoc2013-evolution-fff94b888b4a28cf757b94732a1909973abc165e.zip |
Check if cnc is valid before using it. Fixes a crash.
2008-06-20 Sankar P <psankar@novell.com>
* mail-retract.c (retract_mail_settings):
Check if cnc is valid before using it.
Fixes a crash.
svn path=/trunk/; revision=35656
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/groupwise-features/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/groupwise-features/mail-retract.c | 41 |
2 files changed, 28 insertions, 19 deletions
diff --git a/plugins/groupwise-features/ChangeLog b/plugins/groupwise-features/ChangeLog index ceef737d5e..a88c62d7c5 100644 --- a/plugins/groupwise-features/ChangeLog +++ b/plugins/groupwise-features/ChangeLog @@ -1,3 +1,9 @@ +2008-06-20 Sankar P <psankar@novell.com> + + * mail-retract.c (retract_mail_settings): + Check if cnc is valid before using it. + Fixes a crash. + 2008-06-19 Sankar P <psankar@novell.com> * mail-retract.c (retract_mail_settings): diff --git a/plugins/groupwise-features/mail-retract.c b/plugins/groupwise-features/mail-retract.c index a9219c2038..0ac6862916 100644 --- a/plugins/groupwise-features/mail-retract.c +++ b/plugins/groupwise-features/mail-retract.c @@ -45,35 +45,38 @@ static void retract_mail_settings (EPopup *ep, EPopupItem *item, void *data) GtkWidget *confirm_dialog, *confirm_warning; cnc = get_cnc (store); - id = (char *)item->user_data; - confirm_dialog = gtk_dialog_new_with_buttons (_("Message Retract"), NULL, + if (cnc && E_IS_GW_CONNECTION(cnc)) { + id = (char *)item->user_data; + + confirm_dialog = gtk_dialog_new_with_buttons (_("Message Retract"), NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_YES, GTK_RESPONSE_YES, GTK_STOCK_NO, GTK_RESPONSE_NO, NULL); - confirm_warning = gtk_label_new (_("Retracting a message may remove it from the recipient's mailbox. Are you sure you want to do this ?")); - gtk_label_set_line_wrap (GTK_LABEL (confirm_warning), TRUE); - gtk_label_set_selectable (GTK_LABEL (confirm_warning), TRUE); + confirm_warning = gtk_label_new (_("Retracting a message may remove it from the recipient's mailbox. Are you sure you want to do this ?")); + gtk_label_set_line_wrap (GTK_LABEL (confirm_warning), TRUE); + gtk_label_set_selectable (GTK_LABEL (confirm_warning), TRUE); - gtk_container_add (GTK_CONTAINER ((GTK_DIALOG(confirm_dialog))->vbox), confirm_warning); - gtk_widget_set_size_request (confirm_dialog, 400, 100); - gtk_widget_show_all (confirm_dialog); + gtk_container_add (GTK_CONTAINER ((GTK_DIALOG(confirm_dialog))->vbox), confirm_warning); + gtk_widget_set_size_request (confirm_dialog, 400, 100); + gtk_widget_show_all (confirm_dialog); - if (gtk_dialog_run (GTK_DIALOG (confirm_dialog)) == GTK_RESPONSE_YES) { + if (gtk_dialog_run (GTK_DIALOG (confirm_dialog)) == GTK_RESPONSE_YES) { - if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK ) - e_error_run (NULL, "org.gnome.evolution.message.retract:retract-failure", NULL); - else { - GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Message retracted successfully")); - gtk_dialog_run (GTK_DIALOG(dialog)); - gtk_widget_destroy (dialog); + if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK ) + e_error_run (NULL, "org.gnome.evolution.message.retract:retract-failure", NULL); + else { + GtkWidget *dialog; + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Message retracted successfully")); + gtk_dialog_run (GTK_DIALOG(dialog)); + gtk_widget_destroy (dialog); + } } - } - gtk_widget_destroy (confirm_warning); - gtk_widget_destroy (confirm_dialog); + gtk_widget_destroy (confirm_warning); + gtk_widget_destroy (confirm_dialog); + } } static EPopupItem popup_items[] = { |