![]() |
2011-12-20
, 02:07
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#2
|
I want to run an aplication using the information i got in aplication.desktop file. Per example for circus game i got the following information:
Name: "Circus"
Exec: "/usr/bin/single-instance /usr/bin/incrediblecircus"
Icon: "incrediblecircus"
How i use the QProcess to run /usr/bin/single-instance /usr/bin/incrediblecircus ?! Thanks
EDITED: It worked my bad :| but per example with maps it doesn't work:
The error:Code:QProcess p; //p.start("/usr/bin/single-instance /usr/bin/incrediblecircus"); p.start("/usr/bin/invoker --type=e /usr/bin/maps -u %U"); p.waitForFinished(-1); QString output = p.readAllStandardOutput(); qDebug() << output; qDebug() << "e:" + p.readAllStandardError();
p.start("/usr/bin/invoker --type=e /usr/bin/maps");
QStringList args; args << "-u" << your_argument; p.start("/usr/bin/invoker --type=e /usr/bin/maps", args);
![]() |
2011-12-20
, 08:47
|
Posts: 34 |
Thanked: 12 times |
Joined on Sep 2009
@ Portugal, Porto
|
#3
|
The problem is that you are including the arguments in the program name. In the desktop file, the %U refers to a URI that is passed to the program when it is launched. If you want to launch Maps without any arguments, you should use
If you want to pass an argument, you should useCode:p.start("/usr/bin/invoker --type=e /usr/bin/maps");
Code:QStringList args; args << "-u" << your_argument; p.start("/usr/bin/invoker --type=e /usr/bin/maps", args);
![]() |
2011-12-24
, 22:52
|
Posts: 34 |
Thanked: 12 times |
Joined on Sep 2009
@ Portugal, Porto
|
#4
|
Name: "Circus"
Exec: "/usr/bin/single-instance /usr/bin/incrediblecircus"
Icon: "incrediblecircus"
How i use the QProcess to run /usr/bin/single-instance /usr/bin/incrediblecircus ?! Thanks
EDITED: It worked my bad :| but per example with maps it doesn't work: