[PATCH] thread-safe queued KDialogs

Sebastian Trüg trueg at kde.org
Tue Nov 25 09:54:23 GMT 2008


On Tuesday 25 November 2008 10:46:11 Sebastian Trüg wrote:
> On Tuesday 25 November 2008 09:27:59 Aurélien Gâteau wrote:
> > Sebastian Trüg wrote:
> > >  > How about using QMetaObject::invokeMethod instead of a timer with 0
> > >  > time out? Just seems cleaner to me.
> > >
> > > I did not know about that. Thanks. This indeed seems cleaner. New patch
> > > attached.
> >
> > -  QTimer::singleShot( 0, _this, SLOT( slotShowQueuedDialog() ) );
> > +  // We use a queued connection to be able to use queued dialogs
> > +  // from threads other than the GUI thread (example: KMessageBox)
> > +  QMetaObject::invokeMethod( _this, SLOT(slotShowQueuedDialog()),
> > Qt::QueuedConnection );
> >
> > Does this work? If I am not mistaken, the second parameter should not be
> > SLOT(slotShowQueuedDialog()), but "slotShowQueuedDialog", with quotes,
> > without SLOT and without parenthesis.
>
> you are right.

new patch.

-- 
Sebastian Trueg
Sponsored by Mandriva to work on Nepomuk-KDE.

http://nepomuk.kde.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081125/40989dcf/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdialog-thread-safe-queued-dialogs3.diff
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081125/40989dcf/attachment.bin>


More information about the kde-core-devel mailing list