[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: system independent sleep
From:       Stefan Kombrink <katakombi () web ! de>
Date:       2005-06-08 11:53:17
Message-ID: 200506081353.17603.katakombi () web ! de
[Download RAW message or body]

On Wednesday 08 June 2005 12:20, Kevin Krammer wrote:
> On Tuesday 07 June 2005 23:09, Stefan Kombrink wrote:
> > I use QProcess to run several commands and I implemented a method
> > "stdoutWait" that should wait until the QProcess finishes.
> > After it finishes (processExited()) it should have delivered all stdout
> > data to the slot I have connected readyReadStdout() to.
>
> Hmm, I don't understand why you can't process the accumulated output when
> the process finishes, i.e. in the slot connected to the finished signal.

I can't do so because I want to be able to run a process multiple times and 
get completely different output.
How should I be able to decide how to parse each case?
Or is there a way to pass a parameter to the slot, even if the signal doesn't?
In that case it would be possible...

>
> As you already have that slot, you even get notified when it finishes, so
> there would be no need to poll its state.

That's right, but it would need a different QProcess for each process I want 
to call. It's not in the mentioned code, all right :)

>
> However, if you really need to use hacks instead of a clean solution, use
> QApplication::processEvents in your "wait" method instead of sleep.

Thanks for the hint!
But what would be a clean solution for my problem though?
I agree on using a QThread as a base would be worthwile, but that would not 
change the basic concept, which I believe is the thing you criticise. 

I agree to process the stdout if only running one process.
How can I process the data in the connected slot if the parsing depends on the 
output of the process I have executed. 
And I want to be able to use as many as I like.
How can I get the same results with just two connects and one QProcess 
instance instead of multiple QProcess instances and #QProcess*2 connects?

>
> Cheers,
> Kevin
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic