Don't call KJob::emitResult() from KJob::start() ?
Friedrich W. H. Kossebau
kossebau at kde.org
Thu Jun 26 14:54:29 BST 2008
Hi,
I found out with KJob one cannot call emitResult already in the start()
method, because at least if KJob is run synchronously then the code will hang
in the eventloop, which is only started after KJob::start():
bool KJob::exec()
{
Q_D(KJob);
QEventLoop loop( this );
connect( this, SIGNAL( result( KJob* ) ), &loop, SLOT( quit() ) );
start();
loop.exec();
return ( d->error == NoError );
}
Is this intended?
If it is, is the attached patch for the API dox okay to commit, especially the
extension of the KJob::start() docs?
Friedrich
--
Okteta - KDE Hex Editor, coming to you with KDE 4.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more-details-for-kjob-start-method.patch
Type: text/x-diff
Size: 2165 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080626/de6c7909/attachment.patch>
More information about the kde-core-devel
mailing list