Lines 1-26
Link Here
|
1 |
--- panel-plugins/power-manager-plugin/power-manager-button.c.orig 2015-05-25 16:10:37 UTC |
1 |
--- panel-plugins/power-manager-plugin/power-manager-button.c.orig 2015-06-05 08:14:04 UTC |
2 |
+++ panel-plugins/power-manager-plugin/power-manager-button.c |
2 |
+++ panel-plugins/power-manager-plugin/power-manager-button.c |
3 |
@@ -382,7 +382,7 @@ power_manager_button_update_device_icon_ |
3 |
@@ -285,7 +285,7 @@ static void |
4 |
details = get_device_description (button->priv->upower, device); |
4 |
power_manager_button_set_label (PowerManagerButton *button, gdouble percentage, |
5 |
|
5 |
guint64 time_to_empty_or_full) |
6 |
/* If UPower doesn't give us an icon, just use the default */ |
6 |
{ |
7 |
- if (icon_name == NULL) |
7 |
- gchar *label_string; |
8 |
+ if (icon_name == NULL || g_strcmp0 (icon_name, "") == 0) |
8 |
+ gchar *label_string = NULL; |
9 |
icon_name = g_strdup (PANEL_DEFAULT_ICON); |
9 |
gint hours; |
10 |
|
10 |
gint minutes; |
11 |
pix = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), |
11 |
gchar *remaining_time = NULL; |
12 |
@@ -407,7 +407,13 @@ power_manager_button_update_device_icon_ |
|
|
13 |
DBG("this is the display device, updating"); |
14 |
/* it is! update the panel button */ |
15 |
g_free (button->priv->panel_icon_name); |
16 |
- |
17 |
+#ifdef XFCE_PLUGIN |
18 |
+ g_object_get (device, |
19 |
+ "icon-name", &icon_name, |
20 |
+ NULL); |
21 |
+ if (icon_name == NULL || g_strcmp0 (icon_name, "") == 0) |
22 |
+ icon_name = g_strdup (PANEL_DEFAULT_ICON); |
23 |
+#endif |
24 |
button->priv->panel_icon_name = g_strdup (icon_name); |
25 |
power_manager_button_set_icon (button); |
26 |
/* update tooltip */ |