2010/4/14 Martyn Russell :
> On 14/04/10 09:11, Philip Van Hoof wrote:
>>
>> On Wed, 2010-04-14 at 04:32 +0200, Michael Biebl wrote:
>>>
>>> The attached patch ports tracker from libdevkit-power-gobject to
>>> libupower-glib.
>>>
>>> The patch is based on my latest patch series, so does not directly
>>> apply on top of master.
>>> If you prefer, I can rebase the patch on master and resend it.
>>
>>
>> Please do
Attached is new patch rebased on current master.
>>> fwiw, I set the minimum version of libupower-glib to 0.9.2, because
>>> that is the version I tested the patch with. It most likely should
>>> also work with earlier releases like 0.9.0 if that is a concern.
>
> Hmm, from a brief Google for the packages hitting the next Ubuntu version,
> 0.9.0 looks like the version they're shipping with. I would try to use that
> if possible.
I've set the minimum version to 0.9.0 on your request.
Updated patch is attached. I'd appreciate a review.
Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From edaedffd693a83d0692ab981587f6f95dc932c13 Mon Sep 17 00:00:00 2001
From: Michael Biebl
Date: Wed, 14 Apr 2010 03:49:31 +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 | 16 +-
5 files changed, 287 insertions(+), 288 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 a90af4a..361d6bb 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
@@ -398,36 +398,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
@@ -438,7 +438,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] ,
@@ -454,8 +454,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
@@ -1749,8 +1749,8 @@ Build Configuration:
Enable unit tests: $have_unit_tes