diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-22 01:03:58 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-22 01:03:58 -0500 |
commit | a6b05106a5f3c01cc3b1bc5b5812fbf883a14691 (patch) | |
tree | 66941b467f1cd9e79accf1a9e4f089431f62ff82 /gtk/gtkaboutdialog.c | |
parent | 4cc76927b1e6d864f18e37b8f35aa5495392b56d (diff) | |
download | gtk+-a6b05106a5f3c01cc3b1bc5b5812fbf883a14691.tar.gz |
GtkAboutDialog: Be slightly more flexible when listing credits
Make sure we render credits ok that are occurring in the wild,
such as "Contact us at:", "<foo@bar>" or "guy1\nguy2\nguy3"
https://bugzilla.gnome.org/show_bug.cgi?id=637763
https://bugzilla.gnome.org/show_bug.cgi?id=637736
Diffstat (limited to 'gtk/gtkaboutdialog.c')
-rw-r--r-- | gtk/gtkaboutdialog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 9edf0b647e..6be3edc3e2 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -2277,6 +2277,7 @@ add_credits_section (GtkAboutDialog *about, { gchar *link; gchar *text; + gchar *name; if (*q1 == '<') { @@ -2284,6 +2285,7 @@ add_credits_section (GtkAboutDialog *about, gchar *escaped; text = g_strstrip (g_strndup (q0, q1 - q0)); + name = g_markup_escape_text (text, -1); q1++; link = g_strndup (q1, q2 - q1); q2++; @@ -2291,22 +2293,25 @@ add_credits_section (GtkAboutDialog *about, g_string_append_printf (str, "<a href=\"mailto:%s\">%s</a>", escaped, - text); + name[0] ? name : link); g_free (escaped); g_free (link); g_free (text); + g_free (name); } else { /* uri */ text = g_strstrip (g_strndup (q0, q1 - q0)); + name = g_markup_escape_text (text, -1); link = g_strndup (q1, q2 - q1); g_string_append_printf (str, "<a href=\"%s\">%s</a>", link, - text); + name[0] ? name : link); g_free (link); g_free (text); + g_free (name); } q0 = q2; |