Porting DrKonqi away from K3Process: problem with working directory

Oswald Buddenhagen ossi at kde.org
Sat Jan 19 14:07:57 GMT 2008


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.

> 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?

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

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

> +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 =

> +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 ...

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Confusion, chaos, panic - my work here is done.




More information about the kde-core-devel mailing list