@@ -155,7 +155,6 @@ struct CsdPowerManagerPrivate
155155 gint kbd_brightness_pre_dim ;
156156 GnomeRRScreen * x11_screen ;
157157 gboolean use_time_primary ;
158- gchar * previous_summary ;
159158 GIcon * previous_icon ;
160159 GpmPhone * phone ;
161160 GPtrArray * devices_array ;
@@ -204,7 +203,6 @@ static void csd_power_manager_finalize (GObject *object);
204203static UpDevice * engine_get_composite_device (CsdPowerManager * manager , UpDevice * original_device );
205204static UpDevice * engine_update_composite_device (CsdPowerManager * manager , UpDevice * original_device );
206205static GIcon * engine_get_icon (CsdPowerManager * manager );
207- static gchar * engine_get_summary (CsdPowerManager * manager );
208206static UpDevice * engine_get_primary_device (CsdPowerManager * manager );
209207static void engine_charge_low (CsdPowerManager * manager , UpDevice * device );
210208static void engine_charge_critical (CsdPowerManager * manager , UpDevice * device );
@@ -381,8 +379,7 @@ typedef enum {
381379
382380static void
383381engine_emit_changed (CsdPowerManager * manager ,
384- gboolean icon_changed ,
385- gboolean state_changed )
382+ gboolean icon_changed )
386383{
387384 /* not yet connected to the bus */
388385 if (manager -> priv -> power_iface == NULL )
@@ -404,17 +401,6 @@ engine_emit_changed (CsdPowerManager *manager,
404401 g_object_unref (gicon );
405402 }
406403
407- if (state_changed ) {
408- gchar * tooltip ;
409-
410- tooltip = engine_get_summary (manager );
411-
412- csd_power_set_tooltip (manager -> priv -> power_iface , tooltip );
413- need_flush = TRUE;
414-
415- g_free (tooltip );
416- }
417-
418404 if (need_flush ) {
419405 g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (manager -> priv -> power_iface ));
420406 }
@@ -558,47 +544,6 @@ engine_get_warning (CsdPowerManager *manager, UpDevice *device)
558544 return warning_type ;
559545}
560546
561- static gchar *
562- engine_get_summary (CsdPowerManager * manager )
563- {
564- guint i ;
565- GPtrArray * array ;
566- UpDevice * device ;
567- UpDeviceState state ;
568- GString * tooltip = NULL ;
569- gchar * part ;
570- gboolean is_present ;
571-
572-
573- /* need to get AC state */
574- tooltip = g_string_new ("" );
575-
576- /* do we have specific device types? */
577- array = manager -> priv -> devices_array ;
578- for (i = 0 ;i < array -> len ;i ++ ) {
579- device = g_ptr_array_index (array , i );
580- g_object_get (device ,
581- "is-present" , & is_present ,
582- "state" , & state ,
583- NULL );
584- if (!is_present )
585- continue ;
586- if (state == UP_DEVICE_STATE_EMPTY )
587- continue ;
588- part = gpm_upower_get_device_summary (device );
589- if (part != NULL )
590- g_string_append_printf (tooltip , "%s\n" , part );
591- g_free (part );
592- }
593-
594- /* remove the last \n */
595- g_string_truncate (tooltip , tooltip -> len - 1 );
596-
597- g_debug ("tooltip: %s" , tooltip -> str );
598-
599- return g_string_free (tooltip , FALSE);
600- }
601-
602547static GIcon *
603548engine_get_icon_priv (CsdPowerManager * manager ,
604549 UpDeviceKind device_kind ,
@@ -740,40 +685,16 @@ engine_recalculate_state_icon (CsdPowerManager *manager)
740685 return FALSE;
741686}
742687
743- static gboolean
744- engine_recalculate_state_summary (CsdPowerManager * manager )
745- {
746- gchar * summary ;
747-
748- summary = engine_get_summary (manager );
749- if (manager -> priv -> previous_summary == NULL ) {
750- manager -> priv -> previous_summary = summary ;
751- return TRUE;
752- }
753-
754- if (strcmp (manager -> priv -> previous_summary , summary ) != 0 ) {
755- g_free (manager -> priv -> previous_summary );
756- manager -> priv -> previous_summary = summary ;
757- return TRUE;
758- }
759- g_debug ("no change" );
760- /* nothing to do */
761- g_free (summary );
762- return FALSE;
763- }
764-
765688static void
766689engine_recalculate_state (CsdPowerManager * manager )
767690{
768691 gboolean icon_changed = FALSE;
769- gboolean state_changed = FALSE;
770692
771693 icon_changed = engine_recalculate_state_icon (manager );
772- state_changed = engine_recalculate_state_summary (manager );
773694
774- /* only emit if the icon or summary has changed */
775- if (icon_changed || state_changed )
776- engine_emit_changed (manager , icon_changed , state_changed );
695+ /* only emit if the icon has changed */
696+ if (icon_changed )
697+ engine_emit_changed (manager , icon_changed );
777698}
778699
779700static UpDevice *
@@ -1091,8 +1012,6 @@ engine_ups_discharging (CsdPowerManager *manager, UpDevice *device)
10911012 /* TRANSLATORS: tell the user how much time they have got */
10921013 g_string_append_printf (message , _ ("%s of UPS backup power remaining" ),
10931014 remaining_text );
1094- } else {
1095- g_string_append (message , gpm_device_to_localised_string (device ));
10961015 }
10971016 g_string_append_printf (message , " (%.0f%%)" , percentage );
10981017
@@ -4391,9 +4310,6 @@ csd_power_manager_stop (CsdPowerManager *manager)
43914310 manager -> priv -> previous_icon = NULL ;
43924311 }
43934312
4394- g_free (manager -> priv -> previous_summary );
4395- manager -> priv -> previous_summary = NULL ;
4396-
43974313 if (manager -> priv -> session_proxy != NULL ) {
43984314 g_object_unref (manager -> priv -> session_proxy );
43994315 manager -> priv -> session_proxy = NULL ;
0 commit comments