[Xfce4-commits] [xfce/xfce4-power-manager] 04/13: Fix status icon for devices other than battery and ups (Bug 8188)

noreply at xfce.org noreply at xfce.org
Tue Apr 8 18:42:58 CEST 2014


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

eric pushed a commit to branch master
in repository xfce/xfce4-power-manager.

commit 30ce194f569bc7d0d7ac38356c366b9527b1e6c8
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sun Jan 19 09:44:31 2014 +0300

    Fix status icon for devices other than battery and ups (Bug 8188)
    
    xfpm_battery_refresh_icon incorrectly adds an additional dash to
    the icon prefix when the device is not a battery or a ups.
    
    Additionally, this patch correctly shows the icon when the device
    reports that it is charging.
    
    This patch only combines the patches submitted by
    Daniel Schubert and Dean Montgomery.
---
 src/xfpm-battery.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c
index 2e0e504..31576d6 100644
--- a/src/xfpm-battery.c
+++ b/src/xfpm-battery.c
@@ -320,20 +320,22 @@ xfpm_battery_refresh_icon (XfpmBattery *battery)
     {
 	if ( !battery->priv->present || battery->priv->state == XFPM_DEVICE_STATE_EMPTY )
 	{
-	    g_snprintf (icon_name, 128, "%s-000", battery->priv->icon_prefix);
+	    g_snprintf (icon_name, 128, "%s000", battery->priv->icon_prefix);
 	}
 	else if ( battery->priv->state == XFPM_DEVICE_STATE_FULLY_CHARGED )
 	{
-	    g_snprintf (icon_name, 128, "%s-100", battery->priv->icon_prefix);
+	    g_snprintf (icon_name, 128, "%s100", battery->priv->icon_prefix);
 	}
-	else if ( battery->priv->state == XFPM_DEVICE_STATE_DISCHARGING )
+	else if ( battery->priv->state == XFPM_DEVICE_STATE_DISCHARGING || battery->priv->state == XFPM_DEVICE_STATE_CHARGING )
 	{
-	    g_snprintf (icon_name, 128, "%s-%s",
+	    g_snprintf (icon_name, 128, "%s%s",
 			battery->priv->icon_prefix,
 			xfpm_battery_get_icon_index (battery->priv->type, battery->priv->percentage));
 	}
     }
 
+    XFPM_DEBUG ("Battery icon %s", icon_name);
+
     gtk_status_icon_set_from_icon_name (GTK_STATUS_ICON (battery), icon_name);
 }
 

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


More information about the Xfce4-commits mailing list