9501
|
1 |
diff -u -r gnome-applets-2.17.90/battstat/battstat-hal.c gnome-applets-2.17.90-new/battstat/battstat-hal.c
|
|
2 |
--- gnome-applets-2.17.90/battstat/battstat-hal.c 2007-02-04 11:09:33.000000000 +0800
|
|
3 |
+++ gnome-applets-2.17.90-new/battstat/battstat-hal.c 2007-03-07 14:15:17.156270000 +0800
|
|
4 |
@@ -69,11 +69,11 @@
|
|
5 |
battery->status.present =
|
|
6 |
libhal_device_get_property_bool( ctx, battery->udi, key, &error );
|
|
7 |
|
|
8 |
- if( !strcmp( key, "battery.charge_level.current" ) )
|
|
9 |
+ else if( !strcmp( key, "battery.charge_level.current" ) )
|
|
10 |
battery->status.current_level =
|
|
11 |
libhal_device_get_property_int( ctx, battery->udi, key, &error );
|
|
12 |
|
|
13 |
- if( !strcmp( key, "battery.charge_level.rate" ) )
|
|
14 |
+ else if( !strcmp( key, "battery.charge_level.rate" ) )
|
|
15 |
battery->status.rate =
|
|
16 |
libhal_device_get_property_int( ctx, battery->udi, key, &error );
|
|
17 |
|
|
18 |
@@ -86,8 +86,13 @@
|
|
19 |
libhal_device_get_property_int( ctx, battery->udi, key, &error );
|
|
20 |
|
|
21 |
else if( !strcmp( key, "battery.remaining_time" ) )
|
|
22 |
- battery->status.remaining_time =
|
|
23 |
- libhal_device_get_property_int( ctx, battery->udi, key, &error );
|
|
24 |
+ if( libhal_device_property_exists( ctx, battery->udi,
|
|
25 |
+ "battery.remaining_time", &error ) ) {
|
|
26 |
+ battery->status.remaining_time =
|
|
27 |
+ libhal_device_get_property_int( ctx, battery->udi, key, &error );
|
|
28 |
+ } else {
|
|
29 |
+ battery->status.remaining_time = -1;
|
|
30 |
+ }
|
|
31 |
|
|
32 |
else if( !strcmp( key, "battery.rechargeable.is_charging" ) )
|
|
33 |
battery->status.charging =
|
|
34 |
@@ -190,7 +195,7 @@
|
|
35 |
/* It is safe to do nothing since the device will have been marked as
|
|
36 |
* not present and the old information will be ignored.
|
|
37 |
*/
|
|
38 |
- if( is_removed )
|
|
39 |
+ if( is_removed && strcmp( key, "battery.remaining_time" ))
|
|
40 |
return;
|
|
41 |
|
|
42 |
changed = FALSE;
|
|
43 |
@@ -566,7 +571,7 @@
|
|
44 |
* unknown time remaining.
|
|
45 |
*/
|
|
46 |
|
|
47 |
- if( remaining_time == 0 )
|
|
48 |
+ if( remaining_time == -1 )
|
|
49 |
status->minutes = -1;
|
|
50 |
else
|
|
51 |
status->minutes = (remaining_time + 30) / 60;
|
|
52 |
diff -u -r gnome-applets-2.17.90/battstat/power-management.c gnome-applets-2.17.90-new/battstat/power-management.c
|
|
53 |
--- gnome-applets-2.17.90/battstat/power-management.c 2007-02-04 11:09:33.000000000 +0800
|
|
54 |
+++ gnome-applets-2.17.90-new/battstat/power-management.c 2007-03-07 13:12:45.163914000 +0800
|
|
55 |
@@ -448,10 +448,16 @@
|
|
56 |
using_hal = TRUE;
|
|
57 |
return NULL;
|
|
58 |
}
|
|
59 |
+#if (defined(sun) && defined(__SVR4)) || defined(__sun__)
|
|
60 |
+ else
|
|
61 |
+ /* On Solaris, only HAL is supported */
|
12310
|
62 |
+ return NULL;
|
9501
|
63 |
+#else
|
|
64 |
else
|
|
65 |
/* fallback to legacy methods */
|
|
66 |
g_free( err );
|
|
67 |
#endif
|
|
68 |
+#endif
|
|
69 |
|
|
70 |
#ifdef __linux__
|
|
71 |
|
|
72 |
diff -u -r gnome-applets-2.17.90/configure.in gnome-applets-2.17.90-new/configure.in
|
|
73 |
--- gnome-applets-2.17.90/configure.in 2007-02-26 22:51:32.000000000 +0800
|
|
74 |
+++ gnome-applets-2.17.90-new/configure.in 2007-03-07 13:12:45.164678000 +0800
|
|
75 |
@@ -398,6 +398,13 @@
|
|
76 |
fi
|
|
77 |
|
|
78 |
;;
|
9743
|
79 |
+ *-*-solaris*)
|
9501
|
80 |
+ if test "x$HAVE_HAL" = "xno"; then
|
|
81 |
+ echo "warning: ${host} is not supported by battstat_applet, not building" >&2
|
|
82 |
+ build_battstat_applet=no
|
|
83 |
+ fi
|
|
84 |
+ ;;
|
|
85 |
+
|
|
86 |
*)
|
|
87 |
echo "warning: ${host} is not supported by battstat_applet, not building" >&2
|
|
88 |
build_battstat_applet=no
|