[gnome-settings-daemon] power: Simplify hiding/showing the status icon
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Simplify hiding/showing the status icon
- Date: Mon, 3 Oct 2011 14:53:32 +0000 (UTC)
commit bdb8474f28087ad0b7914b9fc7e8974f9779f310
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 3 15:53:16 2011 +0100
power: Simplify hiding/showing the status icon
plugins/power/gsd-power-manager.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 5fbf42e..9ffe07f 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -621,6 +621,8 @@ engine_recalculate_state_icon (GsdPowerManager *manager)
/* show a different icon if we are disconnected */
icon = engine_get_icon (manager);
+ gtk_status_icon_set_visible (manager->priv->status_icon, icon != NULL);
+
if (icon == NULL) {
/* none before, now none */
if (manager->priv->previous_icon == NULL)
@@ -628,9 +630,6 @@ engine_recalculate_state_icon (GsdPowerManager *manager)
g_object_unref (manager->priv->previous_icon);
manager->priv->previous_icon = NULL;
-
- /* set fallback icon */
- gtk_status_icon_set_visible (manager->priv->status_icon, FALSE);
return TRUE;
}
@@ -638,7 +637,6 @@ engine_recalculate_state_icon (GsdPowerManager *manager)
if (manager->priv->previous_icon == NULL) {
/* set fallback icon */
- gtk_status_icon_set_visible (manager->priv->status_icon, TRUE);
gtk_status_icon_set_from_gicon (manager->priv->status_icon, icon);
manager->priv->previous_icon = icon;
return TRUE;
@@ -648,9 +646,6 @@ engine_recalculate_state_icon (GsdPowerManager *manager)
if (!g_icon_equal (manager->priv->previous_icon, icon)) {
g_object_unref (manager->priv->previous_icon);
manager->priv->previous_icon = icon;
-
- /* set fallback icon */
- gtk_status_icon_set_from_gicon (manager->priv->status_icon, icon);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]