| @@ -1,92 +1,98 @@ | | | @@ -1,92 +1,98 @@ |
1 | $NetBSD: patch-an,v 1.4 2004/02/04 20:38:00 markd Exp $ | | 1 | $NetBSD: patch-an,v 1.5 2012/03/08 09:07:28 shattered Exp $ |
2 | | | 2 | |
3 | --- klaptopdaemon/portable.cpp.orig 2003-11-30 22:50:47.000000000 +1300 | | 3 | --- klaptopdaemon/portable.cpp.orig 2008-02-13 09:38:14.000000000 +0000 |
4 | +++ klaptopdaemon/portable.cpp | | 4 | +++ klaptopdaemon/portable.cpp |
5 | @@ -2414,10 +2414,14 @@ laptop_portable::software_suspend_set_ma | | 5 | @@ -2438,10 +2438,14 @@ laptop_portable::software_suspend_set_ma |
6 | #include <sys/ioctl.h> | | 6 | #include <sys/ioctl.h> |
7 | #include <sys/stat.h> | | 7 | #include <sys/stat.h> |
8 | #include <machine/apmvar.h> | | 8 | #include <machine/apmvar.h> |
9 | -#include <iostream.h> | | 9 | -#include <iostream.h> |
10 | +#include <iostream> | | 10 | +#include <iostream> |
11 | +#include <qpushbutton.h> | | 11 | +#include <qpushbutton.h> |
12 | +#include <qobject.h> | | 12 | +#include <qobject.h> |
13 | +#include <kactivelabel.h> | | 13 | +#include <kactivelabel.h> |
14 | +#include <kprocess.h> | | 14 | +#include <kprocess.h> |
15 | | | 15 | |
16 | // | | 16 | // |
17 | -// klaptopdeamon interface to NetBSD 1.5 apm. | | 17 | -// klaptopdeamon interface to NetBSD 1.5 apm. |
18 | +// Klaptopdeamon interface to NetBSD 1.5 apm. | | 18 | +// Klaptopdeamon interface to NetBSD 1.5 apm. |
19 | // Scott Presnell, srp@zgi.com, srp@tworoads.net | | 19 | // Scott Presnell, srp@zgi.com, srp@tworoads.net |
20 | // Fri Jun 29 17:21:25 PDT 2001 | | 20 | // Fri Jun 29 17:21:25 PDT 2001 |
21 | // Tested on Dell I4K running NetBSD 1.5R | | 21 | // Tested on Dell I4K running NetBSD 1.5R |
22 | @@ -2439,6 +2443,7 @@ laptop_portable::has_power_management() | | 22 | @@ -2463,6 +2467,7 @@ laptop_portable::has_power_management() |
23 | } | | 23 | } |
24 | | | 24 | |
25 | struct apm_power_info info; | | 25 | struct apm_power_info info; |
26 | + memset(&info, 0, sizeof(info)); | | 26 | + memset(&info, 0, sizeof(info)); |
27 | ret=ioctl(fd, APM_IOC_GETPOWER, &info); | | 27 | ret=ioctl(fd, APM_IOC_GETPOWER, &info); |
28 | ::close(fd); | | 28 | ::close(fd); |
29 | | | 29 | |
30 | @@ -2466,6 +2471,7 @@ int laptop_portable::has_battery_time() | | 30 | @@ -2490,6 +2495,7 @@ int laptop_portable::has_battery_time() |
31 | return 0; | | 31 | return 0; |
32 | | | 32 | |
33 | struct apm_power_info info; | | 33 | struct apm_power_info info; |
34 | + memset(&info, 0, sizeof(info)); | | 34 | + memset(&info, 0, sizeof(info)); |
35 | ret=ioctl(fd, APM_IOC_GETPOWER, &info); | | 35 | ret=ioctl(fd, APM_IOC_GETPOWER, &info); |
36 | ::close(fd); | | 36 | ::close(fd); |
37 | | | 37 | |
38 | @@ -2639,6 +2645,15 @@ laptop_portable::apm_set_mask(bool , boo | | 38 | @@ -2661,6 +2667,15 @@ laptop_portable::apm_set_mask(bool , boo |
39 | | | 39 | |
40 | | | 40 | |
41 | // | | 41 | // |
42 | +// adds extra widgets to the battery panel | | 42 | +// adds extra widgets to the battery panel |
43 | +// | | 43 | +// |
44 | +void | | 44 | +void |
45 | +laptop_portable::extra_config(QWidget *parent, KConfig *config, QVBoxLayout *layout) | | 45 | +laptop_portable::extra_config(QWidget *parent, KConfig *config, QVBoxLayout *layout) |
46 | +{ | | 46 | +{ |
47 | +} | | 47 | +} |
48 | + | | 48 | + |
49 | + | | 49 | + |
50 | +// | | 50 | +// |
51 | // return current battery state | | 51 | // return current battery state |
52 | // | | 52 | // |
53 | struct power_result laptop_portable::poll_battery_state() | | 53 | struct power_result laptop_portable::poll_battery_state() |
54 | @@ -2652,6 +2667,7 @@ struct power_result laptop_portable::pol | | 54 | @@ -2674,6 +2689,7 @@ struct power_result laptop_portable::pol |
55 | goto bad; | | 55 | goto bad; |
56 | | | 56 | |
57 | struct apm_power_info info; | | 57 | struct apm_power_info info; |
58 | + memset(&info, 0, sizeof(info)); | | 58 | + memset(&info, 0, sizeof(info)); |
59 | ret=ioctl(fd, APM_IOC_GETPOWER, &info); | | 59 | ret=ioctl(fd, APM_IOC_GETPOWER, &info); |
60 | ::close(fd); | | 60 | ::close(fd); |
61 | | | 61 | |
62 | @@ -2714,7 +2730,16 @@ laptop_portable::get_brightness() | | 62 | @@ -2736,7 +2752,16 @@ laptop_portable::get_brightness() |
63 | } | | 63 | } |
64 | | | 64 | |
65 | bool | | 65 | bool |
66 | -laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s) // do something to help get system throttling data from places like ACPI | | 66 | -laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s) // do something to help get system throttling data from places like ACPI |
67 | +laptop_portable::get_system_performance(bool, int ¤t, QStringList &s, bool *&) // do something to help get system profiles from places like ACPI | | 67 | +laptop_portable::get_system_performance(bool, int ¤t, QStringList &s, bool *&) // do something to help get system profiles from places like ACPI |
68 | +{ | | 68 | +{ |
69 | + // INSERT HERE | | 69 | + // INSERT HERE |
70 | + current = 0; | | 70 | + current = 0; |
71 | + s.clear(); | | 71 | + s.clear(); |
72 | + return(0); // if no profiles are available | | 72 | + return(0); // if no profiles are available |
73 | +} | | 73 | +} |
74 | + | | 74 | + |
75 | +bool | | 75 | +bool |
76 | +laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s, bool *&) // do something to help get system throttling data from places like ACPI | | 76 | +laptop_portable::get_system_throttling(bool, int ¤t, QStringList &s, bool *&) // do something to help get system throttling data from places like ACPI |
77 | { | | 77 | { |
78 | // INSERT HERE | | 78 | // INSERT HERE |
79 | current = 0; | | 79 | current = 0; |
80 | @@ -2772,6 +2797,12 @@ laptop_portable::get_battery_status(int | | 80 | @@ -2794,6 +2819,18 @@ laptop_portable::get_battery_status(int |
81 | values.append(s); | | 81 | values.append(s); |
82 | } | | 82 | } |
83 | | | 83 | |
| | | 84 | +bool |
| | | 85 | +laptop_portable::has_software_suspend(int /*type*/) |
| | | 86 | +{ |
| | | 87 | + return false; // (::has_software_suspend(type)); |
| | | 88 | +} |
| | | 89 | + |
84 | +void | | 90 | +void |
85 | +laptop_portable::software_suspend_set_mask(bool hibernate) | | 91 | +laptop_portable::software_suspend_set_mask(bool hibernate) |
86 | +{ | | 92 | +{ |
87 | + // software_suspend_is_preferred = hibernate; | | 93 | + // software_suspend_is_preferred = hibernate; |
88 | +} | | 94 | +} |
89 | + | | 95 | + |
90 | #else | | 96 | #else |
91 | | | 97 | |
92 | /* | | 98 | /* |