Bug#444500: klaptopdaemon: "Hibernate" menu items missing with 2.6.22 and later kernels
Package: klaptopdaemon
Version: 4:3.5.7-3
Severity: normal
Tags: upstream patch
Hi,
klaptopdaemon does not show the "Hibernate" menu items with recent
kernels. This is upstream Bug #148928. The attached patch (pulled from
upstream bugzilla) helps (locally tested).
Greetings
Marc
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.22.3-scyw00225 (PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages klaptopdaemon depends on:
ii kdelibs4c2a 4:3.5.7.dfsg.1-7 core libraries and binaries for al
ii libc6 2.6.1-5 GNU C Library: Shared libraries
ii libgcc1 1:4.2.1-5 GCC support library
ii libqt3-mt 3:3.3.7-8 Qt GUI Library (Threaded runtime v
ii libstdc++6 4.2.1-5 The GNU Standard C++ Library v3
ii libxtst6 2:1.0.3-1 X11 Testing -- Resource extension
klaptopdaemon recommends no packages.
-- no debconf information
--- ./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);
}
Reply to: