Razor-power suspends twice.

27 views
Skip to first unread message

chri...@surlykke.dk

unread,
Nov 8, 2012, 11:14:38 AM11/8/12
to razor-qt
Hi 

When I suspend my machine through razor-power, my machine suspends twice. (To be precise: It suspends, and when I wake it up it suspends again).
I have both UPower and systemd on my machine (Arch linux) and as far as I can see the problem lies in razorpowerproviders.cpp, method dbusCall, lines 108-109 where the return values of the dbus-call is examined:

   return msg.arguments().isEmpty() ||
           msg.arguments().first().toBool();

It seems that when calling suspend on UPower, which should not return anything, msg.arguments.isEmpty() returns false because it contains an empty QVariant(), and when that QVariant is converted to boolean it becomes false. That means that the entire method returns false, and razor-power thinks that the call to UPower suspend has failed and tries the next provider (systemd in my case).

Can anybody else confirm this behavior? It seems it might be a Qt-bug. 
I'm on Qt 4.8.3, on Arch linux.

br. Chr.

Alec Moskvin

unread,
Nov 8, 2012, 7:26:04 PM11/8/12
to razo...@googlegroups.com
I was able to reproduce it in a Fedora VM, and adding a
msg.arguments().first().isNull() check seems to fix it. Please test.

Thanks,
Alec

chri...@surlykke.dk

unread,
Nov 9, 2012, 1:02:21 AM11/9/12
to razor-qt

I was able to reproduce it in a Fedora VM, and adding a
msg.arguments().first().isNull() check seems to fix it. Please test.


That fixes it for me - thanks!

br. Chr. 
Reply all
Reply to author
Forward
0 new messages