[PATCH] KProcess port of khelpcenter

Ralf Habacker ralf.habacker at freenet.de
Thu Jan 3 15:55:01 GMT 2008


Oswald Buddenhagen schrieb:
> On Mon, Dec 31, 2007 at 09:56:41AM +0100, Ralf Habacker wrote:
>   
>> +++ searchhandler.cpp	(working copy)
>> +void SearchJob::searchExited( int exitCode, QProcess::ExitStatus exitStatus )
>> +{
>> +    if ( exitStatus == QProcess::NormalExit && exitCode == 0 ) {
>> +        mResult = mProcess->readAllStandardOutput();
>> +        emit searchFinished( this, mEntry, mResult );
>> +    } else {
>> +        mError = mProcess->readAllStandardError();
>> +        QString error = QLatin1String("<em>") + mCmd + QLatin1String("</em>\n") + mError;
>> +        emit searchError( this, mEntry, error );
>>
>>     
> dunno if it's wise to have stdout/stderr processed only in each
> particular case. that's a problem of the class' api, though.
>   
This was the behaivor in the original code

line 209:
 if ( proc->normalExit() && proc->exitStatus() == 0 ) {
    emit searchFinished( this, entry, result );
  } else {
    emit searchError( this, entry, error );
  }

I don't think it would be wise the change the api now.
>   
>> @@ -102,148 +173,42 @@
>>  
>>      kDebug() << "SearchHandler::search() CMD: " << cmdString;
>>  
>> +    SearchJob *searchJob = new SearchJob(entry);
>> +    connect(searchJob, SIGNAL(searchFinished( SearchJob *, DocEntry *, const QString & )),
>> +            this, SLOT(searchFinished( SearchJob *, DocEntry *, const QString & )));
>> +    connect(searchJob, SIGNAL(searchFinished( SearchJob *, DocEntry *, const QString & )),
>> +            this, SLOT(searchError( SearchJob *, DocEntry *, const QString & )));
>>     
>
>   
>> +    SearchJob *searchJob = new SearchJob(entry);
>> +    connect(searchJob, SIGNAL(searchError( SearchJob *, DocEntry *, const QString & )),
>> +            this, SLOT(searchFinished( SearchJob *, DocEntry *, const QString & )));
>> +    connect(searchJob, SIGNAL(searchError( SearchJob *, DocEntry *, const QString & )),
>> +            this, SLOT(searchError( SearchJob *, DocEntry *, const QString & )));
>>  
>>     
> find the blunders. :-D
>   
you have eagle eyes ?  

 I will fix it. If there are no more issues I would check this in. 

Ralf









More information about the kde-core-devel mailing list