Active Topics

 


Reply
Thread Tools
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#1
I'm making an app to shutdown the n900 at a given time. The function handling the shutdown is the following:

Code:
QString program = "/sbin/halt";
         QProcess *myProcess = new QProcess(this);
         myProcess->execute(program);
When I test it through the remote connection of QtCreator or when I move it to phone and from x-terminal launch it it works. But when I launch it from menu using the following .desktop file after having given the executables privs:

Code:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=TimedShutdown
Exec=/root/TimedShutdown
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
it doesn't shutdown the phone. I have no clue why it works when launched through terminal, I have even given user privs to sbin/halt app hoping it was just a root permess problem but I was wrong.
 
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#2
Solved with:

Code:
QString program = "dbus-send --system --type=method_call --dest=com.nokia.dsme --print-reply /com/nokia/dsme/request com.nokia.dsme.request.req_shutdown";
         QProcess *myProcess = new QProcess(this);
         myProcess->execute(program);
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:57.