summaryrefslogtreecommitdiff
blob: 28344217e647b7a4ac69de46892cd4a1eedef958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff -Nur kdeutils-3.4.3.orig/klaptopdaemon/laptop_daemon.cpp kdeutils-3.4.3/klaptopdaemon/laptop_daemon.cpp
--- kdeutils-3.4.3.orig/klaptopdaemon/laptop_daemon.cpp	2005-10-05 15:26:42.000000000 +0200
+++ kdeutils-3.4.3/klaptopdaemon/laptop_daemon.cpp	2005-10-18 15:38:21.000000000 +0200
@@ -919,7 +919,7 @@
 	// the lid button turns stuff on when it's down and back off again when it's raised
 	// 	(kind of like the fridge door light)
 	//
-	if (lid_state != laptop_portable::get_button(laptop_portable::LidButton)) {
+	if (s.enable_lid_button && (lid_state != laptop_portable::get_button(laptop_portable::LidButton))) {
 		lid_state = !lid_state;
 		if (lid_state) {
 			if (s.button_lid_bright_enabled) {
@@ -982,7 +982,7 @@
 	//
 	// the power button on the other hand is an off/on switch for non-suspend type ops
 	//
-	if (power_state != laptop_portable::get_button(laptop_portable::PowerButton)) {
+	if (s.enable_power_button && (power_state != laptop_portable::get_button(laptop_portable::PowerButton))) {
 		power_state = !power_state;
 		if (power_state) {
 			if (power_button_off) {
diff -Nur kdeutils-3.4.3.orig/klaptopdaemon/portable.cpp kdeutils-3.4.3/klaptopdaemon/portable.cpp
--- kdeutils-3.4.3.orig/klaptopdaemon/portable.cpp	2005-10-05 15:26:42.000000000 +0200
+++ kdeutils-3.4.3/klaptopdaemon/portable.cpp	2005-10-18 15:38:21.000000000 +0200
@@ -1937,19 +1937,19 @@
 laptop_portable::get_button(LaptopButton l)	// true if a button is pressed
 {
 	if (::has_acpi()) {
-		QString *name=0;
+		QString name;
 		switch (l) {
 		case LidButton:
-			name = &acpi_lid_name;
+			name = acpi_lid_name;
 			break;
 		case PowerButton:
-			name = &acpi_power_name;
+			name = acpi_power_name;
 			break;
 		default:
 			break;
 		}
-		if (name) {
-			QFile f(*name);
+		if (!name.isNull()) {
+			QFile f(name);
 			if (f.open(IO_ReadOnly)) {
 				while (!f.atEnd()) {
 					QString l;