[PATCH] thread-safe queued KDialogs

Louai Al-Khanji louai.khanji at gmail.com
Mon Nov 24 07:30:06 GMT 2008


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.




More information about the kde-core-devel mailing list