[PATCH] thread-safe queued KDialogs

Sebastian Trüg trueg at kde.org
Mon Nov 24 08:33:27 GMT 2008


On Monday 24 November 2008 08:30:06 Louai Al-Khanji wrote:
> On Sun, Nov 23, 2008 at 12:36 PM, Sebastian Trüg <trueg at kde.org> wrote:
> > On Saturday 22 November 2008 23:08:00 Thiago Macieira wrote:
> >> Sebastian Trüg wrote:
> >> >The attached patch makes queued dialogs thread-safe. With it, queued
> >> >KMessagesBoxes and thus, the default KMessage messasge handler.
> >> >This fixes a crash in KRunner when KMimeType tried to complain about
> >> > missing mimetypes using KMessage which in turn uses KMessageBox which
> >> > tries to open a QWidget from a thread which is not the GUI thread
> >> > which triggers an assert. :)
> >> >
> >> >May I apply?
> >>
> >> What's the number 20? Where did the 20 milliseconds timer come from? Why
> >> not 25?
> >>
> >> I know it's not your code, but maybe someone else knows where this value
> >> came from. Let's not keep arbitrary things.
> >
> > hm, you are right. I simply kept the timeout from the second singleshot.
> > But AFAICS 0 should be fine here.
> > --
> > Sebastian Trueg
> > Sponsored by Mandriva to work on Nepomuk-KDE.
> >
> > http://nepomuk.kde.org
>
> 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.

Cheers,
Sebastian
-- 
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/20081124/fbe5fbd0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdialog-thread-safe-queued-dialogs2.diff
Type: text/x-patch
Size: 1623 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081124/fbe5fbd0/attachment.bin>


More information about the kde-core-devel mailing list