[Xfce4-commits] <postler:master> Pass return value to GLib.RegexEvalCallback

Christian Dywan noreply at xfce.org
Thu Jun 30 21:38:01 CEST 2011


Updating branch refs/heads/master
         to bc03ba66a6709b2d57a3b056b76432e287b93e22 (commit)
       from 5133f62a9ae0d1c3a5ff1a4229cbdc2419dee962 (commit)

commit bc03ba66a6709b2d57a3b056b76432e287b93e22
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Jun 30 21:33:00 2011 +0200

    Pass return value to GLib.RegexEvalCallback
    
    Apparently older Vala versions used to ignore if the
    return value was absent from a lambda.
    
    Fixes: https://bugs.launchpad.net/postler/+bug/797033

 postler/postler-content.vala |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 5969c1c..13fee3c 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -348,13 +348,12 @@ public class Postler.Content : WebKit.WebView {
     };
 
     static string? icon_name_to_data_uri (string icon_name,
-        int icon_size=Gtk.IconSize.MENU) {
+        Gtk.IconSize icon_size=Gtk.IconSize.MENU) {
 
         Gdk.Pixbuf? pixbuf = null;
         var toplevels = Gtk.Window.list_toplevels ();
         if (toplevels.nth_data (0) != null)
-            pixbuf = toplevels.nth_data (0).render_icon (icon_name,
-                Gtk.IconSize.MENU, null);
+            pixbuf = toplevels.nth_data (0).render_icon (icon_name, icon_size, null);
         if (pixbuf == null) {
             try {
                 pixbuf = Gtk.IconTheme.get_for_screen (
@@ -815,13 +814,14 @@ public class Postler.Content : WebKit.WebView {
             }
 
             /* Emoticons */
+            string body_markup = body_chunk.str;
             /* foreach (var emoticon in emoticons) { */
             for (int i = 0; i < emoticons.length; i++) {
                 var emoticon = emoticons[i];
                 try {
                     var escaped = GLib.Regex.escape_string (" " + emoticon.token);
                     var regex = new GLib.Regex (escaped);
-                    body_chunk.str = regex.replace_eval (body_chunk.str, -1, 0, 0,
+                    body_markup = regex.replace_eval (body_markup, -1, 0, 0,
                         (match_info, result) => { evaluate_emoticon (match_info, result, emoticon); });
                 }
                 catch (GLib.RegexError regex_error) { }
@@ -857,7 +857,7 @@ public class Postler.Content : WebKit.WebView {
                          format_header (_("Organization:"), message.organization),
                          format_header (_("Application:"), message.application),
                          format_header (_("Unsubscribe:"), list_unsubscribe),
-                         body_chunk.str),
+                         body_markup),
                 "text/html", "UTF-8", "file://" + template_path);
         } catch (GLib.Error error) {
             display_error (error.message);



More information about the Xfce4-commits mailing list