KEditToolBar ported to KProcess

Oswald Buddenhagen ossi at kde.org
Wed Jun 13 11:39:03 BST 2007


On Tue, Jun 12, 2007 at 07:17:26PM +0200, Andreas Pakulat wrote:
> +++ kedittoolbar.cpp	(Arbeitskopie)
> -  if ( !m_kdialogProcess->start( K3Process::NotifyOnExit ) ) {
> +  m_kdialogProcess->setOutputChannelMode(KProcess::MergedChannels);
>
this is no equivalent transformation. nothing in the original code
suggests that the channels are supposed to be merged. OnlyStdoutChannel
seems right.

> -       m_kdialogProcess->readln(icon, true) <= 0 ) {
> +  icon = QString::fromLocal8Bit( m_kdialogProcess->readAllStandardOutput() );
> +  icon = icon.left( icon.indexOf( "\n" ) );
>
use
  icon = QString::fromLocal8Bit( m_kdialogProcess->readLine() );
or (if you like overkill):
  QTextStream t(m_kdialogProcess);
  icon t.readLine();
(stdout is the default read channel).

fwiw, there is no hurry with porting away from k3process - unless your
os comes from redmond. >8=)
anyway, thanks for helping out.

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




More information about the kde-core-devel mailing list