[PATCH] KProcess port of khelpcenter

Oswald Buddenhagen ossi at kde.org
Sat Jan 26 08:21:17 GMT 2008


On Fri, Jan 25, 2008 at 10:44:10PM +0100, Ralf Habacker wrote:
> +++ kcmhelpcenter.cpp	(working copy)
> @@ -37,7 +37,7 @@
> -  if ( !mProcess->start( K3Process::NotifyOnExit, K3Process::AllOutput ) ) {
> -    kError() << "KCMHelpcenter::startIndexProcess(): Failed to start process."
> -      << endl;
> -  }
> +  mProcess->start();
>
error checking?

> @@ -610,10 +597,10 @@
> +void KCMHelpCenter::slotReceivedStdout()
>  {
> -  QString text = QString::fromLocal8Bit( buffer, buflen );
> -  int pos = text.lastIndexOf( QLatin1Char('\n') );
> +  QByteArray text= mProcess->readAllStandardOutput();
> +  int pos = text.lastIndexOf( '\n' );
>
chop chop chop ...

> @@ -624,10 +611,10 @@
> +void KCMHelpCenter::slotReceivedStderr( )
>  {
> -  QString text = QString::fromLocal8Bit( buffer, buflen );
> -  int pos = text.lastIndexOf( QLatin1Char('\n') );
> +  QByteArray text = mProcess->readAllStandardError();
> +  int pos = text.lastIndexOf( '\n' );
>
lalala ...

from the patch it seems that the outputs are only appended to internal
buffers for later processing anyway. if so, don't use the signals for
immediate processing at all.

ps: it's boring when you always make the same mistakes. gimme something
exciting. :-P ;)

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