[Xfce4-commits] [apps/xfce4-notifyd] 23/24: panel-plugin: Check for markup tags in the notification body

noreply at xfce.org noreply at xfce.org
Fri Sep 8 23:27:54 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-notifyd.

commit 328f8536fad87b487afd7ad2e2ac7bda6850fbe7
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Tue Sep 5 15:35:14 2017 +0200

    panel-plugin: Check for markup tags in the notification body
---
 panel-plugin/notification-plugin-log.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/notification-plugin-log.c b/panel-plugin/notification-plugin-log.c
index 2873912..c246c08 100644
--- a/panel-plugin/notification-plugin-log.c
+++ b/panel-plugin/notification-plugin-log.c
@@ -177,7 +177,16 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       g_free (markup);
 
       tmp = g_key_file_get_string (notify_log, group, "body", NULL);
-      body = gtk_label_new (tmp);
+      body = gtk_label_new (NULL);
+      if (pango_parse_markup (tmp, -1, 0, NULL, NULL, NULL, NULL)) {
+        gtk_label_set_markup (GTK_LABEL (body), tmp);
+      } else {
+        gchar *tmp1;
+
+        tmp1 = g_markup_escape_text (tmp, -1);
+        gtk_label_set_text (GTK_LABEL (body), tmp1);
+        g_free (tmp1);
+      }
       g_free (tmp);
       gtk_label_set_xalign (GTK_LABEL (body), 0);
       gtk_label_set_ellipsize (GTK_LABEL (body), PANGO_ELLIPSIZE_END);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list