[gnome-control-center] printers: Unescape spaces in names of printer supplies



commit c9ebbd57da229dd7a8553dbdb5cbb9d8443d1a88
Author: Marek Kasik <mkasik redhat com>
Date:   Wed Jan 19 14:05:55 2011 +0100

    printers: Unescape spaces in names of printer supplies
    
    Don't place new line at the end of supply names.

 panels/printers/cc-printers-panel.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 56ab101..578dc64 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -1146,7 +1146,7 @@ supply_levels_draw_cb (GtkWidget *widget,
       for (i = 0; i < priv->dests[priv->current_dest].num_options; i++)
         {
           if (g_strcmp0 (priv->dests[priv->current_dest].options[i].name, "marker-names") == 0)
-            marker_names = priv->dests[priv->current_dest].options[i].value;
+            marker_names = g_strcompress (priv->dests[priv->current_dest].options[i].value);
           else if (g_strcmp0 (priv->dests[priv->current_dest].options[i].name, "marker-levels") == 0)
             marker_levels = priv->dests[priv->current_dest].options[i].value;
           else if (g_strcmp0 (priv->dests[priv->current_dest].options[i].name, "marker-colors") == 0)
@@ -1221,13 +1221,13 @@ supply_levels_draw_cb (GtkWidget *widget,
 
               if (tooltip_text)
                 {
-                  tmp = g_strdup_printf ("%s%s\n", tooltip_text, marker_namesv[i]);
+                  tmp = g_strdup_printf ("%s\n%s", tooltip_text, marker_namesv[i]);
                   g_free (tooltip_text);
                   tooltip_text = tmp;
                   tmp = NULL;
                 }
               else
-                tooltip_text = g_strdup_printf ("%s\n", marker_namesv[i]);
+                tooltip_text = g_strdup_printf ("%s", marker_namesv[i]);
             }
 
           g_strfreev (marker_levelsv);
@@ -1235,6 +1235,8 @@ supply_levels_draw_cb (GtkWidget *widget,
           g_strfreev (marker_namesv);
         }
 
+      g_free (marker_names);
+
       if (tooltip_text)
         {
           gtk_widget_set_tooltip_text (widget, tooltip_text);



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