[Xfce4-commits] <xfce4-xkb-plugin:4.10_panel_support> Get rid of a redundant "if (handle)" check.

Igor Slepchin noreply at xfce.org
Wed Mar 27 00:12:11 CET 2013


Updating branch refs/heads/4.10_panel_support
         to 0776b4226b2e2d705ce1c3c4817133c6b0fe9895 (commit)
       from 60213ecc3500cc35fbfc38ff00387309b7762842 (commit)

commit 0776b4226b2e2d705ce1c3c4817133c6b0fe9895
Author: Igor Slepchin <igor.slepchin at gmail.com>
Date:   Mon Sep 10 17:50:09 2012 -0400

    Get rid of a redundant "if (handle)" check.
    
    We did the same exact check a few lines earlier.
    (cherry picked from commit 1474d4a846cc20781f99b7718e4b7372d47be55f)

 panel-plugin/xkb-cairo.c |   45 ++++++++++++++++++++-------------------------
 1 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/panel-plugin/xkb-cairo.c b/panel-plugin/xkb-cairo.c
index 8de3ec5..9c80444 100644
--- a/panel-plugin/xkb-cairo.c
+++ b/panel-plugin/xkb-cairo.c
@@ -92,39 +92,34 @@ xkb_cairo_draw_flag (cairo_t *cr,
     scalex = (double) (width - 4) / dim.width;
     scaley = (double) (height - 4) / dim.height;
 
-    if (handle)
-    {
-        layoutx = (actual_width - width) / 2 + 2;
-        layouty = (actual_height - height) / 2 + 2;
-        cairo_translate (cr, layoutx, layouty);
-
-        //cairo_translate (cr, 2, 2);
+    layoutx = (actual_width - width) / 2 + 2;
+    layouty = (actual_height - height) / 2 + 2;
+    cairo_translate (cr, layoutx, layouty);
 
-        cairo_save (cr);
+    cairo_save (cr);
 
-        cairo_scale (cr, scalex, scaley);
-        rsvg_handle_render_cairo (handle, cr);
+    cairo_scale (cr, scalex, scaley);
+    rsvg_handle_render_cairo (handle, cr);
 
-        cairo_restore (cr);
+    cairo_restore (cr);
 
-        /* draw variant_markers_count circles */
-        for (i = 0; i < variant_markers_count; i++)
-        {
-            cairo_set_source_rgb (cr, 0, 0, 0);
-
-            cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
-            cairo_set_line_width (cr, 1);
+    /* draw variant_markers_count circles */
+    for (i = 0; i < variant_markers_count; i++)
+    {
+        cairo_set_source_rgb (cr, 0, 0, 0);
 
-            xkb_cairo_arc_for_flag (cr, -(7 * i) + 4, 4, 2.5, 0, 2 * G_PI);
+        cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
+        cairo_set_line_width (cr, 1);
 
-            cairo_set_source_rgb (cr, 0, 0, 0);
-            cairo_fill_preserve (cr);
-            cairo_set_source_rgb (cr, 1, 1, 1);
-            cairo_stroke (cr);
-        }
+        xkb_cairo_arc_for_flag (cr, -(7 * i) + 4, 4, 2.5, 0, 2 * G_PI);
 
-        g_object_unref (handle);
+        cairo_set_source_rgb (cr, 0, 0, 0);
+        cairo_fill_preserve (cr);
+        cairo_set_source_rgb (cr, 1, 1, 1);
+        cairo_stroke (cr);
     }
+
+    g_object_unref (handle);
 }
 
 void


More information about the Xfce4-commits mailing list