[balsa/gtk3] Use "(No name)" only when all else fails
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Use "(No name)" only when all else fails
- Date: Mon, 29 Apr 2013 13:16:07 +0000 (UTC)
commit cbb1759b08b44360138aa1fe3f7fc48a4e76c10a
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Apr 29 09:13:15 2013 -0400
Use "(No name)" only when all else fails
* src/sendmsg-window.c (delete_handler): tell the user the
message is to "(No name)" only as a last resort; thanks to Jack
Ostroff for reporting.
ChangeLog | 6 ++++++
src/sendmsg-window.c | 14 +++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c084f42..95b3f1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-29 Peter Bloomfield
+
+ * src/sendmsg-window.c (delete_handler): tell the user the
+ message is to "(No name)" only as a last resort; thanks to Jack
+ Ostroff for reporting.
+
2013-04-27 Pawel Salek
* NEWS: release balsa-2.5.1
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 93aa038..3e3da59 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -902,8 +902,9 @@ static gint
delete_handler(BalsaSendmsg * bsmsg)
{
InternetAddressList *list;
- const InternetAddress *ia;
- const gchar *tmp;
+ InternetAddress *ia;
+ const gchar *tmp = NULL;
+ gchar *free_me = NULL;
gint reply;
GtkWidget *d;
@@ -915,7 +916,13 @@ delete_handler(BalsaSendmsg * bsmsg)
list = libbalsa_address_view_get_list(bsmsg->recipient_view, "To:");
ia = internet_address_list_get_address(list, 0);
- tmp = ia && ia->name ? ia->name : _("(No name)");
+ if (ia) {
+ tmp = ia->name;
+ if (!tmp || !*tmp)
+ tmp = free_me = internet_address_to_string(ia, FALSE);
+ }
+ if (!tmp || !*tmp)
+ tmp = _("(No name)");
d = gtk_message_dialog_new(GTK_WINDOW(bsmsg->window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -923,6 +930,7 @@ delete_handler(BalsaSendmsg * bsmsg)
GTK_BUTTONS_YES_NO,
_("The message to '%s' is modified.\n"
"Save message to Draftbox?"), tmp);
+ g_free(free_me);
#if HAVE_MACOSX_DESKTOP
libbalsa_macosx_menu_for_parent(d, GTK_WINDOW(bsmsg->window));
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]