From kde-devel Thu Nov 30 22:04:01 2006 From: Andreas Pakulat Date: Thu, 30 Nov 2006 22:04:01 +0000 To: kde-devel Subject: Re: problems using KProcess Message-Id: <20061130220401.GA9254 () morpheus ! apaku ! dnsalias ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=116492431128278 On 30.11.06 23:31:59, Andras Mantia wrote: > On Wednesday 08 November 2006 19:45, Andreas Pakulat wrote: > > Hi, > > > > I'd like to run a command (qmake) inside my application and capture > > its error-output. I want the execution to block my application until > > it finished (please no discussion wether that is a good idea or not). > > > > I thought executing KProcess::start(KProcess::Block, > > KProcess::Stderr) would do that. It doesn't, start() returns > > immediately and normalExit function returns false. > > > > I discovered setUseShell and tried that, so qmake runs in a shell. > > This works if I use KProcess::NotifyOnExit, but when using > > KProcess::Block start never returns and I see a qmake Zombie and a > > sleeping bash in the process list. > > > > Anybody got an idea how I might achieve what I want? > > If you didn't solved this problem yet, I posted a patch on KDevelop list > with a BlockingKProcess class inside doing the same for stdout. It is > trivial to extend to stderr (and move it to the library part of > KDevelop). It uses KProcess and the NetAccess style hack to make an > asynch operation synchronous. Yeah, saw it. However the async approach works now in kdevelop3 and I'd like to spend time on kdevelop4 rather than trying to change that again. As far as I can see QProcess from Qt4 does have a waiting-function which emits signals when output is ready to be read. Do you know what the conclusion was about making KProcess a QProcess subclass? Andreas -- Your step will soil many countries. >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<