Porting DrKonqi away from K3Process: problem with working directory

Urs Wolfer uwolfer at kde.org
Sat Jan 19 14:33:41 GMT 2008


On Saturday 19 January 2008 15:07:57 Oswald Buddenhagen wrote:
> On Sat, Jan 19, 2008 at 02:41:09PM +0100, Urs Wolfer wrote:
> > Any ideas?
>
> neither the old nor the new drkonqi code makes any attempt to set the
> wd. i have no idea why the old code worked; k3process certainly has no
> relevant black magic. maybe it was because of using a shell.

Ok, it looks like. Any replacement for using a shell? Otherwise, we cannot 
port it away from K3Process...

> > Index: backtrace.cpp
> > ===================================================================
> > --- backtrace.cpp	(revision 763448)
> > +++ backtrace.cpp	(working copy)
> >  BackTrace::~BackTrace()
> > +  if (m_proc->state() == QProcess::Running)
> >    {
> > +    m_proc->kill();
>
> + waitForFinished();
>
> >    const char* bt = backtraceCommand.toLatin1();
> > +  m_temp->write(bt, strlen(bt)); // the command for a backtrace
>
> why not write() it directly?

Hmm, like it was before? Why is that better?

> > +  m_proc->setOutputChannelMode(KProcess::MergedChannels);
>
> sounds sort of right, but isn't what the old code did. must mentioning
> it.

Without that it does not work. And the old code K3Process::All, isn't that for 
reading all channels?

> > +  m_proc->start();
>
> + waitForStarted() or connect to error(). yes, the old code was broken,
> too.

Ok.

> > +void BackTrace::slotReadInput()
> >  {
> > +  // we do not know if the output array ends in the middle of an utf-8
> > sequence +  m_output = m_proc->readAllStandardOutput();
>
> +=, not =
Of course.

> > +void BackTrace::slotProcessExited(int exitCode, QProcess::ExitStatus
> > exitStatus) {
> > -  // start it again
> > -  kill(m_krashconf->pid(), SIGCONT);
>
> i don't really understand this code, but you removed something without
> adding a replacement here ...

Ahh, you are right. I thought this code was killing the process which has 
already been quited..

Bye
urs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080119/b7054319/attachment.sig>


More information about the kde-core-devel mailing list