From 0c1e774b428c6ccb76e6ad9e0de9e809b56790fa Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 13 Feb 2012 14:18:56 -0600 Subject: remove unncessary private field 'visible' --- src/indicator-power.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/indicator-power.c b/src/indicator-power.c index 90db2f9..bbd00d8 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -78,8 +78,6 @@ typedef struct { GVariant *device; GSettings *settings; - - gboolean visible; } IndicatorPower; @@ -123,8 +121,6 @@ indicator_power_init (IndicatorPower *self) self->accessible_desc = NULL; - self->visible = FALSE; - self->watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION, DBUS_SERVICE, G_BUS_NAME_WATCHER_FLAGS_NONE, @@ -137,7 +133,7 @@ indicator_power_init (IndicatorPower *self) g_signal_connect_swapped (self->settings, "changed::" ICON_POLICY_KEY, G_CALLBACK(update_visibility), self); g_object_set (G_OBJECT(self), - INDICATOR_OBJECT_DEFAULT_VISIBILITY, self->visible, + INDICATOR_OBJECT_DEFAULT_VISIBILITY, FALSE, NULL); } @@ -827,13 +823,8 @@ get_devices_cb (GObject *source_object, static void update_visibility (IndicatorPower * self) { - const gboolean visible = should_be_visible (self); - - if (self->visible != visible) - { - self->visible = visible; - indicator_object_set_visible (INDICATOR_OBJECT (self), visible); - } + indicator_object_set_visible (INDICATOR_OBJECT (self), + should_be_visible (self)); } static void -- cgit v1.2.3