summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'kde-base/klaptopdaemon/files/klaptopdaemon-3.5.7-has_acpi_sleep.patch')
-rw-r--r--kde-base/klaptopdaemon/files/klaptopdaemon-3.5.7-has_acpi_sleep.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/kde-base/klaptopdaemon/files/klaptopdaemon-3.5.7-has_acpi_sleep.patch b/kde-base/klaptopdaemon/files/klaptopdaemon-3.5.7-has_acpi_sleep.patch
new file mode 100644
index 000000000000..33b8a448a14f
--- /dev/null
+++ b/kde-base/klaptopdaemon/files/klaptopdaemon-3.5.7-has_acpi_sleep.patch
@@ -0,0 +1,43 @@
+--- ./klaptopdaemon/portable.cpp.old 2007-05-14 11:40:45.000000000 +0400
++++ ./klaptopdaemon/portable.cpp 2007-08-14 01:52:30.775790879 +0400
+@@ -690,15 +690,16 @@ has_acpi_sleep(int state)
+ mask = 0;
+
+ QFile p("/sys/power/state");
+- QFile f("/proc/acpi/sleep");
+
+ if (p.open(IO_ReadOnly)) {
++ QTextStream stream(&p);
+ QString l;
+- p.readLine(l,500);
++ l = stream.readLine();
++
+ QStringList ll = QStringList::split(' ',l,false);
+ for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
+ QString s = *i;
+-
++
+ if (s.compare("standby")==0)
+ mask |= (1<<1);
+ else if (s.compare("mem")==0)
+@@ -708,20 +709,6 @@ has_acpi_sleep(int state)
+ }
+ p.close();
+ }
+- else if (f.open(IO_ReadOnly)) {
+- QString l;
+- f.readLine(l, 500);
+- QStringList ll = QStringList::split(' ',l,false);
+- for (QValueListIterator<QString> i = ll.begin(); i!=ll.end(); i++) {
+- QString s = *i;
+- if (s[0] == 'S') {
+- int c = s[1].digitValue();
+- if (c >= 0 && c <= 9)
+- mask |= 1<<c;
+- }
+- }
+- f.close();
+- }
+ }
+ return((mask&acpi_sleep_enabled&(1<<state)) != 0);
+ }