diff -cr gnome-power-manager-2.30.0/src/gpm-engine.c gnome-power-manager-2.30.1/src/gpm-engine.c
*** gnome-power-manager-2.30.0/src/gpm-engine.c	2010-03-04 22:34:34.000000000 +0800
--- gnome-power-manager-2.30.1/src/gpm-engine.c	2010-05-11 15:27:39.059542165 +0800
***************
*** 531,536 ****
--- 531,566 ----
  }
  
  /**
+  * gpm_engine_device_set_capabilities:
+  **/
+ static void
+ gpm_engine_device_set_capabilities (GpmEngine *engine, DkpDevice *device)
+ {
+ 	GpmPrefsServer *prefs_server;
+ 	DkpDeviceType type;
+ 	gboolean has_battery = FALSE;
+ 	gboolean has_ups = FALSE;
+ 
+ 	/* get device properties */
+ 	g_object_get (device,
+ 		      "type", &type,
+ 		      NULL);
+ 
+ 	if (type == DKP_DEVICE_TYPE_BATTERY)
+ 		has_battery = TRUE;
+ 	else if (type == DKP_DEVICE_TYPE_UPS)
+ 		has_ups = TRUE;
+ 
+ 	/* only show the battery prefs section if we have batteries */
+ 	prefs_server = gpm_prefs_server_new ();
+ 	if (has_battery)
+ 		gpm_prefs_server_set_capability (prefs_server, GPM_PREFS_SERVER_BATTERY);
+ 	if (has_ups)
+ 		gpm_prefs_server_set_capability (prefs_server, GPM_PREFS_SERVER_UPS);
+ 	g_object_unref (prefs_server);
+ }
+ 
+ /**
   * gpm_engine_device_check_capacity:
   **/
  static gboolean
***************
*** 804,814 ****
  {
  	guint i;
  	GPtrArray *array;
- 	gboolean has_battery = FALSE;
- 	gboolean has_ups = FALSE;
- 	GpmPrefsServer *prefs_server;
  	DkpDevice *device;
- 	DkpDeviceType type;
  
  	g_return_val_if_fail (engine != NULL, FALSE);
  	g_return_val_if_fail (GPM_IS_ENGINE (engine), FALSE);
--- 834,840 ----
***************
*** 816,845 ****
  	/* get array */
  	engine->priv->array = dkp_client_enumerate_devices (engine->priv->client, NULL);
  
! 	/* do we have specific device types? */
  	array = engine->priv->array;
  	for (i=0;i<array->len;i++) {
  		device = g_ptr_array_index (engine->priv->array, i);
! 
! 		/* get device properties */
! 		g_object_get (device,
! 			      "type", &type,
! 			      NULL);
! 
! 		if (type == DKP_DEVICE_TYPE_BATTERY)
! 			has_battery = TRUE;
! 		else if (type == DKP_DEVICE_TYPE_UPS)
! 			has_ups = TRUE;
  	}
  
- 	/* only show the battery prefs section if we have batteries */
- 	prefs_server = gpm_prefs_server_new ();
- 	if (has_battery)
- 		gpm_prefs_server_set_capability (prefs_server, GPM_PREFS_SERVER_BATTERY);
- 	if (has_ups)
- 		gpm_prefs_server_set_capability (prefs_server, GPM_PREFS_SERVER_UPS);
- 	g_object_unref (prefs_server);
- 
  	/* connected mobile phones */
  	gpm_phone_coldplug (engine->priv->phone);
  
--- 842,854 ----
  	/* get array */
  	engine->priv->array = dkp_client_enumerate_devices (engine->priv->client, NULL);
  
! 	/* update device capabilities */
  	array = engine->priv->array;
  	for (i=0;i<array->len;i++) {
  		device = g_ptr_array_index (engine->priv->array, i);
! 		gpm_engine_device_set_capabilities(engine, device);
  	}
  
  	/* connected mobile phones */
  	gpm_phone_coldplug (engine->priv->phone);
  
***************
*** 864,869 ****
--- 873,879 ----
  {
  	/* add to list */
  	g_ptr_array_add (engine->priv->array, g_object_ref (device));
+ 	gpm_engine_device_set_capabilities(engine, device);
  	gpm_engine_check_recall (engine, device);
  
  	gpm_engine_recalculate_state (engine);
diff -cr gnome-power-manager-2.30.0/src/gpm-prefs-server.c gnome-power-manager-2.30.1/src/gpm-prefs-server.c
*** gnome-power-manager-2.30.0/src/gpm-prefs-server.c	2010-01-28 00:24:53.000000000 +0800
--- gnome-power-manager-2.30.1/src/gpm-prefs-server.c	2010-05-11 15:20:28.409534827 +0800
***************
*** 80,86 ****
  {
  	g_return_val_if_fail (server != NULL, FALSE);
  	g_return_val_if_fail (GPM_IS_PREFS_SERVER (server), FALSE);
! 	server->priv->capability = server->priv->capability + capability;
  	egg_debug ("capability now %i", server->priv->capability);
  	return TRUE;
  }
--- 80,86 ----
  {
  	g_return_val_if_fail (server != NULL, FALSE);
  	g_return_val_if_fail (GPM_IS_PREFS_SERVER (server), FALSE);
! 	server->priv->capability = server->priv->capability | capability;
  	egg_debug ("capability now %i", server->priv->capability);
  	return TRUE;
  }
