Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-02-01 Thread Sune Vuorela
On Thursday 31 January 2008, Marc Haber wrote:
 Hi pusling,

 On Wed, Jan 30, 2008 at 11:30:41PM +0100, Sune Vuorela wrote:
  I have tried reading and understanding this patch - and I don't get at
  all why it works.

 I cannot help here, my C++ skill is way too short.

 I can, however, confirm that it fixes the issue ;)

Hi!

can you try with a reduced patch like the one in my previous email to see if 
Zsolt Rizsanyi is correct in his analysis?  Then I will do my best to get it 
committed to debian.

I would like not to break backwards compability (the full patch), if it is not 
needed.

/Sune
-- 
I cannot install on a processor on the microkernel, how does it work?

First you can never remove the memory address for downloading from a pointer.


signature.asc
Description: This is a digitally signed message part.


Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-02-01 Thread Marc Haber
On Fri, Feb 01, 2008 at 01:16:44PM +0100, Fathi Boudra wrote:
 for infos, i submitted a fix to upstream:
 http://bugs.kde.org/attachment.cgi?id=23387action=view

Which version is this against? My portable.cpp has

if (p.exists()  p.open(IO_ReadOnly)) {

and

else if (f.exists()  f.open(IO_ReadOnly)) {

instead of the plainer version in the patch.

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-02-01 Thread Marc Haber
On Fri, Feb 01, 2008 at 01:16:44PM +0100, Fathi Boudra wrote:
 for infos, i submitted a fix to upstream:
 http://bugs.kde.org/attachment.cgi?id=23387action=view

That one looks more correct than Sune's other patch, I'll try this one.

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-02-01 Thread Fathi Boudra
 Which version is this against?


kde svn 3.5 branch

My portable.cpp has

if (p.exists()  p.open(IO_ReadOnly)) {

 and

else if (f.exists()  f.open(IO_ReadOnly)) {

 instead of the plainer version in the patch.


you can easily adapt the patch as the important part
is textstream usage.


Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-02-01 Thread Marc Haber
On Fri, Feb 01, 2008 at 01:52:54PM +0100, Fathi Boudra wrote:
 you can easily adapt the patch as the important part
 is textstream usage.

Which is what I did and tried.

This patch:

$ cat 
chroot/sid-packages/home/mh/kdeutils/kdeutils-3.5.8/debian/patches/20_hibernate_444500.diff
diff -Nur kdeutils-3.5.8/klaptopdaemon/portable.cpp 
kdeutils-3.5.8.new/klaptopdaemon/portable.cpp
--- kdeutils-3.5.8/klaptopdaemon/portable.cpp   2008-02-01 13:20:21.0 
+0100
+++ kdeutils-3.5.8.new/klaptopdaemon/portable.cpp   2008-02-01 
13:22:33.0 +0100
@@ -694,7 +694,8 @@

if (p.exists()  p.open(IO_ReadOnly)) {
QString l;
-   p.readLine(l,500);
+   QTextStream t(p);
+   l = t.readLine();
QStringList ll = QStringList::split(' ',l,false);
for (QValueListIteratorQString i = ll.begin(); 
i!=ll.end(); i++) {
QString s = *i;
@@ -710,7 +711,8 @@
}
else if (f.exists()  f.open(IO_ReadOnly)) {
QString l;
-   f.readLine(l, 500);
+   QTextStream t(f);
+   l = t.readLine();
QStringList ll = QStringList::split(' ',l,false);
for (QValueListIteratorQString i = ll.begin(); 
i!=ll.end(); i++) {
QString s = *i;
$  

Fixes the issue for me.

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-02-01 Thread Fathi Boudra
for infos, i submitted a fix to upstream:
http://bugs.kde.org/attachment.cgi?id=23387action=view


Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-01-31 Thread Marc Haber
Hi pusling,

On Wed, Jan 30, 2008 at 11:30:41PM +0100, Sune Vuorela wrote:
 I have tried reading and understanding this patch - and I don't get at
 all why it works.

I cannot help here, my C++ skill is way too short.

I can, however, confirm that it fixes the issue ;)

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-01-31 Thread Zsolt Rizsanyi
On Jan 30, 2008 11:30 PM, Sune Vuorela [EMAIL PROTECTED] wrote:
 Unless this hunk does it all the magic by it self, I kind of having a hard
 time figuring out why this works.

if (p.exists()  p.open(IO_ReadOnly)) {
 +   QTextStream stream(p);
QString l;
 -   p.readLine(l,500);
 +   l = stream.readLine();
QStringList ll = QStringList::split(' ',l,false);
for (QValueListIteratorQString i = ll.begin();
 i!=ll.end(); i++) {

 Someone, please enlighten me ;)

I believe that the fix comes from the fact that QTextStream::readLine
strips the trailing newline from the end of the line, while
QFile::readLine() does not. The disk state is at the end of the line
in /sys/power/state and so the newline gets attached to it and it
cannot be recognized.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-01-30 Thread Marc Haber
On Sat, Nov 24, 2007 at 11:13:45AM +0100, Marc Haber wrote:
 On Sat, Sep 29, 2007 at 10:20:59AM +0200, Marc Haber wrote:
  klaptopdaemon does not show the Hibernate menu items with recent
  kernels. This is upstream Bug #148928.
 
 Still applies for 3.5.8-1. I have not yet tried whether the patch
 still helps.

The attached patch is verified to fix 3.5.8-1. Please apply.

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835
diff -Nur kdeutils-3.5.8/klaptopdaemon/portable.cpp kdeutils-3.5.8.new/klaptopdaemon/portable.cpp
--- kdeutils-3.5.8/klaptopdaemon/portable.cpp	2008-01-30 09:20:06.0 +0100
+++ kdeutils-3.5.8.new/klaptopdaemon/portable.cpp	2008-01-30 09:20:57.0 +0100
@@ -690,11 +690,11 @@
 		mask = 0;
 
 		QFile p(/sys/power/state);
-		QFile f(/proc/acpi/sleep);
 
 		if (p.exists()  p.open(IO_ReadOnly)) {
+		   	QTextStream stream(p);
 			QString l;
-			p.readLine(l,500);
+			l = stream.readLine();
 			QStringList ll = QStringList::split(' ',l,false);
 			for (QValueListIteratorQString i = ll.begin(); i!=ll.end(); i++) {
 QString s = *i;
@@ -708,20 +708,6 @@
 			}
 			p.close();
 		}
-		else if (f.exists()  f.open(IO_ReadOnly)) {
-			QString l;
-			f.readLine(l, 500);
-			QStringList ll = QStringList::split(' ',l,false);
-			for (QValueListIteratorQString 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 |= 1c;
-}
-			}
-			f.close();
-		}
 	}
 	return((maskacpi_sleep_enabled(1state)) != 0);
 }


Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2008-01-30 Thread Sune Vuorela
On Wednesday 30 January 2008, Marc Haber wrote:
 On Sat, Nov 24, 2007 at 11:13:45AM +0100, Marc Haber wrote:
  On Sat, Sep 29, 2007 at 10:20:59AM +0200, Marc Haber wrote:
   klaptopdaemon does not show the Hibernate menu items with recent
   kernels. This is upstream Bug #148928.
 
  Still applies for 3.5.8-1. I have not yet tried whether the patch
  still helps.

 The attached patch is verified to fix 3.5.8-1. Please apply.

I have tried reading and understanding this patch - and I don't get at all why 
it works.

Unless this hunk does it all the magic by it self, I kind of having a hard 
time figuring out why this works.

if (p.exists()  p.open(IO_ReadOnly)) {
+   QTextStream stream(p);
QString l;
-   p.readLine(l,500);
+   l = stream.readLine();
QStringList ll = QStringList::split(' ',l,false);
for (QValueListIteratorQString i = ll.begin(); 
i!=ll.end(); i++) {

Someone, please enlighten me ;)

/Sune
-- 
Genius, I cannot log from a pin on the Web site, how does it work?

You can never unlink a pointer of the cable but then from Internet Explorer 
9000 you need to send the parallel SCSI front-end to the 3-inch terminale of 
a secret password.


signature.asc
Description: This is a digitally signed message part.


Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2007-11-24 Thread Marc Haber
found #444500 3.5.8-1
thanks

On Sat, Sep 29, 2007 at 10:20:59AM +0200, Marc Haber wrote:
 klaptopdaemon does not show the Hibernate menu items with recent
 kernels. This is upstream Bug #148928.

Still applies for 3.5.8-1. I have not yet tried whether the patch
still helps.

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2007-09-29 Thread Marc Haber
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-5GCC support library
ii  libqt3-mt   3:3.3.7-8Qt GUI Library (Threaded runtime v
ii  libstdc++6  4.2.1-5  The GNU Standard C++ Library v3
ii  libxtst62:1.0.3-1X11 Testing -- Resource extension 

klaptopdaemon recommends no packages.

-- no debconf information
--- ./klaptopdaemon/portable.cpp.old2007-05-14 11:40:45.0 +0400
+++ ./klaptopdaemon/portable.cpp2007-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 (QValueListIteratorQString i = ll.begin(); 
i!=ll.end(); i++) {
QString s = *i;
-   
+
if (s.compare(standby)==0)
mask |= (11);
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 (QValueListIteratorQString 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 |= 1c;
-   }
-   }
-   f.close();
-   }
}
return((maskacpi_sleep_enabled(1state)) != 0);
 }


Bug#444500: klaptopdaemon: Hibernate menu items missing with 2.6.22 and later kernels

2007-09-29 Thread Marc Haber
forwarded #444500 http://bugs.kde.org/148928
thanks

On Sat, Sep 29, 2007 at 10:20:59AM +0200, Marc Haber wrote:
 klaptopdaemon does not show the Hibernate menu items with recent
 kernels. This is upstream Bug #148928.

Marking as forwarded.

Greetings
Marc

-- 
-
Marc Haber | I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things.Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]