[gitg] Use g_markup_printf_escaped



commit ad8de4efedfb9f816c6c61a8ac0606607face581
Author: Will Thompson <will thompson collabora co uk>
Date:   Tue Mar 16 22:41:59 2010 +0000

    Use g_markup_printf_escaped
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613085

 gitg/gitg-revision-view.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gitg/gitg-revision-view.c b/gitg/gitg-revision-view.c
index 34d305e..f4cc262 100644
--- a/gitg/gitg-revision-view.c
+++ b/gitg/gitg-revision-view.c
@@ -678,12 +678,10 @@ update_parents(GitgRevisionView *self, GitgRevision *revision)
 		{
 			GtkWidget *subject = gtk_label_new(NULL);
 
-			gchar *escaped = g_markup_escape_text(gitg_revision_get_subject(revision), -1);
-			gchar *text = g_strdup_printf("(<i>%s</i>)", escaped);
+			gchar *text = g_markup_printf_escaped ("(<i>%s</i>)", gitg_revision_get_subject(revision));
 
 			gtk_label_set_markup(GTK_LABEL(subject), text);
 
-			g_free(escaped);
 			g_free(text);
 
 			gtk_widget_show(subject);
@@ -768,9 +766,7 @@ gitg_revision_view_update(GitgRevisionView *self, GitgRepository *repository, Gi
 	{
 		gtk_label_set_text(self->priv->author, gitg_revision_get_author(revision));
 
-		gchar *s = g_markup_escape_text(gitg_revision_get_subject(revision), -1);
-		gchar *subject = g_strconcat("<b>", s, "</b>", NULL);
-		g_free(s);
+		gchar *subject = g_markup_printf_escaped ("<b>%s</b>", gitg_revision_get_subject(revision));
 
 		gtk_label_set_markup(self->priv->subject, subject);
 		g_free(subject);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]