[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Dropping libdevkit-power-gobject for squeeze.



Hi,

libdevkit-power-gobject is the old ABI that was provided by DeviceKit-power.
DeviceKit-power has been replaced by UPower.
UPower though still provides the old ABI via a compat lib, which I'd like to get
rid of in squeeze (this compat lib will also be removed in the next upstream
version of UPower, i.e. there will be no more support from upstream).

Currently there are 4 packages remaining (in squeeze) that still depend on
libdevkit-power-gobject:
- gdm3 2.30.2-4
- tracker 0.8.15-1
- gnome-session 2.30.2-1
- gnome-power-manager 2.30.1-1

For gdm3, Joss already uploaded a fixed version to unstable (2.30.5-1), which
contains quite a few other changes, though.

tracker, gnome-session and gnome-power-manager all have been fixed upstream and
ported to upower.

I backported those patches. They are attached.

The alternative for gnome-power-manager and gnome-session is to wait for their
2.32 release, which contain the ports to upower already.

Please let me know, if I can proceed with this, if you prefer backports for
gnome-session and gnome-power-power and if an unblock for gdm3 2.30.5-1 is ok or
if I should prepare a t-p-u upload with only the upower patch.

My preference/proposal would be:
1/ get gdm3 2.30.5-1 unblocked
2/ upload g-p-m 2.30.2-2, tracker 0.8.15-2 and gnome-power-manager 2.30.1-2 with
the respective upower patch (while keeping other changes minimal) and get them
unblocked and transitioned to testing
3/ Upload upower 0.9.5-2 and drop the libdevkit-power-gobject packages and it
unblocked.

Would that be acceptable for the RT?

Thanks for your great work,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From 7649546b69df1f7914422ae544ff4743fdc71186 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Tue, 30 Mar 2010 11:29:27 +0100
Subject: [PATCH] Port from DeviceKit-power to UPower

Only connect the UpClient::device-added signal after the coldplug

This avoids duplicated devices in gnome-power-statistics
---
 configure.ac           |    5 +-
 src/Makefile.am        |   12 +-
 src/gpm-backlight.c    |   14 +-
 src/gpm-button.c       |    8 +-
 src/gpm-common.h       |    5 -
 src/gpm-control.c      |   10 +-
 src/gpm-engine.c       |  259 +++++++++++++++++++-----------------
 src/gpm-engine.h       |   16 +-
 src/gpm-graph-widget.c |   12 +-
 src/gpm-idle.c         |   30 ++--
 src/gpm-manager.c      |  108 ++++++++--------
 src/gpm-prefs-core.c   |    8 +-
 src/gpm-statistics.c   |  347 ++++++++++++++++++++++++------------------------
 src/gpm-tray-icon.c    |   28 ++--
 src/gpm-upower.c       |  252 +++++++++++++++--------------------
 src/gpm-upower.h       |   14 +-
 16 files changed, 552 insertions(+), 576 deletions(-)

diff --git a/configure.ac b/configure.ac
index b7488af..7f023ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,7 +121,7 @@ UNIQUE_REQUIRED=0.9.4
 LIBPANEL_REQUIRED=2.0.0
 XRANDR_REQUIRED=1.2.0
 CANBERRA_REQUIRED=0.10
-DEVKIT_POWER_REQUIRED=008
+UPOWER_REQUIRED=0.9.1
 
 dnl ---------------------------------------------------------------------------
 dnl - Check library dependencies
@@ -160,8 +160,7 @@ PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
 
 PKG_CHECK_MODULES(UNIQUE, unique-1.0 >= $UNIQUE_REQUIRED)
 
-PKG_CHECK_MODULES(DEVKIT, [
- devkit-power-gobject >= $DEVKIT_POWER_REQUIRED])
+PKG_CHECK_MODULES(UPOWER, upower-glib >= $UPOWER_REQUIRED)
 
 AC_PATH_PROG(GCONFTOOL, gconftool-2)
 AM_GCONF_SOURCE_2
diff --git a/src/Makefile.am b/src/Makefile.am
index 652f9fe..1aae62e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,7 +19,7 @@ INCLUDES =						\
 	$(CANBERRA_CFLAGS)				\
 	$(GSTREAMER_CFLAGS)				\
 	-DI_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE \
-	$(DEVKIT_CFLAGS)				\
+	$(UPOWER_CFLAGS)				\
 	-DBINDIR=\"$(bindir)\"			 	\
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\"	\
 	-DDATADIR=\"$(datadir)\"			\
@@ -29,7 +29,7 @@ INCLUDES =						\
 	-DVERSION="\"$(VERSION)\"" 			\
 	-DGPM_DATA=\"$(pkgdatadir)\"			\
 	-DGTKBUILDERDIR=\"$(pkgdatadir)\"		\
-	-DDKP_DISABLE_DEPRECATED			\
+	-DUP_DISABLE_DEPRECATED			\
 	-DEGG_LOG_FILE=\""/tmp/gpm.log"\"		\
 	-DEGG_VERBOSE="\"GPM_VERBOSE\""			\
 	-DEGG_LOGGING="\"GPM_LOGGING\""			\
@@ -94,7 +94,7 @@ gnome_power_statistics_LDADD =				\
 	libgpmshared.a					\
 	$(GLIB_LIBS)					\
 	$(X11_LIBS)					\
-	$(DEVKIT_LIBS)					\
+	$(UPOWER_LIBS)					\
 	$(GNOME_LIBS)					\
 	$(UNIQUE_LIBS)					\
 	$(DBUS_LIBS)					\
@@ -118,7 +118,7 @@ gnome_power_preferences_LDADD =				\
 	$(DBUS_LIBS)					\
 	$(UNIQUE_LIBS)					\
 	$(GPM_EXTRA_LIBS)				\
-	$(DEVKIT_LIBS)					\
+	$(UPOWER_LIBS)					\
 	-lm
 
 if HAVE_HAL
@@ -188,7 +188,7 @@ gnome_power_manager_LDADD =				\
 	$(CANBERRA_LIBS)				\
 	$(LIBNOTIFY_LIBS)				\
 	$(GPM_EXTRA_LIBS)				\
-	$(DEVKIT_LIBS)					\
+	$(UPOWER_LIBS)					\
 	-lm
 
 if HAVE_HAL
@@ -256,7 +256,7 @@ gnome_power_self_test_LDADD =				\
 	$(X11_LIBS)					\
 	$(GNOME_LIBS)					\
 	$(GSTREAMER_LIBS)				\
-	$(DEVKIT_LIBS)					\
+	$(UPOWER_LIBS)					\
 	$(DBUS_LIBS)					\
 	$(X11_LIBS)						\
 	$(LIBNOTIFY_LIBS)				\
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c
index e24f212..72861bc 100644
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -40,7 +40,7 @@
 #include <glib/gi18n.h>
 #include <dbus/dbus-glib.h>
 #include <gconf/gconf-client.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "gpm-button.h"
 #include "gpm-backlight.h"
@@ -60,7 +60,7 @@
 
 struct GpmBacklightPrivate
 {
-	DkpClient		*client;
+	UpClient		*client;
 	GpmBrightness		*brightness;
 	GpmButton		*button;
 	GConfClient		*conf;
@@ -408,13 +408,13 @@ gpm_conf_gconf_key_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *e
 
 /**
  * gpm_backlight_client_changed_cb:
- * @client: The dkp_client class instance
+ * @client: The up_client class instance
  * @backlight: This class instance
  *
  * Does the actions when the ac power source is inserted/removed.
  **/
 static void
-gpm_backlight_client_changed_cb (DkpClient *client, GpmBacklight *backlight)
+gpm_backlight_client_changed_cb (UpClient *client, GpmBacklight *backlight)
 {
 	gpm_backlight_brightness_evaluate_and_set (backlight, FALSE);
 }
@@ -737,8 +737,8 @@ gpm_backlight_init (GpmBacklight *backlight)
 	g_signal_connect (backlight->priv->brightness, "brightness-changed",
 			  G_CALLBACK (brightness_changed_cb), backlight);
 
-	/* we use dkp_client for the ac-adapter-changed signal */
-	backlight->priv->client = dkp_client_new ();
+	/* we use up_client for the ac-adapter-changed signal */
+	backlight->priv->client = up_client_new ();
 	g_signal_connect (backlight->priv->client, "changed",
 			  G_CALLBACK (gpm_backlight_client_changed_cb), backlight);
 
@@ -746,11 +746,9 @@ gpm_backlight_init (GpmBacklight *backlight)
 	backlight->priv->can_dim = gpm_brightness_has_hw (backlight->priv->brightness);
 
 	/* we use DeviceKit-power to see if we should show the lid UI */
-#if DKP_CHECK_VERSION(0x009)
 	g_object_get (backlight->priv->client,
 		      "lid-is-present", &lid_is_present,
 		      NULL);
-#endif
 
 	/* expose ui in prefs program */
 	prefs_server = gpm_prefs_server_new ();
diff --git a/src/gpm-button.c b/src/gpm-button.c
index 6350989..3341b4c 100644
--- a/src/gpm-button.c
+++ b/src/gpm-button.c
@@ -29,7 +29,7 @@
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 #include <X11/XF86keysym.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "gpm-common.h"
 #include "gpm-button.h"
@@ -48,7 +48,7 @@ struct GpmButtonPrivate
 	gchar			*last_button;
 	GTimer			*timer;
 	gboolean		 lid_is_closed;
-	DkpClient		*client;
+	UpClient		*client;
 };
 
 enum {
@@ -283,7 +283,7 @@ gpm_button_reset_time (GpmButton *button)
  * gpm_button_client_changed_cb
  **/
 static void
-gpm_button_client_changed_cb (DkpClient *client, GpmButton *button)
+gpm_button_client_changed_cb (UpClient *client, GpmButton *button)
 {
 	gboolean lid_is_closed;
 
@@ -323,7 +323,7 @@ gpm_button_init (GpmButton *button)
 	button->priv->timer = g_timer_new ();
 
 	button->priv->lid_is_closed = FALSE;
-	button->priv->client = dkp_client_new ();
+	button->priv->client = up_client_new ();
 	g_signal_connect (button->priv->client, "changed",
 			  G_CALLBACK (gpm_button_client_changed_cb), button);
 
diff --git a/src/gpm-common.h b/src/gpm-common.h
index dc45e3a..2a263b0 100644
--- a/src/gpm-common.h
+++ b/src/gpm-common.h
@@ -26,11 +26,6 @@
 
 G_BEGIN_DECLS
 
-/* do this until we depend on DeviceKit-power 009 */
-#ifndef DKP_CHECK_VERSION
-#define DKP_CHECK_VERSION(o)	(0)
-#endif
-
 #define	GPM_DBUS_SERVICE		"org.gnome.PowerManager"
 #define	GPM_DBUS_INTERFACE		"org.gnome.PowerManager"
 #define	GPM_DBUS_INTERFACE_BACKLIGHT	"org.gnome.PowerManager.Backlight"
diff --git a/src/gpm-control.c b/src/gpm-control.c
index 1b1a63e..825b164 100644
--- a/src/gpm-control.c
+++ b/src/gpm-control.c
@@ -41,7 +41,7 @@
 #include <dbus/dbus-glib-lowlevel.h>
 #include <gnome-keyring.h>
 #include <gconf/gconf-client.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "egg-debug.h"
 #include "egg-console-kit.h"
@@ -56,7 +56,7 @@
 struct GpmControlPrivate
 {
 	GConfClient		*conf;
-	DkpClient		*client;
+	UpClient		*client;
 };
 
 enum {
@@ -178,7 +178,7 @@ gpm_control_suspend (GpmControl *control, GError **error)
 	egg_debug ("emitting sleep");
 	g_signal_emit (control, signals [SLEEP], 0, GPM_CONTROL_ACTION_SUSPEND);
 
-	ret = dkp_client_suspend (control->priv->client, error);
+	ret = up_client_suspend_sync (control->priv->client, NULL, error);
 
 	egg_debug ("emitting resume");
 	g_signal_emit (control, signals [RESUME], 0, GPM_CONTROL_ACTION_SUSPEND);
@@ -246,7 +246,7 @@ gpm_control_hibernate (GpmControl *control, GError **error)
 	egg_debug ("emitting sleep");
 	g_signal_emit (control, signals [SLEEP], 0, GPM_CONTROL_ACTION_HIBERNATE);
 
-	ret = dkp_client_hibernate (control->priv->client, error);
+	ret = up_client_hibernate_sync (control->priv->client, NULL, error);
 
 	egg_debug ("emitting resume");
 	g_signal_emit (control, signals [RESUME], 0, GPM_CONTROL_ACTION_HIBERNATE);
@@ -325,7 +325,7 @@ gpm_control_init (GpmControl *control)
 {
 	control->priv = GPM_CONTROL_GET_PRIVATE (control);
 
-	control->priv->client = dkp_client_new ();
+	control->priv->client = up_client_new ();
 	control->priv->conf = gconf_client_get_default ();
 }
 
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index c768b2e..14f8898 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -25,7 +25,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gconf/gconf-client.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "egg-debug.h"
 
@@ -46,8 +46,8 @@ static void     gpm_engine_finalize   (GObject	  *object);
 struct GpmEnginePrivate
 {
 	GConfClient		*conf;
-	DkpClient		*client;
-	DkpDevice		*battery_composite;
+	UpClient		*client;
+	UpDevice		*battery_composite;
 	GPtrArray		*array;
 	GpmPhone		*phone;
 	GpmIconPolicy		 icon_policy;
@@ -83,8 +83,8 @@ static gpointer gpm_engine_object = NULL;
 
 G_DEFINE_TYPE (GpmEngine, gpm_engine, G_TYPE_OBJECT)
 
-static DkpDevice *gpm_engine_get_composite_device (GpmEngine *engine, DkpDevice *original_device);
-static DkpDevice *gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_device);
+static UpDevice *gpm_engine_get_composite_device (GpmEngine *engine, UpDevice *original_device);
+static UpDevice *gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device);
 
 typedef enum {
 	GPM_ENGINE_WARNING_NONE = 0,
@@ -98,7 +98,7 @@ typedef enum {
  * gpm_engine_get_warning_csr:
  **/
 static GpmEngineWarning
-gpm_engine_get_warning_csr (GpmEngine *engine, DkpDevice *device)
+gpm_engine_get_warning_csr (GpmEngine *engine, UpDevice *device)
 {
 	gdouble percentage;
 
@@ -116,7 +116,7 @@ gpm_engine_get_warning_csr (GpmEngine *engine, DkpDevice *device)
  * gpm_engine_get_warning_percentage:
  **/
 static GpmEngineWarning
-gpm_engine_get_warning_percentage (GpmEngine *engine, DkpDevice *device)
+gpm_engine_get_warning_percentage (GpmEngine *engine, UpDevice *device)
 {
 	gdouble percentage;
 
@@ -141,20 +141,20 @@ gpm_engine_get_warning_percentage (GpmEngine *engine, DkpDevice *device)
  * gpm_engine_get_warning_time:
  **/
 static GpmEngineWarning
-gpm_engine_get_warning_time (GpmEngine *engine, DkpDevice *device)
+gpm_engine_get_warning_time (GpmEngine *engine, UpDevice *device)
 {
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gint64 time_to_empty;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "time-to-empty", &time_to_empty,
 		      NULL);
 
 	/* this is probably an error condition */
 	if (time_to_empty == 0) {
-		egg_debug ("time zero, falling back to percentage for %s", dkp_device_type_to_text (type));
+		egg_debug ("time zero, falling back to percentage for %s", up_device_kind_to_string (kind));
 		return gpm_engine_get_warning_percentage (engine, device);
 	}
 
@@ -176,15 +176,15 @@ gpm_engine_get_warning_time (GpmEngine *engine, DkpDevice *device)
  * Return value: A GpmEngine state, e.g. GPM_ENGINE_WARNING_DISCHARGING
  **/
 static GpmEngineWarning
-gpm_engine_get_warning (GpmEngine *engine, DkpDevice *device)
+gpm_engine_get_warning (GpmEngine *engine, UpDevice *device)
 {
-	DkpDeviceType type;
-	DkpDeviceState state;
+	UpDeviceKind kind;
+	UpDeviceState state;
 	GpmEngineWarning warning_type;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "state", &state,
 		      NULL);
 
@@ -192,24 +192,24 @@ gpm_engine_get_warning (GpmEngine *engine, DkpDevice *device)
 	warning_type = GPM_ENGINE_WARNING_NONE;
 
 	/* if the device in question is on ac, don't give a warning */
-	if (state == DKP_DEVICE_STATE_CHARGING)
+	if (state == UP_DEVICE_STATE_CHARGING)
 		goto out;
 
-	if (type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD) {
+	if (kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD) {
 
 		warning_type = gpm_engine_get_warning_csr (engine, device);
 
-	} else if (type == DKP_DEVICE_TYPE_UPS ||
-		   type == DKP_DEVICE_TYPE_PDA) {
+	} else if (kind == UP_DEVICE_KIND_UPS ||
+		   kind == UP_DEVICE_KIND_PDA) {
 
 		warning_type = gpm_engine_get_warning_percentage (engine, device);
 
-	} else if (type == DKP_DEVICE_TYPE_PHONE) {
+	} else if (kind == UP_DEVICE_KIND_PHONE) {
 
 		warning_type = gpm_engine_get_warning_percentage (engine, device);
 
-	} else if (type == DKP_DEVICE_TYPE_BATTERY) {
+	} else if (kind == UP_DEVICE_KIND_BATTERY) {
 		/* only use the time when it is accurate, and GConf is not disabled */
 		if (engine->priv->use_time_primary)
 			warning_type = gpm_engine_get_warning_time (engine, device);
@@ -219,7 +219,7 @@ gpm_engine_get_warning (GpmEngine *engine, DkpDevice *device)
 
 	/* If we have no important engines, we should test for discharging */
 	if (warning_type == GPM_ENGINE_WARNING_NONE) {
-		if (state == DKP_DEVICE_STATE_DISCHARGING)
+		if (state == UP_DEVICE_STATE_DISCHARGING)
 			warning_type = GPM_ENGINE_WARNING_DISCHARGING;
 	}
 
@@ -239,7 +239,7 @@ gpm_engine_get_summary (GpmEngine *engine)
 {
 	guint i;
 	GPtrArray *array;
-	DkpDevice *device;
+	UpDevice *device;
 	GString *tooltip = NULL;
 	gchar *part;
 
@@ -272,14 +272,14 @@ gpm_engine_get_summary (GpmEngine *engine)
  * Returns the icon
  **/
 static gchar *
-gpm_engine_get_icon_priv (GpmEngine *engine, DkpDeviceType device_type, GpmEngineWarning warning, gboolean use_state)
+gpm_engine_get_icon_priv (GpmEngine *engine, UpDeviceKind device_kind, GpmEngineWarning warning, gboolean use_state)
 {
 	guint i;
 	GPtrArray *array;
-	DkpDevice *device;
+	UpDevice *device;
 	GpmEngineWarning warning_temp;
-	DkpDeviceType type;
-	DkpDeviceState state;
+	UpDeviceKind kind;
+	UpDeviceState state;
 	gboolean is_present;
 
 	/* do we have specific device types? */
@@ -289,24 +289,24 @@ gpm_engine_get_icon_priv (GpmEngine *engine, DkpDeviceType device_type, GpmEngin
 
 		/* get device properties */
 		g_object_get (device,
-			      "type", &type,
+			      "kind", &kind,
 			      "state", &state,
 			      "is-present", &is_present,
 			      NULL);
 
 		/* if battery then use composite device to cope with multiple batteries */
-		if (type == DKP_DEVICE_TYPE_BATTERY)
+		if (kind == UP_DEVICE_KIND_BATTERY)
 			device = gpm_engine_get_composite_device (engine, device);
 
 		warning_temp = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(device), "engine-warning-old"));
-		if (type == device_type && is_present) {
+		if (kind == device_kind && is_present) {
 			if (warning != GPM_ENGINE_WARNING_NONE) {
 				if (warning_temp == warning)
 					return gpm_upower_get_device_icon (device);
 				continue;
 			}
 			if (use_state) {
-				if (state == DKP_DEVICE_STATE_CHARGING || state == DKP_DEVICE_STATE_DISCHARGING)
+				if (state == UP_DEVICE_STATE_CHARGING || state == UP_DEVICE_STATE_DISCHARGING)
 					return gpm_upower_get_device_icon (device);
 				continue;
 			}
@@ -335,16 +335,16 @@ gpm_engine_get_icon (GpmEngine *engine)
 	}
 
 	/* we try CRITICAL: BATTERY, UPS, MOUSE, KEYBOARD */
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_BATTERY, GPM_ENGINE_WARNING_CRITICAL, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_BATTERY, GPM_ENGINE_WARNING_CRITICAL, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_UPS, GPM_ENGINE_WARNING_CRITICAL, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_UPS, GPM_ENGINE_WARNING_CRITICAL, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_MOUSE, GPM_ENGINE_WARNING_CRITICAL, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_MOUSE, GPM_ENGINE_WARNING_CRITICAL, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_KEYBOARD, GPM_ENGINE_WARNING_CRITICAL, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_KEYBOARD, GPM_ENGINE_WARNING_CRITICAL, FALSE);
 	if (icon != NULL)
 		return icon;
 
@@ -355,16 +355,16 @@ gpm_engine_get_icon (GpmEngine *engine)
 	}
 
 	/* we try CRITICAL: BATTERY, UPS, MOUSE, KEYBOARD */
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_BATTERY, GPM_ENGINE_WARNING_LOW, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_BATTERY, GPM_ENGINE_WARNING_LOW, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_UPS, GPM_ENGINE_WARNING_LOW, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_UPS, GPM_ENGINE_WARNING_LOW, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_MOUSE, GPM_ENGINE_WARNING_LOW, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_MOUSE, GPM_ENGINE_WARNING_LOW, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_KEYBOARD, GPM_ENGINE_WARNING_LOW, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_KEYBOARD, GPM_ENGINE_WARNING_LOW, FALSE);
 	if (icon != NULL)
 		return icon;
 
@@ -375,10 +375,10 @@ gpm_engine_get_icon (GpmEngine *engine)
 	}
 
 	/* we try (DIS)CHARGING: BATTERY, UPS */
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_BATTERY, GPM_ENGINE_WARNING_NONE, TRUE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_BATTERY, GPM_ENGINE_WARNING_NONE, TRUE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_UPS, GPM_ENGINE_WARNING_NONE, TRUE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_UPS, GPM_ENGINE_WARNING_NONE, TRUE);
 	if (icon != NULL)
 		return icon;
 
@@ -389,10 +389,10 @@ gpm_engine_get_icon (GpmEngine *engine)
 	}
 
 	/* we try PRESENT: BATTERY, UPS */
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_BATTERY, GPM_ENGINE_WARNING_NONE, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_BATTERY, GPM_ENGINE_WARNING_NONE, FALSE);
 	if (icon != NULL)
 		return icon;
-	icon = gpm_engine_get_icon_priv (engine, DKP_DEVICE_TYPE_UPS, GPM_ENGINE_WARNING_NONE, FALSE);
+	icon = gpm_engine_get_icon_priv (engine, UP_DEVICE_KIND_UPS, GPM_ENGINE_WARNING_NONE, FALSE);
 	if (icon != NULL)
 		return icon;
 
@@ -534,20 +534,20 @@ gpm_engine_conf_key_changed_cb (GConfClient *conf, guint cnxn_id, GConfEntry *en
  * gpm_engine_device_check_capacity:
  **/
 static gboolean
-gpm_engine_device_check_capacity (GpmEngine *engine, DkpDevice *device)
+gpm_engine_device_check_capacity (GpmEngine *engine, UpDevice *device)
 {
 	gboolean ret;
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gdouble capacity;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "capacity", &capacity,
 		      NULL);
 
 	/* not laptop battery */
-	if (type != DKP_DEVICE_TYPE_BATTERY)
+	if (kind != UP_DEVICE_KIND_BATTERY)
 		return FALSE;
 
 	/* capacity okay */
@@ -570,13 +570,13 @@ gpm_engine_device_check_capacity (GpmEngine *engine, DkpDevice *device)
 /**
  * gpm_engine_get_composite_device:
  **/
-static DkpDevice *
-gpm_engine_get_composite_device (GpmEngine *engine, DkpDevice *original_device)
+static UpDevice *
+gpm_engine_get_composite_device (GpmEngine *engine, UpDevice *original_device)
 {
 	guint battery_devices = 0;
 	GPtrArray *array;
-	DkpDevice *device;
-	DkpDeviceType type;
+	UpDevice *device;
+	UpDeviceKind kind;
 	guint i;
 
 	/* find out how many batteries in the system */
@@ -584,9 +584,9 @@ gpm_engine_get_composite_device (GpmEngine *engine, DkpDevice *original_device)
 	for (i=0;i<array->len;i++) {
 		device = g_ptr_array_index (engine->priv->array, i);
 		g_object_get (device,
-			      "type", &type,
+			      "kind", &kind,
 			      NULL);
-		if (type == DKP_DEVICE_TYPE_BATTERY)
+		if (kind == UP_DEVICE_KIND_BATTERY)
 			battery_devices++;
 	}
 
@@ -607,8 +607,8 @@ out:
 /**
  * gpm_engine_update_composite_device:
  **/
-static DkpDevice *
-gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_device)
+static UpDevice *
+gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device)
 {
 	guint i;
 	gdouble percentage;
@@ -625,10 +625,11 @@ gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_devic
 	gboolean is_discharging = FALSE;
 	gboolean is_fully_charged = TRUE;
 	GPtrArray *array;
-	DkpDevice *device;
-	DkpDeviceState state;
-	DkpDeviceType type;
+	UpDevice *device;
+	UpDeviceState state;
+	UpDeviceKind kind;
 	gboolean debug;
+	gchar *text;
 
 	/* are we printing to console? */
 	debug = egg_debug_enabled ();
@@ -638,26 +639,27 @@ gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_devic
 	for (i=0;i<array->len;i++) {
 		device = g_ptr_array_index (engine->priv->array, i);
 		g_object_get (device,
-			      "type", &type,
+			      "kind", &kind,
 			      "state", &state,
 			      "energy", &energy,
 			      "energy-full", &energy_full,
 			      "energy-rate", &energy_rate,
 			      NULL);
-		if (type != DKP_DEVICE_TYPE_BATTERY)
+		if (kind != UP_DEVICE_KIND_BATTERY)
 			continue;
 
 		if (debug) {
-			egg_debug ("printing device %i", i);
-			dkp_device_print (device);
+			text = up_device_to_text (device);
+			egg_debug ("printing device %i:\n%s", i, text);
+			g_free (text);
 		}
 
 		/* one of these will be charging or discharging */
-		if (state == DKP_DEVICE_STATE_CHARGING)
+		if (state == UP_DEVICE_STATE_CHARGING)
 			is_charging = TRUE;
-		if (state == DKP_DEVICE_STATE_DISCHARGING)
+		if (state == UP_DEVICE_STATE_DISCHARGING)
 			is_discharging = TRUE;
-		if (state != DKP_DEVICE_STATE_FULLY_CHARGED)
+		if (state != UP_DEVICE_STATE_FULLY_CHARGED)
 			is_fully_charged = FALSE;
 
 		/* sum up composite */
@@ -679,19 +681,19 @@ gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_devic
 
 	/* set composite state */
 	if (is_charging)
-		state = DKP_DEVICE_STATE_CHARGING;
+		state = UP_DEVICE_STATE_CHARGING;
 	else if (is_discharging)
-		state = DKP_DEVICE_STATE_DISCHARGING;
+		state = UP_DEVICE_STATE_DISCHARGING;
 	else if (is_fully_charged)
-		state = DKP_DEVICE_STATE_FULLY_CHARGED;
+		state = UP_DEVICE_STATE_FULLY_CHARGED;
 	else
-		state = DKP_DEVICE_STATE_UNKNOWN;
+		state = UP_DEVICE_STATE_UNKNOWN;
 
 	/* calculate a quick and dirty time remaining value */
 	if (energy_rate_total > 0) {
-		if (state == DKP_DEVICE_STATE_DISCHARGING)
+		if (state == UP_DEVICE_STATE_DISCHARGING)
 			time_to_empty = 3600 * (energy_total / energy_rate_total);
-		else if (state == DKP_DEVICE_STATE_CHARGING)
+		else if (state == UP_DEVICE_STATE_CHARGING)
 			time_to_full = 3600 * ((energy_full_total - energy_total) / energy_rate_total);
 	}
 
@@ -708,8 +710,11 @@ gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_devic
 		      "percentage", percentage,
 		      "state", state,
 		      NULL);
-	if (debug)
-		dkp_device_print (device);
+	if (debug) {
+		text = up_device_to_text (device);
+		egg_debug ("composite:\n%s", text);
+		g_free (text);
+	}
 
 	/* force update of icon */
 	gpm_engine_recalculate_state_icon (engine);
@@ -722,12 +727,12 @@ out:
  * gpm_engine_device_add:
  **/
 static void
-gpm_engine_device_add (GpmEngine *engine, DkpDevice *device)
+gpm_engine_device_add (GpmEngine *engine, UpDevice *device)
 {
 	GpmEngineWarning warning;
-	DkpDeviceState state;
-	DkpDeviceType type;
-	DkpDevice *composite;
+	UpDeviceState state;
+	UpDeviceKind kind;
+	UpDevice *composite;
 
 	/* assign warning */
 	warning = gpm_engine_get_warning (engine, device);
@@ -738,15 +743,15 @@ gpm_engine_device_add (GpmEngine *engine, DkpDevice *device)
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "state", &state,
 		      NULL);
 
 	/* add old state for transitions */
-	egg_debug ("adding %s with state %s", dkp_device_get_object_path (device), dkp_device_state_to_text (state));
+	egg_debug ("adding %s with state %s", up_device_get_object_path (device), up_device_state_to_string (state));
 	g_object_set_data (G_OBJECT(device), "engine-state-old", GUINT_TO_POINTER(state));
 
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		egg_debug ("updating because we added a device");
 		composite = gpm_engine_update_composite_device (engine, device);
 
@@ -762,25 +767,23 @@ gpm_engine_device_add (GpmEngine *engine, DkpDevice *device)
  * gpm_engine_check_recall:
  **/
 static gboolean
-gpm_engine_check_recall (GpmEngine *engine, DkpDevice *device)
+gpm_engine_check_recall (GpmEngine *engine, UpDevice *device)
 {
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gboolean recall_notice = FALSE;
 	gchar *recall_vendor = NULL;
 	gchar *recall_url = NULL;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
-#if DKP_CHECK_VERSION(0x009)
+		      "kind", &kind,
 		      "recall-notice", &recall_notice,
 		      "recall-vendor", &recall_vendor,
 		      "recall-url", &recall_url,
-#endif
 		      NULL);
 
 	/* not battery */
-	if (type != DKP_DEVICE_TYPE_BATTERY)
+	if (kind != UP_DEVICE_KIND_BATTERY)
 		goto out;
 
 	/* no recall data */
@@ -807,14 +810,22 @@ gpm_engine_coldplug_idle_cb (GpmEngine *engine)
 	gboolean has_battery = FALSE;
 	gboolean has_ups = FALSE;
 	GpmPrefsServer *prefs_server;
-	DkpDevice *device;
-	DkpDeviceType type;
+	UpDevice *device;
+	UpDeviceKind kind;
+	gboolean ret;
+	GError *error = NULL;
 
 	g_return_val_if_fail (engine != NULL, FALSE);
 	g_return_val_if_fail (GPM_IS_ENGINE (engine), FALSE);
 
-	/* get array */
-	engine->priv->array = dkp_client_enumerate_devices (engine->priv->client, NULL);
+	/* get devices from UPower */
+	ret = up_client_enumerate_devices_sync (engine->priv->client, NULL, &error);
+	if (!ret) {
+		egg_error ("failed to get device list: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+	engine->priv->array = up_client_get_devices (engine->priv->client);
 
 	/* do we have specific device types? */
 	array = engine->priv->array;
@@ -823,12 +834,12 @@ gpm_engine_coldplug_idle_cb (GpmEngine *engine)
 
 		/* get device properties */
 		g_object_get (device,
-			      "type", &type,
+			      "kind", &kind,
 			      NULL);
 
-		if (type == DKP_DEVICE_TYPE_BATTERY)
+		if (kind == UP_DEVICE_KIND_BATTERY)
 			has_battery = TRUE;
-		else if (type == DKP_DEVICE_TYPE_UPS)
+		else if (kind == UP_DEVICE_KIND_UPS)
 			has_ups = TRUE;
 	}
 
@@ -851,7 +862,7 @@ gpm_engine_coldplug_idle_cb (GpmEngine *engine)
 		gpm_engine_device_add (engine, device);
 		gpm_engine_check_recall (engine, device);
 	}
-
+out:
 	/* never repeat */
 	return FALSE;
 }
@@ -860,7 +871,7 @@ gpm_engine_coldplug_idle_cb (GpmEngine *engine)
  * gpm_engine_device_added_cb:
  **/
 static void
-gpm_engine_device_added_cb (DkpClient *client, DkpDevice *device, GpmEngine *engine)
+gpm_engine_device_added_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
 {
 	/* add to list */
 	g_ptr_array_add (engine->priv->array, g_object_ref (device));
@@ -873,7 +884,7 @@ gpm_engine_device_added_cb (DkpClient *client, DkpDevice *device, GpmEngine *eng
  * gpm_engine_device_removed_cb:
  **/
 static void
-gpm_engine_device_removed_cb (DkpClient *client, DkpDevice *device, GpmEngine *engine)
+gpm_engine_device_removed_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
 {
 	gboolean ret;
 	ret = g_ptr_array_remove (engine->priv->array, device);
@@ -887,22 +898,22 @@ gpm_engine_device_removed_cb (DkpClient *client, DkpDevice *device, GpmEngine *e
  * gpm_engine_device_changed_cb:
  **/
 static void
-gpm_engine_device_changed_cb (DkpClient *client, DkpDevice *device, GpmEngine *engine)
+gpm_engine_device_changed_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
 {
-	DkpDeviceType type;
-	DkpDeviceState state;
-	DkpDeviceState state_old;
+	UpDeviceKind kind;
+	UpDeviceState state;
+	UpDeviceState state_old;
 	GpmEngineWarning warning_old;
 	GpmEngineWarning warning;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      NULL);
 
 	/* if battery then use composite device to cope with multiple batteries */
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
-		egg_debug ("updating because %s changed", dkp_device_get_object_path (device));
+	if (kind == UP_DEVICE_KIND_BATTERY) {
+		egg_debug ("updating because %s changed", up_device_get_object_path (device));
 		device = gpm_engine_update_composite_device (engine, device);
 	}
 
@@ -911,15 +922,15 @@ gpm_engine_device_changed_cb (DkpClient *client, DkpDevice *device, GpmEngine *e
 		      "state", &state,
 		      NULL);
 
-	egg_debug ("%s state is now %s", dkp_device_get_object_path (device), dkp_device_state_to_text (state));
+	egg_debug ("%s state is now %s", up_device_get_object_path (device), up_device_state_to_string (state));
 
 	/* see if any interesting state changes have happened */
 	state_old = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(device), "engine-state-old"));
 	if (state_old != state) {
-		if (state == DKP_DEVICE_STATE_DISCHARGING) {
+		if (state == UP_DEVICE_STATE_DISCHARGING) {
 			egg_debug ("** EMIT: discharging");
 			g_signal_emit (engine, signals [DISCHARGING], 0, device);
-		} else if (state == DKP_DEVICE_STATE_FULLY_CHARGED) {
+		} else if (state == UP_DEVICE_STATE_FULLY_CHARGED) {
 			egg_debug ("** EMIT: fully charged");
 			g_signal_emit (engine, signals [FULLY_CHARGED], 0, device);
 		}
@@ -952,7 +963,7 @@ gpm_engine_device_changed_cb (DkpClient *client, DkpDevice *device, GpmEngine *e
 /**
  * gpm_engine_get_devices:
  *
- * Return value: the DkpDevice array, free with g_ptr_array_unref()
+ * Return value: the UpDevice array, free with g_ptr_array_unref()
  **/
 GPtrArray *
 gpm_engine_get_devices (GpmEngine *engine)
@@ -966,14 +977,14 @@ gpm_engine_get_devices (GpmEngine *engine)
 static void
 phone_device_added_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 {
-	DkpDevice *device;
-	device = dkp_device_new ();
+	UpDevice *device;
+	device = up_device_new ();
 
 	egg_debug ("phone added %i", idx);
 
 	/* get device properties */
 	g_object_set (device,
-		      "type", DKP_DEVICE_TYPE_PHONE,
+		      "kind", UP_DEVICE_KIND_PHONE,
 		      "is-rechargeable", TRUE,
 		      "native-path", g_strdup_printf ("dummy:phone_%i", idx),
 		      "is-present", TRUE,
@@ -992,8 +1003,8 @@ static void
 phone_device_removed_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 {
 	guint i;
-	DkpDevice *device;
-	DkpDeviceType type;
+	UpDevice *device;
+	UpDeviceKind kind;
 
 	egg_debug ("phone removed %i", idx);
 
@@ -1002,10 +1013,10 @@ phone_device_removed_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 
 		/* get device properties */
 		g_object_get (device,
-			      "type", &type,
+			      "kind", &kind,
 			      NULL);
 
-		if (type == DKP_DEVICE_TYPE_PHONE) {
+		if (kind == UP_DEVICE_KIND_PHONE) {
 			g_ptr_array_remove_index (engine->priv->array, i);
 			break;
 		}
@@ -1022,9 +1033,9 @@ static void
 phone_device_refresh_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 {
 	guint i;
-	DkpDevice *device;
-	DkpDeviceType type;
-	DkpDeviceState state;
+	UpDevice *device;
+	UpDeviceKind kind;
+	UpDeviceState state;
 	gboolean is_present;
 	gdouble percentage;
 
@@ -1035,15 +1046,15 @@ phone_device_refresh_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 
 		/* get device properties */
 		g_object_get (device,
-			      "type", &type,
+			      "kind", &kind,
 			      "state", &state,
 			      "percentage", &percentage,
 			      "is-present", &is_present,
 			      NULL);
 
-		if (type == DKP_DEVICE_TYPE_PHONE) {
+		if (kind == UP_DEVICE_KIND_PHONE) {
 			is_present = gpm_phone_get_present (phone, idx);
-			state = gpm_phone_get_on_ac (phone, idx) ? DKP_DEVICE_STATE_CHARGING : DKP_DEVICE_STATE_DISCHARGING;
+			state = gpm_phone_get_on_ac (phone, idx) ? UP_DEVICE_STATE_CHARGING : UP_DEVICE_STATE_DISCHARGING;
 			percentage = gpm_phone_get_percentage (phone, idx);
 			break;
 		}
@@ -1065,7 +1076,7 @@ gpm_engine_init (GpmEngine *engine)
 	engine->priv = GPM_ENGINE_GET_PRIVATE (engine);
 
 	engine->priv->array = g_ptr_array_new_with_free_func (g_object_unref);
-	engine->priv->client = dkp_client_new ();
+	engine->priv->client = up_client_new ();
 	g_signal_connect (engine->priv->client, "device-added",
 			  G_CALLBACK (gpm_engine_device_added_cb), engine);
 	g_signal_connect (engine->priv->client, "device-removed",
@@ -1087,9 +1098,9 @@ gpm_engine_init (GpmEngine *engine)
 			  G_CALLBACK (phone_device_refresh_cb), engine);
 
 	/* create a fake virtual composite battery */
-	engine->priv->battery_composite = dkp_device_new ();
+	engine->priv->battery_composite = up_device_new ();
 	g_object_set (engine->priv->battery_composite,
-		      "type", DKP_DEVICE_TYPE_BATTERY,
+		      "kind", UP_DEVICE_KIND_BATTERY,
 		      "is-rechargeable", TRUE,
 		      "native-path", "dummy:composite_battery",
 		      "power-supply", TRUE,
diff --git a/src/gpm-engine.h b/src/gpm-engine.h
index bb0be63..be1ccd6 100644
--- a/src/gpm-engine.h
+++ b/src/gpm-engine.h
@@ -23,7 +23,7 @@
 #define __GPM_ENGINE_H
 
 #include <glib-object.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 G_BEGIN_DECLS
 
@@ -50,21 +50,21 @@ typedef struct
 	void		(* summary_changed)	(GpmEngine	*engine,
 						 gchar		*status);
 	void		(* perhaps_recall)	(GpmEngine	*engine,
-						 DkpDevice	*device,
+						 UpDevice	*device,
 						 const gchar	*oem_vendor,
 						 const gchar	*website);
 	void		(* low_capacity)	(GpmEngine	*engine,
-						 DkpDevice	*device);
+						 UpDevice	*device);
 	void		(* charge_low)		(GpmEngine	*engine,
-						 DkpDevice	*device);
+						 UpDevice	*device);
 	void		(* charge_critical)	(GpmEngine	*engine,
-						 DkpDevice	*device);
+						 UpDevice	*device);
 	void		(* charge_action)	(GpmEngine	*engine,
-						 DkpDevice	*device);
+						 UpDevice	*device);
 	void		(* fully_charged)	(GpmEngine	*engine,
-						 DkpDevice	*device);
+						 UpDevice	*device);
 	void		(* discharging)		(GpmEngine	*engine,
-						 DkpDevice	*device);
+						 UpDevice	*device);
 } GpmEngineClass;
 
 GType		 gpm_engine_get_type		(void);
diff --git a/src/gpm-graph-widget.c b/src/gpm-graph-widget.c
index 571820d..a9ba689 100644
--- a/src/gpm-graph-widget.c
+++ b/src/gpm-graph-widget.c
@@ -131,10 +131,10 @@ gpm_graph_widget_key_data_add (GpmGraphWidget *graph, guint32 color, const gchar
 }
 
 /**
- * dkp_graph_get_property:
+ * up_graph_get_property:
  **/
 static void
-dkp_graph_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+up_graph_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
 	GpmGraphWidget *graph = GPM_GRAPH_WIDGET (object);
 	switch (prop_id) {
@@ -175,10 +175,10 @@ dkp_graph_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
 }
 
 /**
- * dkp_graph_set_property:
+ * up_graph_set_property:
  **/
 static void
-dkp_graph_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+up_graph_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
 	GpmGraphWidget *graph = GPM_GRAPH_WIDGET (object);
 
@@ -234,8 +234,8 @@ gpm_graph_widget_class_init (GpmGraphWidgetClass *class)
 	GObjectClass *object_class = G_OBJECT_CLASS (class);
 
 	widget_class->expose_event = gpm_graph_widget_expose;
-	object_class->get_property = dkp_graph_get_property;
-	object_class->set_property = dkp_graph_set_property;
+	object_class->get_property = up_graph_get_property;
+	object_class->set_property = up_graph_set_property;
 	object_class->finalize = gpm_graph_widget_finalize;
 
 	g_type_class_add_private (class, sizeof (GpmGraphWidgetPrivate));
diff --git a/src/gpm-idle.c b/src/gpm-idle.c
index 215cc77..7c0fc5c 100644
--- a/src/gpm-idle.c
+++ b/src/gpm-idle.c
@@ -78,10 +78,10 @@ static gpointer gpm_idle_object = NULL;
 G_DEFINE_TYPE (GpmIdle, gpm_idle, G_TYPE_OBJECT)
 
 /**
- * gpm_idle_mode_to_text:
+ * gpm_idle_mode_to_string:
  **/
 static const gchar *
-gpm_idle_mode_to_text (GpmIdleMode mode)
+gpm_idle_mode_to_string (GpmIdleMode mode)
 {
 	if (mode == GPM_IDLE_MODE_NORMAL)
 		return "normal";
@@ -105,7 +105,7 @@ gpm_idle_set_mode (GpmIdle *idle, GpmIdleMode mode)
 
 	if (mode != idle->priv->mode) {
 		idle->priv->mode = mode;
-		egg_debug ("Doing a state transition: %s", gpm_idle_mode_to_text (mode));
+		egg_debug ("Doing a state transition: %s", gpm_idle_mode_to_string (mode));
 		g_signal_emit (idle, signals [IDLE_CHANGED], 0, mode);
 	}
 }
@@ -140,7 +140,7 @@ static gboolean
 gpm_idle_blank_cb (GpmIdle *idle)
 {
 	if (idle->priv->mode > GPM_IDLE_MODE_BLANK) {
-		egg_debug ("ignoring current mode %s", gpm_idle_mode_to_text (idle->priv->mode));
+		egg_debug ("ignoring current mode %s", gpm_idle_mode_to_string (idle->priv->mode));
 		return FALSE;
 	}
 	gpm_idle_set_mode (idle, GPM_IDLE_MODE_BLANK);
@@ -467,7 +467,7 @@ static void
 gpm_idle_test_idle_changed_cb (GpmIdle *idle, GpmIdleMode mode, EggTest *test)
 {
 	_mode = mode;
-	egg_debug ("idle-changed %s", gpm_idle_mode_to_text (mode));
+	egg_debug ("idle-changed %s", gpm_idle_mode_to_string (mode));
 	egg_test_loop_quit (test);
 }
 
@@ -541,7 +541,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_NORMAL)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	g_print ("*****************************\n");
@@ -555,7 +555,7 @@ gpm_idle_test (gpointer data)
 	if (_mode == GPM_IDLE_MODE_DIM)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check current mode");
@@ -563,7 +563,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_DIM)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check x_idle");
@@ -586,7 +586,7 @@ gpm_idle_test (gpointer data)
 	if (_mode == GPM_IDLE_MODE_BLANK)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check current mode");
@@ -594,7 +594,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_BLANK)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	g_print ("**********************\n");
@@ -608,7 +608,7 @@ gpm_idle_test (gpointer data)
 	if (_mode == GPM_IDLE_MODE_NORMAL)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check current mode");
@@ -616,7 +616,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_NORMAL)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check x_idle");
@@ -639,7 +639,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_DIM)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check x_idle");
@@ -654,7 +654,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_BLANK)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "set dpms off");
@@ -673,7 +673,7 @@ gpm_idle_test (gpointer data)
 	if (mode == GPM_IDLE_MODE_BLANK)
 		egg_test_success (test, NULL);
 	else
-		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_text (mode));
+		egg_test_failed (test, "mode: %s", gpm_idle_mode_to_string (mode));
 
 	/************************************************************/
 	egg_test_title (test, "check x_idle");
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 8e4a18e..0f3c0bb 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -40,7 +40,7 @@
 #include <dbus/dbus-glib-lowlevel.h>
 #include <gconf/gconf-client.h>
 #include <canberra-gtk.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 #include <libnotify/notify.h>
 
 #include "egg-debug.h"
@@ -93,7 +93,7 @@ struct GpmManagerPrivate
 	guint32			 screensaver_lid_throttle_id;
 	guint32                  critical_alert_timeout_id;
 	ca_proplist             *critical_alert_loop_props;
-	DkpClient		*client;
+	UpClient		*client;
 	gboolean		 on_battery;
 	gboolean		 just_resumed;
 	GtkStatusIcon		*status_icon;
@@ -980,7 +980,7 @@ gpm_manager_get_spindown_timeout (GpmManager *manager)
  * gpm_manager_client_changed_cb:
  **/
 static void
-gpm_manager_client_changed_cb (DkpClient *client, GpmManager *manager)
+gpm_manager_client_changed_cb (UpClient *client, GpmManager *manager)
 {
 	gboolean event_when_closed;
 	gint timeout;
@@ -1213,7 +1213,7 @@ gpm_manager_perhaps_recall_delay_cb (GpmManager *manager)
  * gpm_manager_engine_perhaps_recall_cb:
  */
 static void
-gpm_manager_engine_perhaps_recall_cb (GpmEngine *engine, DkpDevice *device, gchar *oem_vendor, gchar *website, GpmManager *manager)
+gpm_manager_engine_perhaps_recall_cb (GpmEngine *engine, UpDevice *device, gchar *oem_vendor, gchar *website, GpmManager *manager)
 {
 	gboolean ret;
 
@@ -1259,7 +1259,7 @@ gpm_manager_engine_summary_changed_cb (GpmEngine *engine, gchar *summary, GpmMan
  * gpm_manager_engine_low_capacity_cb:
  */
 static void
-gpm_manager_engine_low_capacity_cb (GpmEngine *engine, DkpDevice *device, GpmManager *manager)
+gpm_manager_engine_low_capacity_cb (GpmEngine *engine, UpDevice *device, GpmManager *manager)
 {
 	gchar *message = NULL;
 	const gchar *title;
@@ -1296,9 +1296,9 @@ out:
  * gpm_manager_engine_fully_charged_cb:
  */
 static void
-gpm_manager_engine_fully_charged_cb (GpmEngine *engine, DkpDevice *device, GpmManager *manager)
+gpm_manager_engine_fully_charged_cb (GpmEngine *engine, UpDevice *device, GpmManager *manager)
 {
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gchar *native_path = NULL;
 	gboolean ret;
 	guint plural = 1;
@@ -1319,11 +1319,11 @@ gpm_manager_engine_fully_charged_cb (GpmEngine *engine, DkpDevice *device, GpmMa
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "native-path", &native_path,
 		      NULL);
 
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		/* is this a dummy composite device, which is plural? */
 		if (g_str_has_prefix (native_path, "dummy"))
 			plural = 2;
@@ -1346,9 +1346,9 @@ out:
  * gpm_manager_engine_discharging_cb:
  */
 static void
-gpm_manager_engine_discharging_cb (GpmEngine *engine, DkpDevice *device, GpmManager *manager)
+gpm_manager_engine_discharging_cb (GpmEngine *engine, UpDevice *device, GpmManager *manager)
 {
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gboolean ret;
 	const gchar *title;
 	const gchar *message;
@@ -1356,7 +1356,7 @@ gpm_manager_engine_discharging_cb (GpmEngine *engine, DkpDevice *device, GpmMana
 	gint64 time_to_empty;
 	gchar *remaining_text = NULL;
 	gchar *icon = NULL;
-	const gchar *type_desc;
+	const gchar *kind_desc;
 
 	/* only action this if specified in gconf */
 	ret = gconf_client_get_bool (manager->priv->conf, GPM_CONF_NOTIFY_DISCHARGING, NULL);
@@ -1367,7 +1367,7 @@ gpm_manager_engine_discharging_cb (GpmEngine *engine, DkpDevice *device, GpmMana
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "percentage", &percentage,
 		      "time-to-empty", &time_to_empty,
 		      NULL);
@@ -1375,9 +1375,9 @@ gpm_manager_engine_discharging_cb (GpmEngine *engine, DkpDevice *device, GpmMana
 	/* only show text if there is a valid time */
 	if (time_to_empty > 0)
 		remaining_text = gpm_get_timestring (time_to_empty);
-	type_desc = gpm_device_type_to_localised_text (type, 1);
+	kind_desc = gpm_device_kind_to_localised_text (kind, 1);
 
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		/* TRANSLATORS: laptop battery is now discharging */
 		title = _("Battery Discharging");
 
@@ -1387,9 +1387,9 @@ gpm_manager_engine_discharging_cb (GpmEngine *engine, DkpDevice *device, GpmMana
 		} else {
 			/* TRANSLATORS: the device is discharging, but we only have a percentage */
 			message = g_strdup_printf (_("%s discharging (%.1f%%)"),
-						   type_desc, percentage);
+						   kind_desc, percentage);
 		}
-	} else if (type == DKP_DEVICE_TYPE_UPS) {
+	} else if (kind == UP_DEVICE_KIND_UPS) {
 		/* TRANSLATORS: UPS is now discharging */
 		title = _("UPS Discharging");
 
@@ -1399,7 +1399,7 @@ gpm_manager_engine_discharging_cb (GpmEngine *engine, DkpDevice *device, GpmMana
 		} else {
 			/* TRANSLATORS: the device is discharging, but we only have a percentage */
 			message = g_strdup_printf (_("%s discharging (%.1f%%)"),
-						   type_desc, percentage);
+						   kind_desc, percentage);
 		}
 	} else {
 		/* nothing else of interest */
@@ -1422,8 +1422,8 @@ out:
 static gboolean
 gpm_manager_engine_just_laptop_battery (GpmManager *manager)
 {
-	DkpDevice *device;
-	DkpDeviceType type;
+	UpDevice *device;
+	UpDeviceKind kind;
 	GPtrArray *array;
 	gboolean ret = TRUE;
 	guint i;
@@ -1433,8 +1433,8 @@ gpm_manager_engine_just_laptop_battery (GpmManager *manager)
 	array = gpm_engine_get_devices (manager->priv->engine);
 	for (i=0; i<array->len; i++) {
 		device = g_ptr_array_index (array, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type != DKP_DEVICE_TYPE_BATTERY) {
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind != UP_DEVICE_KIND_BATTERY) {
 			ret = FALSE;
 			break;
 		}
@@ -1447,33 +1447,33 @@ gpm_manager_engine_just_laptop_battery (GpmManager *manager)
  * gpm_manager_engine_charge_low_cb:
  */
 static void
-gpm_manager_engine_charge_low_cb (GpmEngine *engine, DkpDevice *device, GpmManager *manager)
+gpm_manager_engine_charge_low_cb (GpmEngine *engine, UpDevice *device, GpmManager *manager)
 {
 	const gchar *title = NULL;
 	gchar *message = NULL;
 	gchar *remaining_text;
 	gchar *icon = NULL;
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gdouble percentage;
 	gint64 time_to_empty;
 	gboolean ret;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "percentage", &percentage,
 		      "time-to-empty", &time_to_empty,
 		      NULL);
 
 	/* check to see if the batteries have not noticed we are on AC */
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		if (!manager->priv->on_battery) {
 			egg_warning ("ignoring critically low message as we are not on battery power");
 			goto out;
 		}
 	}
 
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 
 		/* if the user has no other batteries, drop the "Laptop" wording */
 		ret = gpm_manager_engine_just_laptop_battery (manager);
@@ -1481,7 +1481,7 @@ gpm_manager_engine_charge_low_cb (GpmEngine *engine, DkpDevice *device, GpmManag
 			/* TRANSLATORS: laptop battery low, and we only have one battery */
 			title = _("Battery low");
 		} else {
-			/* TRANSLATORS: laptop battery low, and we have more than one type of battery */
+			/* TRANSLATORS: laptop battery low, and we have more than one kind of battery */
 			title = _("Laptop battery low");
 		}
 
@@ -1490,7 +1490,7 @@ gpm_manager_engine_charge_low_cb (GpmEngine *engine, DkpDevice *device, GpmManag
 		/* TRANSLATORS: tell the user how much time they have got */
 		message = g_strdup_printf (_("Approximately <b>%s</b> remaining (%.1f%%)"), remaining_text, percentage);
 
-	} else if (type == DKP_DEVICE_TYPE_UPS) {
+	} else if (kind == UP_DEVICE_KIND_UPS) {
 		/* TRANSLATORS: UPS is starting to get a little low */
 		title = _("UPS low");
 		remaining_text = gpm_get_timestring (time_to_empty);
@@ -1498,28 +1498,28 @@ gpm_manager_engine_charge_low_cb (GpmEngine *engine, DkpDevice *device, GpmManag
 		/* TRANSLATORS: tell the user how much time they have got */
 		message = g_strdup_printf (_("You have approximately <b>%s</b> of remaining UPS backup power (%.1f%%)"),
 					   remaining_text, percentage);
-	} else if (type == DKP_DEVICE_TYPE_MOUSE) {
+	} else if (kind == UP_DEVICE_KIND_MOUSE) {
 		/* TRANSLATORS: mouse is getting a little low */
 		title = _("Mouse battery low");
 
 		/* TRANSLATORS: tell user more details */
 		message = g_strdup_printf (_("The wireless mouse attached to this computer is low in power (%.1f%%)"), percentage);
 
-	} else if (type == DKP_DEVICE_TYPE_KEYBOARD) {
+	} else if (kind == UP_DEVICE_KIND_KEYBOARD) {
 		/* TRANSLATORS: keyboard is getting a little low */
 		title = _("Keyboard battery low");
 
 		/* TRANSLATORS: tell user more details */
 		message = g_strdup_printf (_("The wireless keyboard attached to this computer is low in power (%.1f%%)"), percentage);
 
-	} else if (type == DKP_DEVICE_TYPE_PDA) {
+	} else if (kind == UP_DEVICE_KIND_PDA) {
 		/* TRANSLATORS: PDA is getting a little low */
 		title = _("PDA battery low");
 
 		/* TRANSLATORS: tell user more details */
 		message = g_strdup_printf (_("The PDA attached to this computer is low in power (%.1f%%)"), percentage);
 
-	} else if (type == DKP_DEVICE_TYPE_PHONE) {
+	} else if (kind == UP_DEVICE_KIND_PHONE) {
 		/* TRANSLATORS: cell phone (mobile) is getting a little low */
 		title = _("Cell phone battery low");
 
@@ -1540,13 +1540,13 @@ out:
  * gpm_manager_engine_charge_critical_cb:
  */
 static void
-gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, GpmManager *manager)
+gpm_manager_engine_charge_critical_cb (GpmEngine *engine, UpDevice *device, GpmManager *manager)
 {
 	const gchar *title = NULL;
 	gchar *message = NULL;
 	gchar *action;
 	gchar *icon = NULL;
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	gdouble percentage;
 	gint64 time_to_empty;
 	GpmActionPolicy policy;
@@ -1554,25 +1554,25 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "percentage", &percentage,
 		      "time-to-empty", &time_to_empty,
 		      NULL);
 
 	/* check to see if the batteries have not noticed we are on AC */
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		if (!manager->priv->on_battery) {
 			egg_warning ("ignoring critically low message as we are not on battery power");
 			goto out;
 		}
 	}
 
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 
 		/* if the user has no other batteries, drop the "Laptop" wording */
 		ret = gpm_manager_engine_just_laptop_battery (manager);
 		if (ret) {
-			/* TRANSLATORS: laptop battery critically low, and only have one type of battery */
+			/* TRANSLATORS: laptop battery critically low, and only have one kind of battery */
 			title = _("Battery critically low");
 		} else {
 			/* TRANSLATORS: laptop battery critically low, and we have more than one type of battery */
@@ -1602,7 +1602,7 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 		}
 
 		g_free (action);
-	} else if (type == DKP_DEVICE_TYPE_UPS) {
+	} else if (kind == UP_DEVICE_KIND_UPS) {
 		gchar *remaining_text;
 
 		/* TRANSLATORS: the UPS is very low */
@@ -1614,7 +1614,7 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 					     "Restore AC power to your computer to avoid losing data."),
 					   remaining_text, percentage);
 		g_free (remaining_text);
-	} else if (type == DKP_DEVICE_TYPE_MOUSE) {
+	} else if (kind == UP_DEVICE_KIND_MOUSE) {
 		/* TRANSLATORS: the mouse battery is very low */
 		title = _("Mouse battery low");
 
@@ -1622,7 +1622,7 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 		message = g_strdup_printf (_("The wireless mouse attached to this computer is very low in power (%.1f%%). "
 					     "This device will soon stop functioning if not charged."),
 					   percentage);
-	} else if (type == DKP_DEVICE_TYPE_KEYBOARD) {
+	} else if (kind == UP_DEVICE_KIND_KEYBOARD) {
 		/* TRANSLATORS: the keyboard battery is very low */
 		title = _("Keyboard battery low");
 
@@ -1630,7 +1630,7 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 		message = g_strdup_printf (_("The wireless keyboard attached to this computer is very low in power (%.1f%%). "
 					     "This device will soon stop functioning if not charged."),
 					   percentage);
-	} else if (type == DKP_DEVICE_TYPE_PDA) {
+	} else if (kind == UP_DEVICE_KIND_PDA) {
 
 		/* TRANSLATORS: the PDA battery is very low */
 		title = _("PDA battery low");
@@ -1639,7 +1639,7 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 		message = g_strdup_printf (_("The PDA attached to this computer is very low in power (%.1f%%). "
 					     "This device will soon stop functioning if not charged."),
 					   percentage);
-	} else if (type == DKP_DEVICE_TYPE_PHONE) {
+	} else if (kind == UP_DEVICE_KIND_PHONE) {
 
 		/* TRANSLATORS: the cell battery is very low */
 		title = _("Cell phone battery low");
@@ -1654,10 +1654,10 @@ gpm_manager_engine_charge_critical_cb (GpmEngine *engine, DkpDevice *device, Gpm
 	icon = gpm_upower_get_device_icon (device);
 	gpm_manager_notify (manager, &manager->priv->notification_warning_low, title, message, GPM_MANAGER_NOTIFY_TIMEOUT_NEVER, icon, NOTIFY_URGENCY_CRITICAL);
 
-	switch (type) {
+	switch (kind) {
 
-	case DKP_DEVICE_TYPE_BATTERY:
-	case DKP_DEVICE_TYPE_UPS:
+	case UP_DEVICE_KIND_BATTERY:
+	case UP_DEVICE_KIND_UPS:
 		egg_debug ("critical charge level reached, starting sound loop");
 		gpm_manager_play_loop_start (manager,
 					     GPM_MANAGER_SOUND_BATTERY_LOW,
@@ -1677,29 +1677,29 @@ out:
  * gpm_manager_engine_charge_action_cb:
  */
 static void
-gpm_manager_engine_charge_action_cb (GpmEngine *engine, DkpDevice *device, GpmManager *manager)
+gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmManager *manager)
 {
 	const gchar *title = NULL;
 	gchar *action;
 	gchar *message = NULL;
 	gchar *icon = NULL;
-	DkpDeviceType type;
+	UpDeviceKind kind;
 	GpmActionPolicy policy;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      NULL);
 
 	/* check to see if the batteries have not noticed we are on AC */
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		if (!manager->priv->on_battery) {
 			egg_warning ("ignoring critically low message as we are not on battery power");
 			goto out;
 		}
 	}
 
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 
 		/* TRANSLATORS: laptop battery is really, really, low */
 		title = _("Laptop battery critically low");
@@ -1738,7 +1738,7 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, DkpDevice *device, GpmMa
 		/* wait 20 seconds for user-panic */
 		g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
 
-	} else if (type == DKP_DEVICE_TYPE_UPS) {
+	} else if (kind == UP_DEVICE_KIND_UPS) {
 		/* TRANSLATORS: UPS is really, really, low */
 		title = _("UPS critically low");
 
@@ -1879,7 +1879,7 @@ gpm_manager_init (GpmManager *manager)
 	manager->priv->notification_fully_charged = NULL;
 	manager->priv->disks = gpm_disks_new ();
 	manager->priv->conf = gconf_client_get_default ();
-	manager->priv->client = dkp_client_new ();
+	manager->priv->client = up_client_new ();
 	g_signal_connect (manager->priv->client, "changed",
 			  G_CALLBACK (gpm_manager_client_changed_cb), manager);
 
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 7596fcd..7927d2e 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -31,7 +31,7 @@
 #include <math.h>
 #include <string.h>
 #include <gconf/gconf-client.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "egg-debug.h"
 #include "egg-console-kit.h"
@@ -48,7 +48,7 @@ static void gpm_prefs_finalize (GObject *object);
 
 struct GpmPrefsPrivate
 {
-	DkpClient		*client;
+	UpClient		*client;
 	GtkBuilder		*builder;
 	gboolean		 has_batteries;
 	gboolean		 has_lcd;
@@ -915,7 +915,7 @@ gpm_prefs_init (GpmPrefs *prefs)
 
 	prefs->priv = GPM_PREFS_GET_PRIVATE (prefs);
 
-	prefs->priv->client = dkp_client_new ();
+	prefs->priv->client = up_client_new ();
 	prefs->priv->console = egg_console_kit_new ();
 	prefs->priv->conf = gconf_client_get_default ();
 	/* watch gnome-power-manager keys */
@@ -942,7 +942,7 @@ gpm_prefs_init (GpmPrefs *prefs)
 	prefs->priv->can_shutdown = TRUE;
 	egg_console_kit_can_stop (prefs->priv->console, &prefs->priv->can_shutdown, NULL);
 
-	/* get values from DkpClient */
+	/* get values from UpClient */
 	g_object_get (prefs->priv->client,
 		      "can-suspend", &prefs->priv->can_suspend,
 		      "can-hibernate", &prefs->priv->can_hibernate,
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index f92ea16..91b844c 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -29,7 +29,7 @@
 #include <gtk/gtk.h>
 #include <dbus/dbus-glib.h>
 #include <gconf/gconf-client.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "egg-debug.h"
 #include "egg-color.h"
@@ -51,7 +51,7 @@ static const gchar *stats_type;
 static guint history_time;
 static GConfClient *gconf_client;
 static gfloat sigma_smoothing = 0.0f;
-static DkpWakeups *wakeups = NULL;
+static UpWakeups *wakeups = NULL;
 static GtkWidget *graph_history = NULL;
 static GtkWidget *graph_statistics = NULL;
 
@@ -272,10 +272,10 @@ gpm_stats_update_smooth_data (GPtrArray *list)
 }
 
 /**
- * gpm_stats_time_to_text:
+ * gpm_stats_time_to_string:
  **/
 static gchar *
-gpm_stats_time_to_text (gint seconds)
+gpm_stats_time_to_string (gint seconds)
 {
 	gfloat value = seconds;
 
@@ -303,10 +303,10 @@ gpm_stats_time_to_text (gint seconds)
 }
 
 /**
- * gpm_stats_bool_to_text:
+ * gpm_stats_bool_to_string:
  **/
 static const gchar *
-gpm_stats_bool_to_text (gboolean ret)
+gpm_stats_bool_to_string (gboolean ret)
 {
 	return ret ? _("Yes") : _("No");
 }
@@ -315,13 +315,13 @@ gpm_stats_bool_to_text (gboolean ret)
  * gpm_stats_get_printable_device_path:
  **/
 static gchar *
-gpm_stats_get_printable_device_path (DkpDevice *device)
+gpm_stats_get_printable_device_path (UpDevice *device)
 {
 	const gchar *object_path;
 	gchar *device_path = NULL;
 
 	/* get object path */
-	object_path = dkp_device_get_object_path (device);
+	object_path = up_device_get_object_path (device);
 	if (object_path != NULL)
 		device_path = g_filename_display_basename (object_path);
 
@@ -332,16 +332,16 @@ gpm_stats_get_printable_device_path (DkpDevice *device)
  * gpm_stats_update_info_page_details:
  **/
 static void
-gpm_stats_update_info_page_details (DkpDevice *device)
+gpm_stats_update_info_page_details (UpDevice *device)
 {
 	struct tm *time_tm;
 	time_t t;
 	gchar time_buf[256];
 	gchar *text;
 	guint refreshed;
-	DkpDeviceType type;
-	DkpDeviceState state;
-	DkpDeviceTechnology technology;
+	UpDeviceKind kind;
+	UpDeviceState state;
+	UpDeviceTechnology technology;
 	gdouble percentage;
 	gdouble capacity;
 	gdouble energy;
@@ -366,7 +366,7 @@ gpm_stats_update_info_page_details (DkpDevice *device)
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "state", &state,
 		      "percentage", &percentage,
 		      "online", &online,
@@ -399,34 +399,34 @@ gpm_stats_update_info_page_details (DkpDevice *device)
 	gpm_stats_add_info_data (_("Device"), device_path);
 	g_free (device_path);
 
-	gpm_stats_add_info_data (_("Type"), gpm_device_type_to_localised_text (type, 1));
+	gpm_stats_add_info_data (_("Type"), gpm_device_kind_to_localised_text (kind, 1));
 	if (vendor != NULL && vendor[0] != '\0')
 		gpm_stats_add_info_data (_("Vendor"), vendor);
 	if (model != NULL && model[0] != '\0')
 		gpm_stats_add_info_data (_("Model"), model);
 	if (serial != NULL && serial[0] != '\0')
 		gpm_stats_add_info_data (_("Serial number"), serial);
-	gpm_stats_add_info_data (_("Supply"), gpm_stats_bool_to_text (power_supply));
+	gpm_stats_add_info_data (_("Supply"), gpm_stats_bool_to_string (power_supply));
 
 	refreshed = (int) (time (NULL) - update_time);
 	text = g_strdup_printf (ngettext ("%d second", "%d seconds", refreshed), refreshed);
 	gpm_stats_add_info_data (_("Refreshed"), text);
 	g_free (text);
 
-	if (type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD ||
-	    type == DKP_DEVICE_TYPE_UPS)
-		gpm_stats_add_info_data (_("Present"), gpm_stats_bool_to_text (is_present));
-	if (type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD)
-		gpm_stats_add_info_data (_("Rechargeable"), gpm_stats_bool_to_text (is_rechargeable));
-	if (type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD)
-		gpm_stats_add_info_data (_("State"), dkp_device_state_to_text (state));
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD ||
+	    kind == UP_DEVICE_KIND_UPS)
+		gpm_stats_add_info_data (_("Present"), gpm_stats_bool_to_string (is_present));
+	if (kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD)
+		gpm_stats_add_info_data (_("Rechargeable"), gpm_stats_bool_to_string (is_rechargeable));
+	if (kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD)
+		gpm_stats_add_info_data (_("State"), up_device_state_to_string (state));
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		text = g_strdup_printf ("%.1f Wh", energy);
 		gpm_stats_add_info_data (_("Energy"), text);
 		g_free (text);
@@ -440,49 +440,49 @@ gpm_stats_update_info_page_details (DkpDevice *device)
 		gpm_stats_add_info_data (_("Energy (design)"), text);
 		g_free (text);
 	}
-	if (type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_MONITOR) {
+	if (kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_MONITOR) {
 		text = g_strdup_printf ("%.1f W", energy_rate);
 		gpm_stats_add_info_data (_("Rate"), text);
 		g_free (text);
 	}
-	if (type == DKP_DEVICE_TYPE_UPS ||
-	    type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_MONITOR) {
+	if (kind == UP_DEVICE_KIND_UPS ||
+	    kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_MONITOR) {
 		text = g_strdup_printf ("%.1f V", voltage);
 		gpm_stats_add_info_data (_("Voltage"), text);
 		g_free (text);
 	}
-	if (type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_UPS) {
+	if (kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_UPS) {
 		if (time_to_full >= 0) {
-			text = gpm_stats_time_to_text (time_to_full);
+			text = gpm_stats_time_to_string (time_to_full);
 			gpm_stats_add_info_data (_("Time to full"), text);
 			g_free (text);
 		}
 		if (time_to_empty >= 0) {
-			text = gpm_stats_time_to_text (time_to_empty);
+			text = gpm_stats_time_to_string (time_to_empty);
 			gpm_stats_add_info_data (_("Time to empty"), text);
 			g_free (text);
 		}
 	}
-	if (type == DKP_DEVICE_TYPE_BATTERY ||
-	    type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD ||
-	    type == DKP_DEVICE_TYPE_UPS) {
+	if (kind == UP_DEVICE_KIND_BATTERY ||
+	    kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD ||
+	    kind == UP_DEVICE_KIND_UPS) {
 		text = g_strdup_printf ("%.1f%%", percentage);
 		gpm_stats_add_info_data (_("Percentage"), text);
 		g_free (text);
 	}
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		text = g_strdup_printf ("%.1f%%", capacity);
 		gpm_stats_add_info_data (_("Capacity"), text);
 		g_free (text);
 	}
-	if (type == DKP_DEVICE_TYPE_BATTERY)
-		gpm_stats_add_info_data (_("Technology"), gpm_device_technology_to_localised_text (technology));
-	if (type == DKP_DEVICE_TYPE_LINE_POWER)
-		gpm_stats_add_info_data (_("Online"), gpm_stats_bool_to_text (online));
+	if (kind == UP_DEVICE_KIND_BATTERY)
+		gpm_stats_add_info_data (_("Technology"), gpm_device_technology_to_localised_string (technology));
+	if (kind == UP_DEVICE_KIND_LINE_POWER)
+		gpm_stats_add_info_data (_("Online"), gpm_stats_bool_to_string (online));
 
 	g_free (vendor);
 	g_free (serial);
@@ -521,11 +521,11 @@ gpm_stats_set_graph_data (GtkWidget *widget, GPtrArray *data, gboolean use_smoot
  * gpm_stats_update_info_page_history:
  **/
 static void
-gpm_stats_update_info_page_history (DkpDevice *device)
+gpm_stats_update_info_page_history (UpDevice *device)
 {
 	GPtrArray *array;
 	guint i;
-	DkpHistoryObj *hobj;
+	UpHistoryItem *item;
 	GtkWidget *widget;
 	gboolean checked;
 	gboolean points;
@@ -565,7 +565,7 @@ gpm_stats_update_info_page_history (DkpDevice *device)
 	}
 
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_history_nodata"));
-	array = dkp_device_get_history (device, history_type, history_time, 150, NULL);
+	array = up_device_get_history_sync (device, history_type, history_time, 150, NULL, NULL);
 	if (array == NULL) {
 		/* show no data label and hide graph */
 		gtk_widget_hide (graph_history);
@@ -581,25 +581,23 @@ gpm_stats_update_info_page_history (DkpDevice *device)
 	offset = timeval.tv_sec;
 
 	for (i=0; i<array->len; i++) {
-		hobj = (DkpHistoryObj *) g_ptr_array_index (array, i);
+		item = (UpHistoryItem *) g_ptr_array_index (array, i);
 
 		/* abandon this point */
-		if (hobj->state == DKP_DEVICE_STATE_UNKNOWN)
+		if (up_history_item_get_state (item) == UP_DEVICE_STATE_UNKNOWN)
 			continue;
 
 		point = gpm_point_obj_new ();
-		point->x = (gint32) hobj->time - offset;
-		point->y = hobj->value;
-		if (hobj->state == DKP_DEVICE_STATE_CHARGING)
+		point->x = (gint32) up_history_item_get_time (item) - offset;
+		point->y = up_history_item_get_value (item);
+		if (up_history_item_get_state (item) == UP_DEVICE_STATE_CHARGING)
 			point->color = egg_color_from_rgb (255, 0, 0);
-		else if (hobj->state == DKP_DEVICE_STATE_DISCHARGING)
+		else if (up_history_item_get_state (item) == UP_DEVICE_STATE_DISCHARGING)
 			point->color = egg_color_from_rgb (0, 0, 255);
-#if DKP_CHECK_VERSION(0x009)
-		else if (hobj->state == DKP_DEVICE_STATE_PENDING_CHARGE)
+		else if (up_history_item_get_state (item) == UP_DEVICE_STATE_PENDING_CHARGE)
 			point->color = egg_color_from_rgb (200, 0, 0);
-		else if (hobj->state == DKP_DEVICE_STATE_PENDING_DISCHARGE)
+		else if (up_history_item_get_state (item) == UP_DEVICE_STATE_PENDING_DISCHARGE)
 			point->color = egg_color_from_rgb (0, 0, 200);
-#endif
 		else {
 			if (g_strcmp0 (history_type, GPM_HISTORY_RATE_VALUE) == 0)
 				point->color = egg_color_from_rgb (255, 255, 255);
@@ -629,11 +627,11 @@ out:
  * gpm_stats_update_info_page_stats:
  **/
 static void
-gpm_stats_update_info_page_stats (DkpDevice *device)
+gpm_stats_update_info_page_stats (UpDevice *device)
 {
 	GPtrArray *array;
 	guint i;
-	DkpStatsObj *sobj;
+	UpStatsItem *item;
 	GtkWidget *widget;
 	gboolean checked;
 	gboolean points;
@@ -676,7 +674,7 @@ gpm_stats_update_info_page_stats (DkpDevice *device)
 	}
 
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_stats_nodata"));
-	array = dkp_device_get_statistics (device, type, NULL);
+	array = up_device_get_statistics_sync (device, type, NULL, NULL);
 	if (array == NULL) {
 		/* show no data label and hide graph */
 		gtk_widget_hide (graph_statistics);
@@ -689,13 +687,13 @@ gpm_stats_update_info_page_stats (DkpDevice *device)
 	gtk_widget_show (graph_statistics);
 
 	for (i=0; i<array->len; i++) {
-		sobj = (DkpStatsObj *) g_ptr_array_index (array, i);
+		item = (UpStatsItem *) g_ptr_array_index (array, i);
 		point = gpm_point_obj_new ();
 		point->x = i;
 		if (use_data)
-			point->y = sobj->value;
+			point->y = up_stats_item_get_value (item);
 		else
-			point->y = sobj->accuracy;
+			point->y = up_stats_item_get_accuracy (item);
 		point->color = egg_color_from_rgb (255, 0, 0);
 		g_ptr_array_add (new, point);
 	}
@@ -720,7 +718,7 @@ out:
  * gpm_stats_update_info_data_page:
  **/
 static void
-gpm_stats_update_info_data_page (DkpDevice *device, gint page)
+gpm_stats_update_info_data_page (UpDevice *device, gint page)
 {
 	if (page == 0)
 		gpm_stats_update_info_page_details (device);
@@ -734,7 +732,7 @@ gpm_stats_update_info_data_page (DkpDevice *device, gint page)
  * gpm_stats_update_info_data:
  **/
 static void
-gpm_stats_update_info_data (DkpDevice *device)
+gpm_stats_update_info_data (UpDevice *device)
 {
 	gint page;
 	GtkNotebook *notebook;
@@ -783,7 +781,7 @@ gpm_stats_update_info_data (DkpDevice *device)
  * gpm_stats_format_cmdline:
  **/
 static gchar *
-gpm_stats_format_cmdline (const DkpWakeupsObj *obj)
+gpm_stats_format_cmdline (UpWakeupItem *item)
 {
 	gchar *found;
 	gchar *temp = NULL;
@@ -791,41 +789,41 @@ gpm_stats_format_cmdline (const DkpWakeupsObj *obj)
 	const gchar *temp_ptr;
 
 	/* nothing */
-	if (obj->cmdline == NULL) {
+	if (up_wakeup_item_get_cmdline (item) == NULL) {
 		/* TRANSLATORS: the command line was not provided */
 		temp_ptr = _("No data");
 		goto out;
 	}
 
 	/* common kernel cmd names */
-	if (g_strcmp0 (obj->cmdline, "insmod") == 0) {
+	if (g_strcmp0 (up_wakeup_item_get_cmdline (item), "insmod") == 0) {
 		/* TRANSLATORS: kernel module, usually a device driver */
 		temp_ptr = _("Kernel module");
 		goto out;
 	}
-	if (g_strcmp0 (obj->cmdline, "modprobe") == 0) {
+	if (g_strcmp0 (up_wakeup_item_get_cmdline (item), "modprobe") == 0) {
 		/* TRANSLATORS: kernel module, usually a device driver */
 		temp_ptr = _("Kernel module");
 		goto out;
 	}
-	if (g_strcmp0 (obj->cmdline, "swapper") == 0) {
+	if (g_strcmp0 (up_wakeup_item_get_cmdline (item), "swapper") == 0) {
 		/* TRANSLATORS: kernel housekeeping */
 		temp_ptr = _("Kernel core");
 		goto out;
 	}
-	if (g_strcmp0 (obj->cmdline, "kernel-ipi") == 0) {
+	if (g_strcmp0 (up_wakeup_item_get_cmdline (item), "kernel-ipi") == 0) {
 		/* TRANSLATORS: interrupt between processors */
 		temp_ptr = _("Interprocessor interrupt");
 		goto out;
 	}
-	if (g_strcmp0 (obj->cmdline, "interrupt") == 0) {
+	if (g_strcmp0 (up_wakeup_item_get_cmdline (item), "interrupt") == 0) {
 		/* TRANSLATORS: unknown interrupt */
 		temp_ptr = _("Interrupt");
 		goto out;
 	}
 
 	/* truncate at first space or ':' */
-	temp = g_strdup (obj->cmdline);
+	temp = g_strdup (up_wakeup_item_get_cmdline (item));
 	found = strstr (temp, ":");
 	if (found != NULL)
 		*found = '\0';
@@ -842,7 +840,7 @@ gpm_stats_format_cmdline (const DkpWakeupsObj *obj)
 
 out:
 	/* format command line */
-	if (obj->is_userspace)
+	if (up_wakeup_item_get_is_userspace (item))
 		cmdline = g_markup_escape_text (temp_ptr, -1);
 	else
 		cmdline = g_markup_printf_escaped ("<i>%s</i>", temp_ptr);
@@ -856,83 +854,87 @@ out:
  * gpm_stats_format_details:
  **/
 static gchar *
-gpm_stats_format_details (const DkpWakeupsObj *obj)
+gpm_stats_format_details (UpWakeupItem *item)
 {
 	gchar *details;
+	const gchar *data;
+
+	/* get this once to avoid a load of derefs */
+	data = up_wakeup_item_get_details (item);
 
 	/* replace common driver names */
-	if (g_strcmp0 (obj->details, "i8042") == 0) {
+	if (g_strcmp0 (data, "i8042") == 0) {
 		/* TRANSLATORS: the keyboard and mouse device event */
 		details = g_strdup (_("PS/2 keyboard/mouse/touchpad"));
-	} else if (g_strcmp0 (obj->details, "acpi") == 0) {
+	} else if (g_strcmp0 (data, "acpi") == 0) {
 		/* TRANSLATORS: ACPI, the Intel power standard on laptops and desktops */
 		details = g_strdup (_("ACPI"));
-	} else if (g_strcmp0 (obj->details, "ata_piix") == 0) {
+	} else if (g_strcmp0 (data, "ata_piix") == 0) {
 		/* TRANSLATORS: serial ATA is a new style of hard disk interface */
 		details = g_strdup (_("Serial ATA"));
-	} else if (g_strcmp0 (obj->details, "libata") == 0) {
+	} else if (g_strcmp0 (data, "libata") == 0) {
 		/* TRANSLATORS: this is the old-style ATA interface */
 		details = g_strdup (_("ATA host controller"));
-	} else if (g_strcmp0 (obj->details, "iwl3945") == 0 || g_strcmp0 (obj->details, "iwlagn") == 0) {
+	} else if (g_strcmp0 (data, "iwl3945") == 0 || g_strcmp0 (data, "iwlagn") == 0) {
 		/* TRANSLATORS: 802.11 wireless adaptor */
 		details = g_strdup (_("Intel wireless adaptor"));
 
 	/* try to make the wakeup type nicer */
-	} else if (g_str_has_prefix (obj->details, "__mod_timer")) {
+	} else if (g_str_has_prefix (data, "__mod_timer")) {
 		/* TRANSLATORS: a timer is something that fires periodically */
-		details = g_strdup_printf (_("Timer %s"), obj->details+12);
-	} else if (g_str_has_prefix (obj->details, "mod_timer")) {
+		details = g_strdup_printf (_("Timer %s"), data+12);
+	} else if (g_str_has_prefix (data, "mod_timer")) {
 		/* TRANSLATORS: a timer is something that fires periodically */
-		details = g_strdup_printf (_("Timer %s"), obj->details+10);
-	} else if (g_str_has_prefix (obj->details, "hrtimer_start_expires")) {
+		details = g_strdup_printf (_("Timer %s"), data+10);
+	} else if (g_str_has_prefix (data, "hrtimer_start_expires")) {
 		/* TRANSLATORS: a timer is something that fires periodically */
-		details = g_strdup_printf (_("Timer %s"), obj->details+22);
-	} else if (g_str_has_prefix (obj->details, "hrtimer_start")) {
+		details = g_strdup_printf (_("Timer %s"), data+22);
+	} else if (g_str_has_prefix (data, "hrtimer_start")) {
 		/* TRANSLATORS: a timer is something that fires periodically */
-		details = g_strdup_printf (_("Timer %s"), obj->details+14);
-	} else if (g_str_has_prefix (obj->details, "do_setitimer")) {
+		details = g_strdup_printf (_("Timer %s"), data+14);
+	} else if (g_str_has_prefix (data, "do_setitimer")) {
 		/* TRANSLATORS: a timer is something that fires periodically */
-		details = g_strdup_printf (_("Timer %s"), obj->details+10);
-	} else if (g_str_has_prefix (obj->details, "do_nanosleep")) {
+		details = g_strdup_printf (_("Timer %s"), data+10);
+	} else if (g_str_has_prefix (data, "do_nanosleep")) {
 		/* TRANSLATORS: this is a task that's woken up from sleeping */
-		details = g_strdup_printf (_("Sleep %s"), obj->details+13);
-	} else if (g_str_has_prefix (obj->details, "enqueue_task_rt")) {
+		details = g_strdup_printf (_("Sleep %s"), data+13);
+	} else if (g_str_has_prefix (data, "enqueue_task_rt")) {
 		/* TRANSLATORS: this is a new realtime task */
-		details = g_strdup_printf (_("New task %s"), obj->details+16);
-	} else if (g_str_has_prefix (obj->details, "futex_wait")) {
+		details = g_strdup_printf (_("New task %s"), data+16);
+	} else if (g_str_has_prefix (data, "futex_wait")) {
 		/* TRANSLATORS: this is a task thats woken to check state */
-		details = g_strdup_printf (_("Wait %s"), obj->details+11);
-	} else if (g_str_has_prefix (obj->details, "queue_delayed_work_on")) {
+		details = g_strdup_printf (_("Wait %s"), data+11);
+	} else if (g_str_has_prefix (data, "queue_delayed_work_on")) {
 		/* TRANSLATORS: a work queue is a list of work that has to be done */
-		details = g_strdup_printf (_("Work queue %s"), obj->details+22);
-	} else if (g_str_has_prefix (obj->details, "queue_delayed_work")) {
+		details = g_strdup_printf (_("Work queue %s"), data+22);
+	} else if (g_str_has_prefix (data, "queue_delayed_work")) {
 		/* TRANSLATORS: a work queue is a list of work that has to be done */
-		details = g_strdup_printf (_("Work queue %s"), obj->details+19);
-	} else if (g_str_has_prefix (obj->details, "dst_run_gc")) {
+		details = g_strdup_printf (_("Work queue %s"), data+19);
+	} else if (g_str_has_prefix (data, "dst_run_gc")) {
 		/* TRANSLATORS: this is when the networking subsystem clears out old entries */
-		details = g_strdup_printf (_("Network route flush %s"), obj->details+11);
-	} else if (g_str_has_prefix (obj->details, "usb_hcd_poll_rh_status")) {
+		details = g_strdup_printf (_("Network route flush %s"), data+11);
+	} else if (g_str_has_prefix (data, "usb_hcd_poll_rh_status")) {
 		/* TRANSLATORS: activity on the USB bus */
-		details = g_strdup_printf (_("USB activity %s"), obj->details+23);
-	} else if (g_str_has_prefix (obj->details, "schedule_hrtimeout_range")) {
+		details = g_strdup_printf (_("USB activity %s"), data+23);
+	} else if (g_str_has_prefix (data, "schedule_hrtimeout_range")) {
 		/* TRANSLATORS: we've timed out of an aligned timer */
-		details = g_strdup_printf (_("Wakeup %s"), obj->details+25);
-	} else if (g_str_has_prefix (obj->details, "Local timer interrupts")) {
+		details = g_strdup_printf (_("Wakeup %s"), data+25);
+	} else if (g_str_has_prefix (data, "Local timer interrupts")) {
 		/* TRANSLATORS: interupts on the system required for basic operation */
 		details = g_strdup (_("Local interrupts"));
-	} else if (g_str_has_prefix (obj->details, "Rescheduling interrupts")) {
+	} else if (g_str_has_prefix (data, "Rescheduling interrupts")) {
 		/* TRANSLATORS: interrupts when a task gets moved from one core to another */
 		details = g_strdup (_("Rescheduling interrupts"));
 	} else
-		details = g_markup_escape_text (obj->details, -1);
+		details = g_markup_escape_text (data, -1);
 
 	return details;
 }
 /**
- * gpm_stats_add_wakeups_obj:
+ * gpm_stats_add_wakeups_item:
  **/
 static void
-gpm_stats_add_wakeups_obj (const DkpWakeupsObj *obj)
+gpm_stats_add_wakeups_item (UpWakeupItem *item)
 {
 	const gchar *icon;
 	gchar *value;
@@ -941,23 +943,23 @@ gpm_stats_add_wakeups_obj (const DkpWakeupsObj *obj)
 	gchar *cmdline;
 	GtkTreeIter iter;
 
-	if (obj->is_userspace) {
+	if (up_wakeup_item_get_is_userspace (item)) {
 		icon = "application-x-executable";
-		id = g_strdup_printf ("%i", obj->id);
+		id = g_strdup_printf ("%i", up_wakeup_item_get_id (item));
 	} else {
 		icon = "applications-system";
-		if (obj->id < 0xff0)
-			id = g_strdup_printf ("IRQ%i", obj->id);
+		if (up_wakeup_item_get_id (item) < 0xff0)
+			id = g_strdup_printf ("IRQ%i", up_wakeup_item_get_id (item));
 		else
 			id = g_strdup ("IRQx");
 	}
 
 	/* formate value to one decimal place */
-	value = g_strdup_printf ("%.1f", obj->value);
+	value = g_strdup_printf ("%.1f", up_wakeup_item_get_value (item));
 
 	/* get formatted lines */
-	cmdline = gpm_stats_format_cmdline (obj);
-	details = gpm_stats_format_details (obj);
+	cmdline = gpm_stats_format_cmdline (item);
+	details = gpm_stats_format_details (item);
 
 	gtk_list_store_append (list_store_wakeups, &iter);
 	gtk_list_store_set (list_store_wakeups, &iter,
@@ -981,7 +983,7 @@ gpm_stats_update_wakeups_data (void)
 	GtkWidget *widget;
 	GtkWidget *page_widget;
 	guint total;
-	DkpWakeupsObj *obj;
+	UpWakeupItem *item;
 	gchar *text;
 	guint i;
 	GError *error = NULL;
@@ -1002,7 +1004,7 @@ gpm_stats_update_wakeups_data (void)
 	gtk_widget_show (page_widget);
 
 	/* show total */
-	total = dkp_wakeups_get_total (wakeups, &error);
+	total = up_wakeups_get_total_sync (wakeups, NULL, &error);
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_total_wakeups"));
 	if (error == NULL) {
 		text = g_strdup_printf ("%i", total);
@@ -1015,12 +1017,12 @@ gpm_stats_update_wakeups_data (void)
 
 	/* get data */
 	gtk_list_store_clear (list_store_wakeups);
-	array = dkp_wakeups_get_data (wakeups, NULL);
+	array = up_wakeups_get_data_sync (wakeups, NULL, NULL);
 	if (array == NULL)
 		return;
 	for (i=0; i<array->len; i++) {
-		obj = g_ptr_array_index (array, i);
-		gpm_stats_add_wakeups_obj (obj);
+		item = g_ptr_array_index (array, i);
+		gpm_stats_add_wakeups_item (item);
 	}
 	g_ptr_array_unref (array);
 }
@@ -1052,7 +1054,7 @@ gpm_stats_set_title (GtkWindow *window, gint page_num)
 static void
 gpm_stats_notebook_changed_cb (GtkNotebook *notebook, GtkNotebookPage *page, gint page_num, gpointer user_data)
 {
-	DkpDevice *device;
+	UpDevice *device;
 	GtkWidget *widget;
 
 	/* set the window title depending on the mode */
@@ -1068,8 +1070,8 @@ gpm_stats_notebook_changed_cb (GtkNotebook *notebook, GtkNotebookPage *page, gin
 	if (g_strcmp0 (current_device, "wakeups") == 0)
 		return;
 
-	device = dkp_device_new ();
-	dkp_device_set_object_path (device, current_device, NULL);
+	device = up_device_new ();
+	up_device_set_object_path_sync (device, current_device, NULL, NULL);
 	gpm_stats_update_info_data_page (device, page_num);
 	gpm_stats_update_info_data (device);
 	g_object_unref (device);
@@ -1081,9 +1083,9 @@ gpm_stats_notebook_changed_cb (GtkNotebook *notebook, GtkNotebookPage *page, gin
 static void
 gpm_stats_button_update_ui (void)
 {
-	DkpDevice *device;
-	device = dkp_device_new ();
-	dkp_device_set_object_path (device, current_device, NULL);
+	UpDevice *device;
+	device = up_device_new ();
+	up_device_set_object_path_sync (device, current_device, NULL, NULL);
 	gpm_stats_update_info_data (device);
 	g_object_unref (device);
 }
@@ -1096,7 +1098,7 @@ gpm_stats_devices_treeview_clicked_cb (GtkTreeSelection *selection, gboolean dat
 {
 	GtkTreeModel *model;
 	GtkTreeIter iter;
-	DkpDevice *device;
+	UpDevice *device;
 
 	/* This will only work in single or browse selection mode! */
 	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
@@ -1113,8 +1115,8 @@ gpm_stats_devices_treeview_clicked_cb (GtkTreeSelection *selection, gboolean dat
 		if (g_strcmp0 (current_device, "wakeups") == 0) {
 			gpm_stats_update_wakeups_data ();
 		} else {
-			device = dkp_device_new ();
-			dkp_device_set_object_path (device, current_device, NULL);
+			device = up_device_new ();
+			up_device_set_object_path_sync (device, current_device, NULL, NULL);
 			gpm_stats_update_info_data (device);
 			g_object_unref (device);
 		}
@@ -1139,21 +1141,21 @@ gpm_stats_window_activated_cb (EggUnique *egg_unique, gpointer data)
  * gpm_stats_add_device:
  **/
 static void
-gpm_stats_add_device (DkpDevice *device)
+gpm_stats_add_device (UpDevice *device)
 {
 	const gchar *id;
 	GtkTreeIter iter;
 	const gchar *text;
 	const gchar *icon;
-	DkpDeviceType type;
+	UpDeviceKind kind;
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      NULL);
 
-	id = dkp_device_get_object_path (device);
-	text = gpm_device_type_to_localised_text (type, 1);
+	id = up_device_get_object_path (device);
+	text = gpm_device_kind_to_localised_text (kind, 1);
 	icon = gpm_upower_get_device_icon (device);
 
 	gtk_list_store_append (list_store_devices, &iter);
@@ -1167,7 +1169,7 @@ gpm_stats_add_device (DkpDevice *device)
  * gpm_stats_data_changed_cb:
  **/
 static void
-gpm_stats_data_changed_cb (DkpClient *client, gpointer user_data)
+gpm_stats_data_changed_cb (UpClient *client, gpointer user_data)
 {
 	if (g_strcmp0 (current_device, "wakeups") == 0)
 		gpm_stats_update_wakeups_data ();
@@ -1177,10 +1179,10 @@ gpm_stats_data_changed_cb (DkpClient *client, gpointer user_data)
  * gpm_stats_device_added_cb:
  **/
 static void
-gpm_stats_device_added_cb (DkpClient *client, DkpDevice *device, gpointer user_data)
+gpm_stats_device_added_cb (UpClient *client, UpDevice *device, gpointer user_data)
 {
 	const gchar *object_path;
-	object_path = dkp_device_get_object_path (device);
+	object_path = up_device_get_object_path (device);
 	egg_debug ("added:     %s", object_path);
 	gpm_stats_add_device (device);
 }
@@ -1189,10 +1191,10 @@ gpm_stats_device_added_cb (DkpClient *client, DkpDevice *device, gpointer user_d
  * gpm_stats_device_changed_cb:
  **/
 static void
-gpm_stats_device_changed_cb (DkpClient *client, DkpDevice *device, gpointer user_data)
+gpm_stats_device_changed_cb (UpClient *client, UpDevice *device, gpointer user_data)
 {
 	const gchar *object_path;
-	object_path = dkp_device_get_object_path (device);
+	object_path = up_device_get_object_path (device);
 	if (object_path == NULL || current_device == NULL)
 		return;
 	egg_debug ("changed:   %s", object_path);
@@ -1204,14 +1206,14 @@ gpm_stats_device_changed_cb (DkpClient *client, DkpDevice *device, gpointer user
  * gpm_stats_device_removed_cb:
  **/
 static void
-gpm_stats_device_removed_cb (DkpClient *client, DkpDevice *device, gpointer user_data)
+gpm_stats_device_removed_cb (UpClient *client, UpDevice *device, gpointer user_data)
 {
 	const gchar *object_path;
 	GtkTreeIter iter;
 	gchar *id = NULL;
 	gboolean ret;
 
-	object_path = dkp_device_get_object_path (device);
+	object_path = up_device_get_object_path (device);
 	egg_debug ("removed:   %s", object_path);
 	if (g_strcmp0 (current_device, object_path) == 0) {
 		gtk_list_store_clear (list_store_info);
@@ -1480,10 +1482,10 @@ main (int argc, char *argv[])
 	GtkTreeSelection *selection;
 	EggUnique *egg_unique;
 	gboolean ret;
-	DkpClient *client;
+	UpClient *client;
 	GPtrArray *devices;
-	DkpDevice *device;
-	DkpDeviceType type;
+	UpDevice *device;
+	UpDeviceKind kind;
 	guint i;
 	gint page;
 	gboolean checked;
@@ -1704,69 +1706,72 @@ main (int argc, char *argv[])
 	g_signal_connect (G_OBJECT (widget), "changed",
 			  G_CALLBACK (gpm_stats_range_combo_changed), NULL);
 
-	client = dkp_client_new ();
-	g_signal_connect (client, "device-added", G_CALLBACK (gpm_stats_device_added_cb), NULL);
-	g_signal_connect (client, "device-removed", G_CALLBACK (gpm_stats_device_removed_cb), NULL);
-	g_signal_connect (client, "device-changed", G_CALLBACK (gpm_stats_device_changed_cb), NULL);
+	client = up_client_new ();
 
-	wakeups = dkp_wakeups_new ();
+	wakeups = up_wakeups_new ();
 	g_signal_connect (wakeups, "data-changed", G_CALLBACK (gpm_stats_data_changed_cb), NULL);
 
 	/* coldplug */
-	devices = dkp_client_enumerate_devices (client, NULL);
-	if (devices == NULL)
+	ret = up_client_enumerate_devices_sync (client, NULL, NULL);
+	if (!ret)
 		goto out;
+	devices = up_client_get_devices (client);
 
 	/* add devices in visually pleasing order */
 	for (i=0; i < devices->len; i++) {
 		device = g_ptr_array_index (devices, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type == DKP_DEVICE_TYPE_LINE_POWER)
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind == UP_DEVICE_KIND_LINE_POWER)
 			gpm_stats_add_device (device);
 	}
 	for (i=0; i < devices->len; i++) {
 		device = g_ptr_array_index (devices, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type == DKP_DEVICE_TYPE_BATTERY)
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind == UP_DEVICE_KIND_BATTERY)
 			gpm_stats_add_device (device);
 	}
 	for (i=0; i < devices->len; i++) {
 		device = g_ptr_array_index (devices, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type == DKP_DEVICE_TYPE_UPS)
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind == UP_DEVICE_KIND_UPS)
 			gpm_stats_add_device (device);
 	}
 	for (i=0; i < devices->len; i++) {
 		device = g_ptr_array_index (devices, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type == DKP_DEVICE_TYPE_MONITOR)
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind == UP_DEVICE_KIND_MONITOR)
 			gpm_stats_add_device (device);
 	}
 	for (i=0; i < devices->len; i++) {
 		device = g_ptr_array_index (devices, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type == DKP_DEVICE_TYPE_MOUSE)
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind == UP_DEVICE_KIND_MOUSE)
 			gpm_stats_add_device (device);
 	}
 	for (i=0; i < devices->len; i++) {
 		device = g_ptr_array_index (devices, i);
-		g_object_get (device, "type", &type, NULL);
-		if (type == DKP_DEVICE_TYPE_KEYBOARD)
+		g_object_get (device, "kind", &kind, NULL);
+		if (kind == UP_DEVICE_KIND_KEYBOARD)
 			gpm_stats_add_device (device);
 	}
 
+	/* connect now the coldplug is done */
+	g_signal_connect (client, "device-added", G_CALLBACK (gpm_stats_device_added_cb), NULL);
+	g_signal_connect (client, "device-removed", G_CALLBACK (gpm_stats_device_removed_cb), NULL);
+	g_signal_connect (client, "device-changed", G_CALLBACK (gpm_stats_device_changed_cb), NULL);
+
 	/* set current device */
 	if (devices->len > 0) {
 		device = g_ptr_array_index (devices, 0);
 		gpm_stats_update_info_data (device);
-		current_device = g_strdup (dkp_device_get_object_path (device));
+		current_device = g_strdup (up_device_get_object_path (device));
 	}
 
 	if (last_device == NULL)
 		last_device = gconf_client_get_string (gconf_client, GPM_CONF_INFO_LAST_DEVICE, NULL);
 
 	/* has capability to measure wakeups */
-	ret = dkp_wakeups_has_capability (wakeups);
+	ret = up_wakeups_get_has_capability (wakeups);
 	if (ret) {
 		GtkTreeIter iter;
 		gtk_list_store_append (list_store_devices, &iter);
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index 569d490..4b9623d 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -39,7 +39,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gconf/gconf-client.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "egg-debug.h"
 
@@ -201,7 +201,7 @@ gpm_tray_icon_class_init (GpmTrayIconClass *klass)
  * gpm_tray_icon_add_device:
  **/
 static guint
-gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *array, DkpDeviceType type)
+gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *array, UpDeviceKind kind)
 {
 	guint i;
 	guint added = 0;
@@ -211,8 +211,8 @@ gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *arr
 	GtkWidget *image;
 	const gchar *object_path;
 	const gchar *desc;
-	DkpDevice *device;
-	DkpDeviceType type_tmp;
+	UpDevice *device;
+	UpDeviceKind kind_tmp;
 	gdouble percentage;
 
 	/* find type */
@@ -221,19 +221,19 @@ gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *arr
 
 		/* get device properties */
 		g_object_get (device,
-			      "type", &type_tmp,
+			      "kind", &kind_tmp,
 			      "percentage", &percentage,
 			      NULL);
 
-		if (type != type_tmp)
+		if (kind != kind_tmp)
 			continue;
 
-		object_path = dkp_device_get_object_path (device);
+		object_path = up_device_get_object_path (device);
 		egg_debug ("adding device %s", object_path);
 		added++;
 
 		/* generate the label */
-		desc = gpm_device_type_to_localised_text (type, 1);
+		desc = gpm_device_kind_to_localised_text (kind, 1);
 		label = g_strdup_printf ("%s (%.1f%%)", desc, percentage);
 		item = gtk_image_menu_item_new_with_label (label);
 
@@ -270,12 +270,12 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon, guint32 timestamp)
 
 	/* add all device types to the drop down menu */
 	array = gpm_engine_get_devices (icon->priv->engine);
-	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_BATTERY);
-	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_UPS);
-	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_MOUSE);
-	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_KEYBOARD);
-	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_PDA);
-	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_PHONE);
+	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_BATTERY);
+	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_UPS);
+	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_MOUSE);
+	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_KEYBOARD);
+	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_PDA);
+	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, UP_DEVICE_KIND_PHONE);
 	g_ptr_array_unref (array);
 
 	/* skip for things like live-cd's and GDM */
diff --git a/src/gpm-upower.c b/src/gpm-upower.c
index c2eb8bd..838c252 100644
--- a/src/gpm-upower.c
+++ b/src/gpm-upower.c
@@ -22,7 +22,7 @@
 #include "config.h"
 
 #include <glib/gi18n.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 #include "egg-debug.h"
 #include "egg-precision.h"
@@ -30,8 +30,8 @@
 #include "gpm-upower.h"
 #include "gpm-common.h"
 
-#define GPM_DKP_TIME_PRECISION			5*60
-#define GPM_DKP_TEXT_MIN_TIME			120
+#define GPM_UP_TIME_PRECISION			5*60
+#define GPM_UP_TEXT_MIN_TIME			120
 
 /**
  * gpm_upower_get_device_icon_index:
@@ -48,7 +48,7 @@
  * Return value: The character string for the filename suffix.
  **/
 static const gchar *
-gpm_upower_get_device_icon_index (DkpDevice *device)
+gpm_upower_get_device_icon_index (UpDevice *device)
 {
 	gdouble percentage;
 	/* get device properties */
@@ -73,13 +73,13 @@ gpm_upower_get_device_icon_index (DkpDevice *device)
  *
  **/
 gchar *
-gpm_upower_get_device_icon (DkpDevice *device)
+gpm_upower_get_device_icon (UpDevice *device)
 {
 	gchar *filename = NULL;
 	const gchar *prefix = NULL;
 	const gchar *index_str;
-	DkpDeviceType type;
-	DkpDeviceState state;
+	UpDeviceKind kind;
+	UpDeviceState state;
 	gboolean is_present;
 	gdouble percentage;
 
@@ -87,108 +87,78 @@ gpm_upower_get_device_icon (DkpDevice *device)
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "state", &state,
 		      "percentage", &percentage,
 		      "is-present", &is_present,
 		      NULL);
 
 	/* get correct icon prefix */
-	prefix = dkp_device_type_to_text (type);
+	prefix = up_device_kind_to_string (kind);
 
 	/* get the icon from some simple rules */
-	if (type == DKP_DEVICE_TYPE_LINE_POWER) {
+	if (kind == UP_DEVICE_KIND_LINE_POWER) {
 		filename = g_strdup ("gpm-ac-adapter");
-	} else if (type == DKP_DEVICE_TYPE_MONITOR) {
+	} else if (kind == UP_DEVICE_KIND_MONITOR) {
 		filename = g_strdup ("gpm-monitor");
-	} else if (type == DKP_DEVICE_TYPE_UPS) {
+	} else if (kind == UP_DEVICE_KIND_UPS) {
 		if (!is_present) {
 			/* battery missing */
 			filename = g_strdup_printf ("gpm-%s-missing", prefix);
 
-		} else if (state == DKP_DEVICE_STATE_FULLY_CHARGED) {
+		} else if (state == UP_DEVICE_STATE_FULLY_CHARGED) {
 			filename = g_strdup_printf ("gpm-%s-100", prefix);
 
-		} else if (state == DKP_DEVICE_STATE_CHARGING) {
+		} else if (state == UP_DEVICE_STATE_CHARGING) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			filename = g_strdup_printf ("gpm-%s-%s-charging", prefix, index_str);
 
-		} else if (state == DKP_DEVICE_STATE_DISCHARGING) {
+		} else if (state == UP_DEVICE_STATE_DISCHARGING) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
 		}
-	} else if (type == DKP_DEVICE_TYPE_BATTERY) {
+	} else if (kind == UP_DEVICE_KIND_BATTERY) {
 		if (!is_present) {
 			/* battery missing */
 			filename = g_strdup_printf ("gpm-%s-missing", prefix);
 
-		} else if (state == DKP_DEVICE_STATE_EMPTY) {
+		} else if (state == UP_DEVICE_STATE_EMPTY) {
 			filename = g_strdup_printf ("gpm-%s-empty", prefix);
 
-		} else if (state == DKP_DEVICE_STATE_FULLY_CHARGED) {
+		} else if (state == UP_DEVICE_STATE_FULLY_CHARGED) {
 			filename = g_strdup_printf ("gpm-%s-charged", prefix);
 
-#if !DKP_CHECK_VERSION(0x009)
-		} else if (state == DKP_DEVICE_STATE_UNKNOWN && percentage > 95.0f) {
-			egg_warning ("fixing up unknown %f", percentage);
-			filename = g_strdup_printf ("gpm-%s-charged", prefix);
-#endif
-
-		} else if (state == DKP_DEVICE_STATE_CHARGING) {
+		} else if (state == UP_DEVICE_STATE_CHARGING) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			filename = g_strdup_printf ("gpm-%s-%s-charging", prefix, index_str);
 
-		} else if (state == DKP_DEVICE_STATE_DISCHARGING) {
+		} else if (state == UP_DEVICE_STATE_DISCHARGING) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
 
-#if !DKP_CHECK_VERSION(0x009)
-		/* the battery isn't charging or discharging, it's just
-		 * sitting there half full doing nothing */
-		} else {
-			DkpClient *client;
-			gboolean on_battery;
-
-			/* get battery status */
-			client = dkp_client_new ();
-			g_object_get (client,
-				      "on-battery", &on_battery,
-				      NULL);
-			g_object_unref (client);
-
-			/* try to find a suitable icon depending on AC state */
-			if (on_battery) {
-				index_str = gpm_upower_get_device_icon_index (device);
-				filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
-			} else {
-				index_str = gpm_upower_get_device_icon_index (device);
-				filename = g_strdup_printf ("gpm-%s-%s-charging", prefix, index_str);
-			}
-#else
-		} else if (state == DKP_DEVICE_STATE_PENDING_CHARGE) {
+		} else if (state == UP_DEVICE_STATE_PENDING_CHARGE) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			/* FIXME: do new grey icons */
 			filename = g_strdup_printf ("gpm-%s-%s-charging", prefix, index_str);
 
-		} else if (state == DKP_DEVICE_STATE_PENDING_DISCHARGE) {
+		} else if (state == UP_DEVICE_STATE_PENDING_DISCHARGE) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
 		} else {
 			filename = g_strdup ("gpm-battery-missing");
-#endif
 		}
 
-	} else if (type == DKP_DEVICE_TYPE_MOUSE ||
-		   type == DKP_DEVICE_TYPE_KEYBOARD ||
-		   type == DKP_DEVICE_TYPE_PHONE) {
+	} else if (kind == UP_DEVICE_KIND_MOUSE ||
+		   kind == UP_DEVICE_KIND_KEYBOARD ||
+		   kind == UP_DEVICE_KIND_PHONE) {
 		if (!is_present) {
 			/* battery missing */
 			filename = g_strdup_printf ("gpm-%s-000", prefix);
 
-		} else if (state == DKP_DEVICE_STATE_FULLY_CHARGED) {
+		} else if (state == UP_DEVICE_STATE_FULLY_CHARGED) {
 			filename = g_strdup_printf ("gpm-%s-100", prefix);
 
-		} else if (state == DKP_DEVICE_STATE_DISCHARGING) {
+		} else if (state == UP_DEVICE_STATE_DISCHARGING) {
 			index_str = gpm_upower_get_device_icon_index (device);
 			filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
 		}
@@ -208,16 +178,16 @@ gpm_upower_get_device_icon (DkpDevice *device)
  * gpm_upower_get_device_summary:
  **/
 gchar *
-gpm_upower_get_device_summary (DkpDevice *device)
+gpm_upower_get_device_summary (UpDevice *device)
 {
-	const gchar *type_desc = NULL;
+	const gchar *kind_desc = NULL;
 	gchar *description = NULL;
 	guint time_to_full_round;
 	guint time_to_empty_round;
 	gchar *time_to_full_str;
 	gchar *time_to_empty_str;
-	DkpDeviceType type;
-	DkpDeviceState state;
+	UpDeviceKind kind;
+	UpDeviceState state;
 	gdouble percentage;
 	gboolean is_present;
 	gint64 time_to_full;
@@ -225,7 +195,7 @@ gpm_upower_get_device_summary (DkpDevice *device)
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "state", &state,
 		      "percentage", &percentage,
 		      "is-present", &is_present,
@@ -236,31 +206,31 @@ gpm_upower_get_device_summary (DkpDevice *device)
 	if (!is_present)
 		return NULL;
 
-	type_desc = gpm_device_type_to_localised_text (type, 1);
+	kind_desc = gpm_device_kind_to_localised_text (kind, 1);
 
 	/* don't display all the extra stuff for keyboards and mice */
-	if (type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD ||
-	    type == DKP_DEVICE_TYPE_PDA)
-		return g_strdup_printf ("%s (%.1f%%)", type_desc, percentage);
+	if (kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD ||
+	    kind == UP_DEVICE_KIND_PDA)
+		return g_strdup_printf ("%s (%.1f%%)", kind_desc, percentage);
 
 	/* we care if we are on AC */
-	if (type == DKP_DEVICE_TYPE_PHONE) {
-		if (state == DKP_DEVICE_STATE_CHARGING || !state == DKP_DEVICE_STATE_DISCHARGING) {
+	if (kind == UP_DEVICE_KIND_PHONE) {
+		if (state == UP_DEVICE_STATE_CHARGING || !state == UP_DEVICE_STATE_DISCHARGING) {
 			/* TRANSLATORS: a phone is charging */
-			return g_strdup_printf (_("%s charging (%.1f%%)"), type_desc, percentage);
+			return g_strdup_printf (_("%s charging (%.1f%%)"), kind_desc, percentage);
 		}
-		return g_strdup_printf ("%s (%.1f%%)", type_desc, percentage);
+		return g_strdup_printf ("%s (%.1f%%)", kind_desc, percentage);
 	}
 
 	/* precalculate so we don't get Unknown time remaining */
-	time_to_full_round = egg_precision_round_down (time_to_full, GPM_DKP_TIME_PRECISION);
-	time_to_empty_round = egg_precision_round_down (time_to_empty, GPM_DKP_TIME_PRECISION);
+	time_to_full_round = egg_precision_round_down (time_to_full, GPM_UP_TIME_PRECISION);
+	time_to_empty_round = egg_precision_round_down (time_to_empty, GPM_UP_TIME_PRECISION);
 
 	/* we always display "Laptop battery 16 minutes remaining" as we need to clarify what device we are refering to */
-	if (state == DKP_DEVICE_STATE_FULLY_CHARGED) {
+	if (state == UP_DEVICE_STATE_FULLY_CHARGED) {
 
-		if (type == DKP_DEVICE_TYPE_BATTERY && time_to_empty_round > GPM_DKP_TEXT_MIN_TIME) {
+		if (kind == UP_DEVICE_KIND_BATTERY && time_to_empty_round > GPM_UP_TEXT_MIN_TIME) {
 			time_to_empty_str = gpm_get_timestring (time_to_empty_round);
 			/* TRANSLATORS: The laptop battery is fully charged, and we know a time */
 			description = g_strdup_printf (_("Battery is fully charged.\nProvides %s laptop runtime"),
@@ -268,27 +238,27 @@ gpm_upower_get_device_summary (DkpDevice *device)
 			g_free (time_to_empty_str);
 		} else {
 			/* TRANSLATORS: the device is fully charged */
-			description = g_strdup_printf (_("%s is fully charged"), type_desc);
+			description = g_strdup_printf (_("%s is fully charged"), kind_desc);
 		}
 
-	} else if (state == DKP_DEVICE_STATE_DISCHARGING) {
+	} else if (state == UP_DEVICE_STATE_DISCHARGING) {
 
-		if (time_to_empty_round > GPM_DKP_TEXT_MIN_TIME) {
+		if (time_to_empty_round > GPM_UP_TEXT_MIN_TIME) {
 			time_to_empty_str = gpm_get_timestring (time_to_empty_round);
 			/* TRANSLATORS: the device is discharging, and we have a time remaining */
 			description = g_strdup_printf (_("%s %s remaining (%.1f%%)"),
-							type_desc, time_to_empty_str, percentage);
+							kind_desc, time_to_empty_str, percentage);
 			g_free (time_to_empty_str);
 		} else {
 			/* TRANSLATORS: the device is discharging, but we only have a percentage */
 			description = g_strdup_printf (_("%s discharging (%.1f%%)"),
-							type_desc, percentage);
+							kind_desc, percentage);
 		}
 
-	} else if (state == DKP_DEVICE_STATE_CHARGING) {
+	} else if (state == UP_DEVICE_STATE_CHARGING) {
 
-		if (time_to_full_round > GPM_DKP_TEXT_MIN_TIME &&
-		    time_to_empty_round > GPM_DKP_TEXT_MIN_TIME) {
+		if (time_to_full_round > GPM_UP_TEXT_MIN_TIME &&
+		    time_to_empty_round > GPM_UP_TEXT_MIN_TIME) {
 
 			/* display both discharge and charge time */
 			time_to_full_str = gpm_get_timestring (time_to_full_round);
@@ -296,43 +266,41 @@ gpm_upower_get_device_summary (DkpDevice *device)
 
 			/* TRANSLATORS: the device is charging, and we have a time to full and empty */
 			description = g_strdup_printf (_("%s %s until charged (%.1f%%)\nProvides %s battery runtime"),
-							type_desc, time_to_full_str, percentage, time_to_empty_str);
+							kind_desc, time_to_full_str, percentage, time_to_empty_str);
 			g_free (time_to_full_str);
 			g_free (time_to_empty_str);
 
-		} else if (time_to_full_round > GPM_DKP_TEXT_MIN_TIME) {
+		} else if (time_to_full_round > GPM_UP_TEXT_MIN_TIME) {
 
 			/* display only charge time */
 			time_to_full_str = gpm_get_timestring (time_to_full_round);
 
 			/* TRANSLATORS: device is charging, and we have a time to full and a percentage */
 			description = g_strdup_printf (_("%s %s until charged (%.1f%%)"),
-						type_desc, time_to_full_str, percentage);
+						kind_desc, time_to_full_str, percentage);
 			g_free (time_to_full_str);
 		} else {
 
 			/* TRANSLATORS: device is charging, but we only have a percentage */
 			description = g_strdup_printf (_("%s charging (%.1f%%)"),
-						type_desc, percentage);
+						kind_desc, percentage);
 		}
 
-#if DKP_CHECK_VERSION(0x009)
-	} else if (state == DKP_DEVICE_STATE_PENDING_DISCHARGE) {
+	} else if (state == UP_DEVICE_STATE_PENDING_DISCHARGE) {
 
 		/* TRANSLATORS: this is only shown for laptops with multiple batteries */
 		description = g_strdup_printf (_("%s waiting to discharge (%.1f%%)"),
-						type_desc, percentage);
+						kind_desc, percentage);
 
-	} else if (state == DKP_DEVICE_STATE_PENDING_CHARGE) {
+	} else if (state == UP_DEVICE_STATE_PENDING_CHARGE) {
 
 		/* TRANSLATORS: this is only shown for laptops with multiple batteries */
-		description = g_strdup_printf (_("%s waiting to charge (%.1f%%)"), type_desc, percentage);
-#endif
+		description = g_strdup_printf (_("%s waiting to charge (%.1f%%)"), kind_desc, percentage);
 
 	} else {
 		egg_warning ("in an undefined state we are not charging or "
 			     "discharging and the batteries are also not charged");
-		description = g_strdup_printf ("%s (%.1f%%)", type_desc, percentage);
+		description = g_strdup_printf ("%s (%.1f%%)", kind_desc, percentage);
 	}
 	return description;
 }
@@ -341,14 +309,14 @@ gpm_upower_get_device_summary (DkpDevice *device)
  * gpm_upower_get_device_description:
  **/
 gchar *
-gpm_upower_get_device_description (DkpDevice *device)
+gpm_upower_get_device_description (UpDevice *device)
 {
 	GString	*details;
 	const gchar *text;
 	gchar *time_str;
-	DkpDeviceType type;
-	DkpDeviceState state;
-	DkpDeviceTechnology technology;
+	UpDeviceKind kind;
+	UpDeviceState state;
+	UpDeviceTechnology technology;
 	gdouble percentage;
 	gdouble capacity;
 	gdouble energy;
@@ -366,7 +334,7 @@ gpm_upower_get_device_description (DkpDevice *device)
 
 	/* get device properties */
 	g_object_get (device,
-		      "type", &type,
+		      "kind", &kind,
 		      "state", &state,
 		      "percentage", &percentage,
 		      "is-present", &is_present,
@@ -384,20 +352,20 @@ gpm_upower_get_device_description (DkpDevice *device)
 		      NULL);
 
 	details = g_string_new ("");
-	text = gpm_device_type_to_localised_text (type, 1);
+	text = gpm_device_kind_to_localised_text (kind, 1);
 	/* TRANSLATORS: the type of data, e.g. Laptop battery */
 	g_string_append_printf (details, "<b>%s</b> %s\n", _("Product:"), text);
 
 	if (!is_present) {
 		/* TRANSLATORS: device is missing */
 		g_string_append_printf (details, "<b>%s</b> %s\n", _("Status:"), _("Missing"));
-	} else if (state == DKP_DEVICE_STATE_FULLY_CHARGED) {
+	} else if (state == UP_DEVICE_STATE_FULLY_CHARGED) {
 		/* TRANSLATORS: device is charged */
 		g_string_append_printf (details, "<b>%s</b> %s\n", _("Status:"), _("Charged"));
-	} else if (state == DKP_DEVICE_STATE_CHARGING) {
+	} else if (state == UP_DEVICE_STATE_CHARGING) {
 		/* TRANSLATORS: device is charging */
 		g_string_append_printf (details, "<b>%s</b> %s\n", _("Status:"), _("Charging"));
-	} else if (state == DKP_DEVICE_STATE_DISCHARGING) {
+	} else if (state == UP_DEVICE_STATE_DISCHARGING) {
 		/* TRANSLATORS: device is discharging */
 		g_string_append_printf (details, "<b>%s</b> %s\n", _("Status:"), _("Discharging"));
 	}
@@ -410,8 +378,8 @@ gpm_upower_get_device_description (DkpDevice *device)
 		/* TRANSLATORS: manufacturer */
 		g_string_append_printf (details, "<b>%s</b> %s\n", _("Vendor:"), vendor);
 	}
-	if (technology != DKP_DEVICE_TECHNOLOGY_UNKNOWN) {
-		text = gpm_device_technology_to_localised_text (technology);
+	if (technology != UP_DEVICE_TECHNOLOGY_UNKNOWN) {
+		text = gpm_device_technology_to_localised_string (technology);
 		/* TRANSLATORS: how the battery is made, e.g. Lithium Ion */
 		g_string_append_printf (details, "<b>%s</b> %s\n", _("Technology:"), text);
 	}
@@ -451,7 +419,7 @@ gpm_upower_get_device_description (DkpDevice *device)
 		g_string_append_printf (details, "<b>%s</b> %.1f%% (%s)\n",
 					_("Capacity:"), capacity, condition);
 	}
-	if (type == DKP_DEVICE_TYPE_BATTERY) {
+	if (kind == UP_DEVICE_KIND_BATTERY) {
 		if (energy > 0) {
 			/* TRANSLATORS: current charge */
 			g_string_append_printf (details, "<b>%s</b> %.1f Wh\n",
@@ -475,8 +443,8 @@ gpm_upower_get_device_description (DkpDevice *device)
 						_("Charge rate:"), energy_rate);
 		}
 	}
-	if (type == DKP_DEVICE_TYPE_MOUSE ||
-	    type == DKP_DEVICE_TYPE_KEYBOARD) {
+	if (kind == UP_DEVICE_KIND_MOUSE ||
+	    kind == UP_DEVICE_KIND_KEYBOARD) {
 		if (energy > 0) {
 			/* TRANSLATORS: the current charge for CSR devices */
 			g_string_append_printf (details, "<b>%s</b> %.0f/7\n",
@@ -498,124 +466,124 @@ gpm_upower_get_device_description (DkpDevice *device)
 }
 
 /**
- * gpm_device_type_to_localised_text:
+ * gpm_device_kind_to_localised_text:
  **/
 const gchar *
-gpm_device_type_to_localised_text (DkpDeviceType type, guint number)
+gpm_device_kind_to_localised_text (UpDeviceKind kind, guint number)
 {
 	const gchar *text = NULL;
-	switch (type) {
-	case DKP_DEVICE_TYPE_LINE_POWER:
+	switch (kind) {
+	case UP_DEVICE_KIND_LINE_POWER:
 		/* TRANSLATORS: system power cord */
 		text = ngettext ("AC adapter", "AC adapters", number);
 		break;
-	case DKP_DEVICE_TYPE_BATTERY:
+	case UP_DEVICE_KIND_BATTERY:
 		/* TRANSLATORS: laptop primary battery */
 		text = ngettext ("Laptop battery", "Laptop batteries", number);
 		break;
-	case DKP_DEVICE_TYPE_UPS:
+	case UP_DEVICE_KIND_UPS:
 		/* TRANSLATORS: battery-backed AC power source */
 		text = ngettext ("UPS", "UPSs", number);
 		break;
-	case DKP_DEVICE_TYPE_MONITOR:
+	case UP_DEVICE_KIND_MONITOR:
 		/* TRANSLATORS: a monitor is a device to measure voltage and current */
 		text = ngettext ("Monitor", "Monitors", number);
 		break;
-	case DKP_DEVICE_TYPE_MOUSE:
+	case UP_DEVICE_KIND_MOUSE:
 		/* TRANSLATORS: wireless mice with internal batteries */
 		text = ngettext ("Wireless mouse", "Wireless mice", number);
 		break;
-	case DKP_DEVICE_TYPE_KEYBOARD:
+	case UP_DEVICE_KIND_KEYBOARD:
 		/* TRANSLATORS: wireless keyboard with internal battery */
 		text = ngettext ("Wireless keyboard", "Wireless keyboards", number);
 		break;
-	case DKP_DEVICE_TYPE_PDA:
+	case UP_DEVICE_KIND_PDA:
 		/* TRANSLATORS: portable device */
 		text = ngettext ("PDA", "PDAs", number);
 		break;
-	case DKP_DEVICE_TYPE_PHONE:
+	case UP_DEVICE_KIND_PHONE:
 		/* TRANSLATORS: cell phone (mobile...) */
 		text = ngettext ("Cell phone", "Cell phones", number);
 		break;
 	default:
-		egg_warning ("enum unrecognised: %i", type);
-		text = dkp_device_type_to_text (type);
+		egg_warning ("enum unrecognised: %i", kind);
+		text = up_device_kind_to_string (kind);
 	}
 	return text;
 }
 
 /**
- * gpm_device_type_to_icon:
+ * gpm_device_kind_to_icon:
  **/
 const gchar *
-gpm_device_type_to_icon (DkpDeviceType type)
+gpm_device_kind_to_icon (UpDeviceKind kind)
 {
 	const gchar *icon = NULL;
-	switch (type) {
-	case DKP_DEVICE_TYPE_LINE_POWER:
+	switch (kind) {
+	case UP_DEVICE_KIND_LINE_POWER:
 		icon = "gpm-ac-adapter";
 		break;
-	case DKP_DEVICE_TYPE_BATTERY:
+	case UP_DEVICE_KIND_BATTERY:
 		icon = "battery";
 		break;
-	case DKP_DEVICE_TYPE_UPS:
+	case UP_DEVICE_KIND_UPS:
 		icon = "network-wired";
 		break;
-	case DKP_DEVICE_TYPE_MONITOR:
+	case UP_DEVICE_KIND_MONITOR:
 		icon = "application-certificate";
 		break;
-	case DKP_DEVICE_TYPE_MOUSE:
+	case UP_DEVICE_KIND_MOUSE:
 		icon = "mouse";
 		break;
-	case DKP_DEVICE_TYPE_KEYBOARD:
+	case UP_DEVICE_KIND_KEYBOARD:
 		icon = "input-keyboard";
 		break;
-	case DKP_DEVICE_TYPE_PDA:
+	case UP_DEVICE_KIND_PDA:
 		icon = "input-gaming";
 		break;
-	case DKP_DEVICE_TYPE_PHONE:
+	case UP_DEVICE_KIND_PHONE:
 		icon = "camera-video";
 		break;
 	default:
-		egg_warning ("enum unrecognised: %i", type);
+		egg_warning ("enum unrecognised: %i", kind);
 		icon = "gtk-help";
 	}
 	return icon;
 }
 
 /**
- * gpm_device_technology_to_localised_text:
+ * gpm_device_technology_to_localised_string:
  **/
 const gchar *
-gpm_device_technology_to_localised_text (DkpDeviceTechnology technology_enum)
+gpm_device_technology_to_localised_string (UpDeviceTechnology technology_enum)
 {
 	const gchar *technology = NULL;
 	switch (technology_enum) {
-	case DKP_DEVICE_TECHNOLOGY_LITHIUM_ION:
+	case UP_DEVICE_TECHNOLOGY_LITHIUM_ION:
 		/* TRANSLATORS: battery technology */
 		technology = _("Lithium Ion");
 		break;
-	case DKP_DEVICE_TECHNOLOGY_LITHIUM_POLYMER:
+	case UP_DEVICE_TECHNOLOGY_LITHIUM_POLYMER:
 		/* TRANSLATORS: battery technology */
 		technology = _("Lithium Polymer");
 		break;
-	case DKP_DEVICE_TECHNOLOGY_LITHIUM_IRON_PHOSPHATE:
+	case UP_DEVICE_TECHNOLOGY_LITHIUM_IRON_PHOSPHATE:
 		/* TRANSLATORS: battery technology */
 		technology = _("Lithium Iron Phosphate");
 		break;
-	case DKP_DEVICE_TECHNOLOGY_LEAD_ACID:
+	case UP_DEVICE_TECHNOLOGY_LEAD_ACID:
 		/* TRANSLATORS: battery technology */
 		technology = _("Lead acid");
 		break;
-	case DKP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM:
+	case UP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM:
 		/* TRANSLATORS: battery technology */
 		technology = _("Nickel Cadmium");
 		break;
-	case DKP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE:
+	case UP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE:
 		/* TRANSLATORS: battery technology */
 		technology = _("Nickel metal hydride");
 		break;
-	case DKP_DEVICE_TECHNOLOGY_UNKNOWN:
+	case UP_DEVICE_TECHNOLOGY_UNKNOWN:
 		/* TRANSLATORS: battery technology */
 		technology = _("Unknown technology");
 		break;
diff --git a/src/gpm-upower.h b/src/gpm-upower.h
index 67f75cf..7b0580a 100644
--- a/src/gpm-upower.h
+++ b/src/gpm-upower.h
@@ -23,17 +23,17 @@
 #define __GPM_DEVICEKIT_H
 
 #include <glib-object.h>
-#include <devkit-power-gobject/devicekit-power.h>
+#include <libupower-glib/upower.h>
 
 G_BEGIN_DECLS
 
-const gchar	*gpm_device_type_to_localised_text	(DkpDeviceType	 type,
+const gchar	*gpm_device_kind_to_localised_text	(UpDeviceKind	 kind,
 							 guint		 number);
-const gchar	*gpm_device_type_to_icon		(DkpDeviceType	 type);
-const gchar	*gpm_device_technology_to_localised_text (DkpDeviceTechnology technology_enum);
-gchar		*gpm_upower_get_device_icon		(DkpDevice *device);
-gchar		*gpm_upower_get_device_summary		(DkpDevice *device);
-gchar		*gpm_upower_get_device_description	(DkpDevice *device);
+const gchar	*gpm_device_kind_to_icon		(UpDeviceKind	 kind);
+const gchar	*gpm_device_technology_to_localised_string (UpDeviceTechnology technology_enum);
+gchar		*gpm_upower_get_device_icon		(UpDevice *device);
+gchar		*gpm_upower_get_device_summary		(UpDevice *device);
+gchar		*gpm_upower_get_device_description	(UpDevice *device);
 
 G_END_DECLS
 
-- 
1.7.1

commit 75935773a6c5b0f7d93ca4fb9a032baa9f7dfa40
Author: Richard Hughes <richard@hughsie.com>
Date:   Mon Jul 12 14:07:02 2010 +0100

    Port gnome-session to upower
    
    devkit-power-gobject is deprecated and will be removed in future versions.
    UPower 0.9.0 has been required by gnome-power-manager for many months now.

Index: gnome-session-2.30.2/configure.in
===================================================================
--- gnome-session-2.30.2.orig/configure.in	2010-09-15 08:25:17.038326876 +0200
+++ gnome-session-2.30.2/configure.in	2010-09-15 08:25:22.302327257 +0200
@@ -40,7 +40,7 @@
 GLIB_REQUIRED=2.16.0
 GTK_REQUIRED=2.14.0
 DBUS_GLIB_REQUIRED=0.76
-DEVKIT_POWER_REQUIRED=008
+UPOWER_REQUIRED=0.9.0
 
 dnl ====================================================================
 dnl Dependency Checks
@@ -52,7 +52,7 @@
         gio-2.0 >= $GLIB_REQUIRED
         gtk+-2.0 >= $GTK_REQUIRED
         dbus-glib-1 >= $DBUS_GLIB_REQUIRED
-        devkit-power-gobject >= $DEVKIT_POWER_REQUIRED
+        upower-glib >= $UPOWER_REQUIRED
 )
 
 PKG_CHECK_MODULES(SESSION_PROPERTIES,
Index: gnome-session-2.30.2/gnome-session/gsm-logout-dialog.c
===================================================================
--- gnome-session-2.30.2.orig/gnome-session/gsm-logout-dialog.c	2010-09-15 08:25:16.998325137 +0200
+++ gnome-session-2.30.2/gnome-session/gsm-logout-dialog.c	2010-09-15 08:25:22.302327257 +0200
@@ -27,7 +27,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
-#include <devkit-power-gobject/devicekit-power.h>
+#include <upower.h>
 
 #include "gsm-logout-dialog.h"
 #include "gsm-consolekit.h"
@@ -50,7 +50,7 @@
 {
         GsmDialogLogoutType  type;
 
-        DkpClient           *dkp_client;
+        UpClient            *up_client;
         GsmConsolekit       *consolekit;
 
         int                  timeout;
@@ -142,7 +142,7 @@
         gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE);
         gtk_window_stick (GTK_WINDOW (logout_dialog));
 
-        logout_dialog->priv->dkp_client = dkp_client_new ();
+        logout_dialog->priv->up_client = up_client_new ();
 
         logout_dialog->priv->consolekit = gsm_get_consolekit ();
 
@@ -166,9 +166,9 @@
                 logout_dialog->priv->timeout_id = 0;
         }
 
-        if (logout_dialog->priv->dkp_client) {
-                g_object_unref (logout_dialog->priv->dkp_client);
-                logout_dialog->priv->dkp_client = NULL;
+        if (logout_dialog->priv->up_client) {
+                g_object_unref (logout_dialog->priv->up_client);
+                logout_dialog->priv->up_client = NULL;
         }
 
         if (logout_dialog->priv->consolekit) {
@@ -182,21 +182,13 @@
 static gboolean
 gsm_logout_supports_system_suspend (GsmLogoutDialog *logout_dialog)
 {
-        gboolean ret;
-        g_object_get (logout_dialog->priv->dkp_client,
-                      "can-suspend", &ret,
-                      NULL);
-        return ret;
+        return up_client_get_can_suspend (logout_dialog->priv->up_client);
 }
 
 static gboolean
 gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog)
 {
-        gboolean ret;
-        g_object_get (logout_dialog->priv->dkp_client,
-                      "can-hibernate", &ret,
-                      NULL);
-        return ret;
+        return up_client_get_can_hibernate (logout_dialog->priv->up_client);
 }
 
 static gboolean
Index: gnome-session-2.30.2/gnome-session/gsm-manager.c
===================================================================
--- gnome-session-2.30.2.orig/gnome-session/gsm-manager.c	2010-09-15 08:25:17.018324051 +0200
+++ gnome-session-2.30.2/gnome-session/gsm-manager.c	2010-09-15 08:25:22.314325713 +0200
@@ -38,7 +38,7 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
-#include <devkit-power-gobject/devicekit-power.h>
+#include <upower.h>
 
 #include <gtk/gtk.h> /* for logout dialog */
 #include <gconf/gconf-client.h>
@@ -135,7 +135,7 @@
         DBusGConnection        *connection;
 
         /* Interface with other parts of the system */
-        DkpClient              *dkp_client;
+        UpClient               *up_client;
 };
 
 enum {
@@ -987,17 +987,14 @@
         GError   *error;
         gboolean  ret;
 
-        g_object_get (manager->priv->dkp_client,
-                      "can-hibernate", &can_hibernate,
-                      NULL);
-
+        can_hibernate = up_client_get_can_hibernate (manager->priv->up_client);
         if (can_hibernate) {
 
                 /* lock the screen before we suspend */
                 manager_perhaps_lock (manager);
 
                 error = NULL;
-                ret = dkp_client_hibernate (manager->priv->dkp_client, &error);
+                ret = up_client_hibernate_sync (manager->priv->up_client, NULL, &error);
                 if (!ret) {
                         g_warning ("Unexpected hibernate failure: %s",
                                    error->message);
@@ -1013,17 +1010,14 @@
         GError   *error;
         gboolean  ret;
 
-        g_object_get (manager->priv->dkp_client,
-                      "can-suspend", &can_suspend,
-                      NULL);
-
+        can_suspend = up_client_get_can_suspend (manager->priv->up_client);
         if (can_suspend) {
 
                 /* lock the screen before we suspend */
                 manager_perhaps_lock (manager);
 
                 error = NULL;
-                ret = dkp_client_suspend (manager->priv->dkp_client, &error);
+                ret = up_client_suspend_sync (manager->priv->up_client, NULL, &error);
                 if (!ret) {
                         g_warning ("Unexpected suspend failure: %s",
                                    error->message);
@@ -2202,9 +2196,9 @@
                 manager->priv->gconf_client = NULL;
         }
 
-        if (manager->priv->dkp_client != NULL) {
-                g_object_unref (manager->priv->dkp_client);
-                manager->priv->dkp_client = NULL;
+        if (manager->priv->up_client != NULL) {
+                g_object_unref (manager->priv->up_client);
+                manager->priv->up_client = NULL;
         }
 
         G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
@@ -2435,7 +2429,7 @@
                           G_CALLBACK (on_presence_status_changed),
                           manager);
 
-        manager->priv->dkp_client = dkp_client_new ();
+        manager->priv->up_client = up_client_new ();
 
         /* GConf setup */
         gconf_client_add_dir (manager->priv->gconf_client,
@@ -2959,7 +2953,7 @@
         gboolean can_suspend;
         gboolean can_hibernate;
 
-        g_object_get (manager->priv->dkp_client,
+        g_object_get (manager->priv->up_client,
                       "can-suspend", &can_suspend,
                       "can-hibernate", &can_hibernate,
                       NULL);
From f8fe2622e70e21d619f9a6a887bb8edd40bfce02 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Wed, 15 Sep 2010 06:54:43 +0200
Subject: [PATCH] Port from libdevkit-power-gobject to libupower-glib

---
 configure.ac                                    |   54 +++---
 src/libtracker-common/Makefile.am               |   11 +-
 src/libtracker-common/tracker-power-devicekit.c |  247 -----------------------
 src/libtracker-common/tracker-power-upower.c    |  247 +++++++++++++++++++++++
 src/miners/fs/tracker-miner-files.c             |   28 ++--
 5 files changed, 293 insertions(+), 294 deletions(-)
 delete mode 100644 src/libtracker-common/tracker-power-devicekit.c
 create mode 100644 src/libtracker-common/tracker-power-upower.c

diff --git a/configure.ac b/configure.ac
index 3bbdc6b..143a811 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,7 +139,7 @@ GTK_REQUIRED=2.18.0
 LIBXML2_REQUIRED=2.6
 LIBNOTIFY_REQUIRED=0.4.3
 HAL_REQUIRED=0.5
-DEVKIT_POWER_REQUIRED=007
+UPOWER_REQUIRED=0.9.0
 GDKPIXBUF_REQUIRED=2.12.0
 QUILL_REQUIRED=1.0.0
 UNAC_REQUIRED=1.0.0
@@ -422,36 +422,36 @@ fi
 
 
 ##################################################################
-# Check for DeviceKit-power
+# Check for UPower
 ##################################################################
 
-AC_ARG_ENABLE(devkit_power,
-	      AS_HELP_STRING([--disable-devkit-power],
-			     [disable DeviceKit-power support for AC power detection [[default=auto]]]),,
-	      [enable_devkit_power=auto])
-
-if test "x$enable_devkit_power" != "xno"; then
-   PKG_CHECK_MODULES(DEVKIT_POWER,
-		     [devkit-power-gobject >= $DEVKIT_POWER_REQUIRED],
-		     [have_devkit_power=yes] ,
-		     [have_devkit_power=no])
-   AC_SUBST(DEVKIT_POWER_CFLAGS)
-   AC_SUBST(DEVKIT_POWER_LIBS)
-
-   if test "x$have_devkit_power" = "xyes"; then
-      AC_DEFINE(HAVE_DEVKIT_POWER, [], [Define if we have DEVKIT_POWER])
+AC_ARG_ENABLE(upower,
+	      AS_HELP_STRING([--disable-upower],
+			     [disable UPower support for AC power detection [[default=auto]]]),,
+	      [enable_upower=auto])
+
+if test "x$enable_upower" != "xno"; then
+   PKG_CHECK_MODULES(UPOWER,
+		     [upower-glib >= $UPOWER_REQUIRED],
+		     [have_upower=yes] ,
+		     [have_upower=no])
+   AC_SUBST(UPOWER_CFLAGS)
+   AC_SUBST(UPOWER_LIBS)
+
+   if test "x$have_upower" = "xyes"; then
+      AC_DEFINE(HAVE_UPOWER, [], [Define if we have UPOWER])
    fi
 else
-   have_devkit_power="no  (disabled)"
+   have_upower="no  (disabled)"
 fi
 
-if test "x$enable_devkit_power" = "xyes"; then
-   if test "x$have_devkit_power" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find devkit_power >= $DEVKIT_POWER_REQUIRED.])
+if test "x$enable_upower" = "xyes"; then
+   if test "x$have_upower" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find upower >= $UPOWER_REQUIRED.])
    fi
 fi
 
-AM_CONDITIONAL(HAVE_DEVKIT_POWER, test "x$have_devkit_power" = "xyes")
+AM_CONDITIONAL(HAVE_UPOWER, test "x$have_upower" = "xyes")
 
 ##################################################################
 # Check for HAL
@@ -462,7 +462,7 @@ AC_ARG_ENABLE(hal,
 			     [disable HAL support for AC power detection [[default=auto]]]),,
 	      [enable_hal=auto])
 
-if test "x$have_devkit_power" != "xyes" && test "x$enable_hal" != "xno"; then
+if test "x$have_upower" != "xyes" && test "x$enable_hal" != "xno"; then
    PKG_CHECK_MODULES(HAL,
                      [hal >= $HAL_REQUIRED],
 		     [have_hal=yes] ,
@@ -478,8 +478,8 @@ else
 fi
 
 if test "x$enable_hal" = "xyes"; then
-   if test "x$have_devkit_power" = "xyes"; then
-      AC_MSG_ERROR([Only one of DeviceKit-power and HAL can be used.])
+   if test "x$have_upower" = "xyes"; then
+      AC_MSG_ERROR([Only one of UPower and HAL can be used.])
    elif test "x$have_hal" != "xyes"; then
       AC_MSG_ERROR([Couldn't find hal >= $HAL_REQUIRED.])
    fi
@@ -1794,8 +1794,8 @@ Build Configuration:
 	Enable unit tests:			$have_unit_tests
 
 	Support for ioprio:			$tracker_cv_have_ioprio
-	Support for HAL:                    	$have_hal
-	Support for DeviceKit-power:           	$have_devkit_power
+	Support for HAL:			$have_hal
+	Support for UPower:			$have_upower
 	Support for file monitoring:            $have_file_monitor
 	Support for accent stripping (unac):  	$have_unac
 	Support for Cyrillic languages (enca): 	$have_enca
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 5a3d33e..555fcff 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -4,14 +4,13 @@ INCLUDES =						\
 	-DSHAREDIR=\""$(datadir)"\"			\
 	-DG_LOG_DOMAIN=\"Tracker\"			\
 	-DTRACKER_COMPILATION				\
-	-DI_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE	\
 	-I$(top_srcdir)/src				\
 	$(WARN_CFLAGS)					\
 	$(GLIB2_CFLAGS)					\
 	$(GCOV_CFLAGS)					\
 	$(GIO_CFLAGS)					\
 	$(HAL_CFLAGS)					\
-	$(DEVKIT_POWER_CFLAGS)				\
+	$(UPOWER_CFLAGS)				\
 	$(DBUS_CFLAGS)
 
 libtracker_commondir = $(libdir)/tracker-$(TRACKER_API_VERSION)
@@ -23,12 +22,12 @@ else
 os_sources = tracker-os-dependant-unix.c
 endif
 
-# Prefer DeviceKit-power for the power data if it's available, else fall back to HAL
-if HAVE_DEVKIT_POWER
+# Prefer UPower for the power data if it's available, else fall back to HAL
+if HAVE_UPOWER
 power_headers =						\
 	tracker-power.h
 power_sources =						\
-	tracker-power-devicekit.c
+	tracker-power-upower.c
 else
 if HAVE_HAL
 power_headers =						\
@@ -77,7 +76,7 @@ libtracker_common_la_LDFLAGS = 				\
 libtracker_common_la_LIBADD = 				\
 	$(top_builddir)/src/libstemmer/libstemmer.la	\
 	$(HAL_LIBS)					\
-	$(DEVKIT_POWER_LIBS)				\
+	$(UPOWER_LIBS)					\
 	$(DBUS_LIBS)					\
 	$(GIO_LIBS)					\
 	$(GCOV_LIBS)					\
diff --git a/src/libtracker-common/tracker-power-devicekit.c b/src/libtracker-common/tracker-power-devicekit.c
deleted file mode 100644
index 4022302..0000000
--- a/src/libtracker-common/tracker-power-devicekit.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (C) 2006, Jamie McCracken <jamiemcc@gnome.org>
- * Copyright (C) 2008, Nokia <ivan.frade@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA  02110-1301, USA.
- */
-
-#include "config.h"
-
-#ifdef HAVE_DEVKIT_POWER
-
-#include <devkit-power-gobject/devicekit-power.h>
-
-#include "tracker-power.h"
-
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_POWER, TrackerPowerPriv))
-
-typedef struct {
-	DkpClient *client;
-	gboolean   on_battery;
-	gboolean   on_low_battery;
-} TrackerPowerPriv;
-
-static void     tracker_power_finalize          (GObject         *object);
-static void     tracker_power_get_property      (GObject         *object,
-                                                 guint            param_id,
-                                                 GValue                  *value,
-                                                 GParamSpec      *pspec);
-static void     tracker_power_client_changed_cb (DkpClient       *client,
-                                                 TrackerPower    *power);
-
-enum {
-	PROP_0,
-	PROP_ON_BATTERY,
-	PROP_ON_LOW_BATTERY,
-	PROP_BATTERY_PERCENTAGE
-};
-
-G_DEFINE_TYPE (TrackerPower, tracker_power, G_TYPE_OBJECT);
-
-static void
-tracker_power_class_init (TrackerPowerClass *klass)
-{
-	GObjectClass *object_class;
-
-	object_class = G_OBJECT_CLASS (klass);
-
-	object_class->finalize     = tracker_power_finalize;
-	object_class->get_property = tracker_power_get_property;
-
-	g_object_class_install_property (object_class,
-	                                 PROP_ON_BATTERY,
-	                                 g_param_spec_boolean ("on-battery",
-	                                                       "Battery in use",
-	                                                       "Whether the battery is being used",
-	                                                       FALSE,
-	                                                       G_PARAM_READABLE));
-
-	g_object_class_install_property (object_class,
-	                                 PROP_ON_LOW_BATTERY,
-	                                 g_param_spec_boolean ("on-low-battery",
-	                                                       "Battery low",
-	                                                       "Whether the battery is low",
-	                                                       FALSE,
-	                                                       G_PARAM_READABLE));
-	g_object_class_install_property (object_class,
-	                                 PROP_BATTERY_PERCENTAGE,
-	                                 g_param_spec_double ("battery-percentage",
-	                                                      "Battery percentage",
-	                                                      "Current battery percentage left",
-	                                                      0.0,
-	                                                      1.0,
-	                                                      0.0,
-	                                                      G_PARAM_READABLE));
-
-	g_type_class_add_private (object_class, sizeof (TrackerPowerPriv));
-}
-
-static void
-tracker_power_init (TrackerPower *power)
-{
-	TrackerPowerPriv *priv;
-
-	g_message ("Initializing DeviceKit-power...");
-
-	priv = GET_PRIV (power);
-
-	/* connect to a DeviceKit-power instance */
-	priv->client = dkp_client_new ();
-	g_signal_connect (priv->client, "changed",
-	                  G_CALLBACK (tracker_power_client_changed_cb), power);
-
-	/* coldplug */
-	priv->on_battery = dkp_client_on_battery (priv->client);
-	priv->on_low_battery = dkp_client_on_low_battery (priv->client);
-}
-
-static void
-tracker_power_finalize (GObject *object)
-{
-	TrackerPowerPriv *priv;
-
-	priv = GET_PRIV (object);
-
-	g_object_unref (priv->client);
-
-	(G_OBJECT_CLASS (tracker_power_parent_class)->finalize) (object);
-}
-
-static void
-tracker_power_get_property (GObject    *object,
-                            guint       param_id,
-                            GValue     *value,
-                            GParamSpec *pspec)
-{
-	TrackerPowerPriv *priv;
-
-	priv = GET_PRIV (object);
-
-	switch (param_id) {
-	case PROP_ON_BATTERY:
-		g_value_set_boolean (value, priv->on_battery);
-		break;
-	case PROP_ON_LOW_BATTERY:
-		g_value_set_boolean (value, priv->on_low_battery);
-		break;
-	default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-		break;
-	};
-}
-
-/**
- * tracker_power_client_changed_cb:
- **/
-static void
-tracker_power_client_changed_cb (DkpClient *client, TrackerPower *power)
-{
-	gboolean on_battery;
-	gboolean on_low_battery;
-	TrackerPowerPriv *priv;
-
-	priv = GET_PRIV (power);
-
-	/* get the on-battery state */
-	on_battery = dkp_client_on_battery (priv->client);
-	if (on_battery != priv->on_battery) {
-		priv->on_battery = on_battery;
-		g_object_notify (G_OBJECT (power), "on-battery");
-	}
-
-	/* get the on-low-battery state */
-	on_low_battery = dkp_client_on_low_battery (priv->client);
-	if (on_low_battery != priv->on_low_battery) {
-		priv->on_low_battery = on_low_battery;
-		g_object_notify (G_OBJECT (power), "on-low-battery");
-	}
-}
-
-/**
- * tracker_power_new:
- *
- * Creates a new instance of #TrackerPower.
- *
- * Returns: The newly created #TrackerPower.
- **/
-TrackerPower *
-tracker_power_new ()
-{
-	return g_object_new (TRACKER_TYPE_POWER, NULL);
-}
-
-/**
- * tracker_hal_get_on_battery:
- * @power: A #TrackerPower.
- *
- * Returns whether the computer battery (if any) is currently in use.
- *
- * Returns: #TRUE if the computer is running on battery power.
- **/
-gboolean
-tracker_power_get_on_battery (TrackerPower *power)
-{
-	TrackerPowerPriv *priv;
-
-	g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
-
-	priv = GET_PRIV (power);
-
-	return priv->on_battery;
-}
-
-/**
- * tracker_power_get_on_low_battery:
- * @power: A #TrackerPower
- *
- * Returns whether the computer has batteries.
- *
- * Returns: #TRUE if the computer has batteries available.
- **/
-gboolean
-tracker_power_get_on_low_battery (TrackerPower *power)
-{
-	TrackerPowerPriv *priv;
-
-	g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
-
-	priv = GET_PRIV (power);
-
-	return priv->on_low_battery;
-}
-
-/**
- * tracker_power_get_battery_percentage:
- * @power: A #TrackerPower
- *
- * Returns the percentage of battery power available.
- *
- * Returns: #gdouble representing the percentage between 0.0 and 1.0.
- **/
-gdouble
-tracker_power_get_battery_percentage (TrackerPower *power)
-{
-	TrackerPowerPriv *priv;
-
-	g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
-
-	priv = GET_PRIV (power);
-
-	/* FIXME: Implement */
-	return 0.5;
-}
-
-#endif /* HAVE_DEVKIT_POWER */
diff --git a/src/libtracker-common/tracker-power-upower.c b/src/libtracker-common/tracker-power-upower.c
new file mode 100644
index 0000000..8a1b71e
--- /dev/null
+++ b/src/libtracker-common/tracker-power-upower.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2006, Jamie McCracken <jamiemcc@gnome.org>
+ * Copyright (C) 2008, Nokia <ivan.frade@nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+#include "config.h"
+
+#ifdef HAVE_UPOWER
+
+#include <upower.h>
+
+#include "tracker-power.h"
+
+#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_POWER, TrackerPowerPriv))
+
+typedef struct {
+	UpClient  *client;
+	gboolean   on_battery;
+	gboolean   on_low_battery;
+} TrackerPowerPriv;
+
+static void     tracker_power_finalize          (GObject         *object);
+static void     tracker_power_get_property      (GObject         *object,
+                                                 guint            param_id,
+                                                 GValue                  *value,
+                                                 GParamSpec      *pspec);
+static void     tracker_power_client_changed_cb (UpClient        *client,
+                                                 TrackerPower    *power);
+
+enum {
+	PROP_0,
+	PROP_ON_BATTERY,
+	PROP_ON_LOW_BATTERY,
+	PROP_BATTERY_PERCENTAGE
+};
+
+G_DEFINE_TYPE (TrackerPower, tracker_power, G_TYPE_OBJECT);
+
+static void
+tracker_power_class_init (TrackerPowerClass *klass)
+{
+	GObjectClass *object_class;
+
+	object_class = G_OBJECT_CLASS (klass);
+
+	object_class->finalize     = tracker_power_finalize;
+	object_class->get_property = tracker_power_get_property;
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ON_BATTERY,
+	                                 g_param_spec_boolean ("on-battery",
+	                                                       "Battery in use",
+	                                                       "Whether the battery is being used",
+	                                                       FALSE,
+	                                                       G_PARAM_READABLE));
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ON_LOW_BATTERY,
+	                                 g_param_spec_boolean ("on-low-battery",
+	                                                       "Battery low",
+	                                                       "Whether the battery is low",
+	                                                       FALSE,
+	                                                       G_PARAM_READABLE));
+	g_object_class_install_property (object_class,
+	                                 PROP_BATTERY_PERCENTAGE,
+	                                 g_param_spec_double ("battery-percentage",
+	                                                      "Battery percentage",
+	                                                      "Current battery percentage left",
+	                                                      0.0,
+	                                                      1.0,
+	                                                      0.0,
+	                                                      G_PARAM_READABLE));
+
+	g_type_class_add_private (object_class, sizeof (TrackerPowerPriv));
+}
+
+static void
+tracker_power_init (TrackerPower *power)
+{
+	TrackerPowerPriv *priv;
+
+	g_message ("Initializing UPower...");
+
+	priv = GET_PRIV (power);
+
+	/* connect to a UPower instance */
+	priv->client = up_client_new ();
+	g_signal_connect (priv->client, "changed",
+	                  G_CALLBACK (tracker_power_client_changed_cb), power);
+
+	/* coldplug */
+	priv->on_battery = up_client_get_on_battery (priv->client);
+	priv->on_low_battery = up_client_get_on_low_battery (priv->client);
+}
+
+static void
+tracker_power_finalize (GObject *object)
+{
+	TrackerPowerPriv *priv;
+
+	priv = GET_PRIV (object);
+
+	g_object_unref (priv->client);
+
+	(G_OBJECT_CLASS (tracker_power_parent_class)->finalize) (object);
+}
+
+static void
+tracker_power_get_property (GObject    *object,
+                            guint       param_id,
+                            GValue     *value,
+                            GParamSpec *pspec)
+{
+	TrackerPowerPriv *priv;
+
+	priv = GET_PRIV (object);
+
+	switch (param_id) {
+	case PROP_ON_BATTERY:
+		g_value_set_boolean (value, priv->on_battery);
+		break;
+	case PROP_ON_LOW_BATTERY:
+		g_value_set_boolean (value, priv->on_low_battery);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+		break;
+	};
+}
+
+/**
+ * tracker_power_client_changed_cb:
+ **/
+static void
+tracker_power_client_changed_cb (UpClient *client, TrackerPower *power)
+{
+	gboolean on_battery;
+	gboolean on_low_battery;
+	TrackerPowerPriv *priv;
+
+	priv = GET_PRIV (power);
+
+	/* get the on-battery state */
+	on_battery = up_client_get_on_battery (priv->client);
+	if (on_battery != priv->on_battery) {
+		priv->on_battery = on_battery;
+		g_object_notify (G_OBJECT (power), "on-battery");
+	}
+
+	/* get the on-low-battery state */
+	on_low_battery = up_client_get_on_low_battery (priv->client);
+	if (on_low_battery != priv->on_low_battery) {
+		priv->on_low_battery = on_low_battery;
+		g_object_notify (G_OBJECT (power), "on-low-battery");
+	}
+}
+
+/**
+ * tracker_power_new:
+ *
+ * Creates a new instance of #TrackerPower.
+ *
+ * Returns: The newly created #TrackerPower.
+ **/
+TrackerPower *
+tracker_power_new ()
+{
+	return g_object_new (TRACKER_TYPE_POWER, NULL);
+}
+
+/**
+ * tracker_power_get_on_battery:
+ * @power: A #TrackerPower.
+ *
+ * Returns whether the computer battery (if any) is currently in use.
+ *
+ * Returns: #TRUE if the computer is running on battery power.
+ **/
+gboolean
+tracker_power_get_on_battery (TrackerPower *power)
+{
+	TrackerPowerPriv *priv;
+
+	g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
+
+	priv = GET_PRIV (power);
+
+	return priv->on_battery;
+}
+
+/**
+ * tracker_power_get_on_low_battery:
+ * @power: A #TrackerPower
+ *
+ * Returns whether the computer has batteries.
+ *
+ * Returns: #TRUE if the computer has batteries available.
+ **/
+gboolean
+tracker_power_get_on_low_battery (TrackerPower *power)
+{
+	TrackerPowerPriv *priv;
+
+	g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
+
+	priv = GET_PRIV (power);
+
+	return priv->on_low_battery;
+}
+
+/**
+ * tracker_power_get_battery_percentage:
+ * @power: A #TrackerPower
+ *
+ * Returns the percentage of battery power available.
+ *
+ * Returns: #gdouble representing the percentage between 0.0 and 1.0.
+ **/
+gdouble
+tracker_power_get_battery_percentage (TrackerPower *power)
+{
+	TrackerPowerPriv *priv;
+
+	g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
+
+	priv = GET_PRIV (power);
+
+	/* FIXME: Implement */
+	return 0.5;
+}
+
+#endif /* HAVE_UPOWER */
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index dcdacff..dd4b5da 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -76,9 +76,9 @@ struct TrackerMinerFilesPrivate {
 
 	guint low_battery_pause_cookie;
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 	TrackerPower *power;
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 	gulong finished_handler;
 
 	DBusGProxy *extractor_proxy;
@@ -225,7 +225,7 @@ tracker_miner_files_init (TrackerMinerFiles *mf)
 	                  G_CALLBACK (mount_point_removed_cb),
 	                  mf);
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 	priv->power = tracker_power_new ();
 
 	g_signal_connect (priv->power, "notify::on-low-battery",
@@ -234,7 +234,7 @@ tracker_miner_files_init (TrackerMinerFiles *mf)
 	g_signal_connect (priv->power, "notify::on-battery",
 	                  G_CALLBACK (battery_status_cb),
 	                  mf);
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 
 	priv->finished_handler = g_signal_connect_after (mf, "finished",
 							 G_CALLBACK (miner_finished_cb),
@@ -323,9 +323,9 @@ miner_files_finalize (GObject *object)
                 g_slist_free (priv->index_single_directories);
         }
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 	g_object_unref (priv->power);
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 
 	g_object_unref (priv->storage);
 
@@ -375,9 +375,9 @@ miner_files_constructed (GObject *object)
 
 	mounts = tracker_storage_get_device_roots (mf->private->storage, type, TRUE);
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 	check_battery_status (mf);
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 
 	g_message ("Setting up directories to iterate from config (IndexSingleDirectory)");
 
@@ -527,7 +527,7 @@ miner_files_constructed (GObject *object)
 	                  G_CALLBACK (trigger_recheck_cb),
 	                  mf);
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 
 	g_signal_connect (mf->private->config, "notify::index-on-battery",
 	                  G_CALLBACK (index_on_battery_cb),
@@ -536,7 +536,7 @@ miner_files_constructed (GObject *object)
 	                  G_CALLBACK (index_on_battery_cb),
 	                  mf);
 
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 
 	g_slist_foreach (mounts, (GFunc) g_free, NULL);
 	g_slist_free (mounts);
@@ -984,7 +984,7 @@ mount_point_added_cb (TrackerStorage *storage,
 	g_free (urn);
 }
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 
 static void
 set_up_throttle (TrackerMinerFiles *mf,
@@ -1088,7 +1088,7 @@ index_on_battery_cb (GObject    *object,
 	check_battery_status (mf);
 }
 
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 
 /* Called when mining has finished the first time */
 static void
@@ -1114,9 +1114,9 @@ miner_finished_cb (TrackerMinerFS *fs,
 		mf->private->finished_handler = 0;
 	}
 
-#if defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL)
+#if defined(HAVE_UPOWER) || defined(HAVE_HAL)
 	check_battery_status (mf);
-#endif /* defined(HAVE_DEVKIT_POWER) || defined(HAVE_HAL) */
+#endif /* defined(HAVE_UPOWER) || defined(HAVE_HAL) */
 }
 
 static void
-- 
1.7.1

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: