PDA

View Full Version : Qprocess



ioannisb
9th February 2006, 16:14
Hi there!

Do you have any idea, why this is not working for me?
Qprocess seems that doesn't handle well the process arguments..
When I run a command like "ls -l" with one argument, it works fine..... but ..
connecting with "pppd call vodafone" , is not working....

Thanks in advance.

....................

void Form1::callfunc()
{
textEdit1->append("Starting pppd daemon...");
process = new QProcess(this);
process->addArgument( "pppd" );
process->addArgument( "call" );
process->addArgument( "vodafone" );
connect(process,SIGNAL(readyReadStdout()),
this, SLOT(updateText()));
connect(process, SIGNAL(processExited()),
this, SLOT(processExited()));
process->start();
}

...............

jacek
9th February 2006, 16:27
Do you have enough privileges to run pppd? Is it on your path?

ioannisb
10th February 2006, 07:37
Thank you very much for the reply Jacek,

pppd is in my path and the program is running as user root.

I don't know how to debug it....

void Form1::callfunc()
{
textEdit1->append("Starting pppd daemon...");
process = new QProcess(this);
process->addArgument( "pppd" );
process->addArgument( "call" );
process->addArgument( "vodafone" );
qDebug("Reading args..."); // some output here
connect(process,SIGNAL(readyReadStdout()),
this, SLOT(updateText()));
connect(process, SIGNAL(processExited()),
this, SLOT(processExited()));

qDebug("starting process..."); // see some output
process->start();

if ( !process->start() ) {
// error handling
QMessageBox::critical( 0,
tr("Fatal error"),
tr("Could not start the pppd command."),
tr("Quit") );
exit( -1 );
}

}


It seems to be running, because I don't get an error message, but it's not.
I should have an output on my /var/log/messages about pppd, but nothing


Thank you....

jacek
10th February 2006, 10:41
qDebug("starting process..."); // see some output
process->start();

if ( !process->start() ) {
// error handling
// ...
}You try to start that process twice. If you remove one "process->start()", what does the other one returns?

piotrpsz
10th February 2006, 11:01
hi,

try to set a working directory - setWorkingDirectory

piotr

ioannisb
13th February 2006, 09:38
Thanks guys, it seems to be a problem with pppd daemon..... all working fine now.
Thanks a lot for your help.