Thu Dec 16 11:37:39 2010 UTC ()
If we the battery 'remaining' propery is empty, try to calculate it
from discharge rate.

make the battery applet work with netbsd (again?)


(ahoka)
diff -r1.87 -r1.88 pkgsrc/x11/gnome-applets/Makefile
diff -r1.27 -r1.28 pkgsrc/x11/gnome-applets/distinfo
diff -r0 -r1.1 pkgsrc/x11/gnome-applets/patches/patch-hal

cvs diff -r1.87 -r1.88 pkgsrc/x11/gnome-applets/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/x11/gnome-applets/Attic/Makefile 2010/12/01 09:38:21 1.87
+++ pkgsrc/x11/gnome-applets/Attic/Makefile 2010/12/16 11:37:38 1.88
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1# $NetBSD: Makefile,v 1.87 2010/12/01 09:38:21 cegger Exp $ 1# $NetBSD: Makefile,v 1.88 2010/12/16 11:37:38 ahoka Exp $
2# 2#
3 3
4DISTNAME= gnome-applets-2.32.1.1 4DISTNAME= gnome-applets-2.32.1.1
 5PKGREVISION= 1
5CATEGORIES= x11 gnome 6CATEGORIES= x11 gnome
6MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gnome-applets/2.32/} 7MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gnome-applets/2.32/}
7EXTRACT_SUFX= .tar.bz2 8EXTRACT_SUFX= .tar.bz2
8 9
9MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= http://www.gnome.org/ 11HOMEPAGE= http://www.gnome.org/
11COMMENT= GNOME2 panel applets 12COMMENT= GNOME2 panel applets
12 13
13PKG_DESTDIR_SUPPORT= user-destdir 14PKG_DESTDIR_SUPPORT= user-destdir
14 15
15GNU_CONFIGURE= yes 16GNU_CONFIGURE= yes
16USE_TOOLS+= gmake intltool msgfmt pkg-config 17USE_TOOLS+= gmake intltool msgfmt pkg-config
17USE_PKGLOCALEDIR= yes 18USE_PKGLOCALEDIR= yes

cvs diff -r1.27 -r1.28 pkgsrc/x11/gnome-applets/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/gnome-applets/Attic/distinfo 2010/11/26 11:34:41 1.27
+++ pkgsrc/x11/gnome-applets/Attic/distinfo 2010/12/16 11:37:38 1.28
@@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
1$NetBSD: distinfo,v 1.27 2010/11/26 11:34:41 drochner Exp $ 1$NetBSD: distinfo,v 1.28 2010/12/16 11:37:38 ahoka Exp $
2 2
3SHA1 (gnome-applets-2.32.1.1.tar.bz2) = 6edc3aea2bd2198b2bdbdb1fa63b481f724c8fe2 3SHA1 (gnome-applets-2.32.1.1.tar.bz2) = 6edc3aea2bd2198b2bdbdb1fa63b481f724c8fe2
4RMD160 (gnome-applets-2.32.1.1.tar.bz2) = 50c8e169b02aa002917f4c6ea0f575522e3ae984 4RMD160 (gnome-applets-2.32.1.1.tar.bz2) = 50c8e169b02aa002917f4c6ea0f575522e3ae984
5Size (gnome-applets-2.32.1.1.tar.bz2) = 10083534 bytes 5Size (gnome-applets-2.32.1.1.tar.bz2) = 10083534 bytes
6SHA1 (patch-aa) = 764fc46c7c000e21a1602286443e2633ec743631 6SHA1 (patch-aa) = 764fc46c7c000e21a1602286443e2633ec743631
7SHA1 (patch-ab) = f880abec6df2254b6541d4e5a894559763ef674b 7SHA1 (patch-ab) = f880abec6df2254b6541d4e5a894559763ef674b
8SHA1 (patch-ad) = 42fb64b30a031a1ea8f57f47cabdf63475b7987e 8SHA1 (patch-ad) = 42fb64b30a031a1ea8f57f47cabdf63475b7987e
 9SHA1 (patch-hal) = 8de5986b77a8ae7f99533eaff7f6a5a5c3069f3d

File Added: pkgsrc/x11/gnome-applets/patches/Attic/patch-hal
$NetBSD: patch-hal,v 1.1 2010/12/16 11:37:39 ahoka Exp $

--- battstat/battstat-hal.c.orig	2010-11-22 14:38:27.000000000 +0000
+++ battstat/battstat-hal.c
@@ -549,7 +549,7 @@ battstat_hal_get_battery_info( BatterySt
   status->percent = ( ((double) current_charge_total) /
                       ((double) full_capacity_total)    ) * 100.0 + 0.5;
 
-  if( present == 1 )
+  if( present == 1 && remaining_time != 0 )
   {
     /* In the case of exactly one battery, report the time remaining figure
      * from HAL directly since it might have come from an authorative source
@@ -559,10 +559,11 @@ battstat_hal_get_battery_info( BatterySt
      * remaining time is unknown.  Battstat uses minutes and -1 for 
      * unknown time remaining.
      */
-
+#if 0
     if( remaining_time == 0 )
       status->minutes = -1;
     else
+#endif
       status->minutes = (remaining_time + 30) / 60;
   }
   /* Rest of cases to deal with multiple battery systems... */