[PATCH] KProcess port of khelpcenter

Oswald Buddenhagen ossi at kde.org
Thu Jan 3 15:07:57 GMT 2008


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.

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

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