[Kde-pim] [patch] Printing emails

Thomas McGuire thomas.mcguire at gmx.net
Tue Jul 8 17:43:48 BST 2008


Hi,

On Tuesday 08 July 2008 17:43:54 Jaroslaw Staniek wrote:
> Thomas McGuire said the following, On 2008-07-08 17:05:
> > Hi,
> >
> > On Tuesday 08 July 2008 10:21:27 Jaroslaw Staniek wrote:
> >> Till Adam said the following, On 2008-07-08 09:52:
> >>> I don't understand this comment in relation to your fix. Can you please
> >>> explain what you mean here?
> >>
> >> Please see the attached patch. It does the same as using QTimer N times,
> >> and fixes the problem on Windows, because now KMReaderWin::printMsg() is
> >> not reached until the loop ends.
> >
> > I'd rather avoid processEvents() or even custom event loops, they cause a
> > lot of nasty problems. Please go with Ingo's suggestion instead.
>
> Well, I don't propose custom event loop. Loops with processEvents() (used
> in 38 places in KDEPIM and used by me in Kexi), if properly used, is better
> than overlaping signal-slot sequences.
>
> I am asking about this single case. What difference can you see between
> these?
The timer method is safer. The user might do all sort of nasty things in 
processEvents(), like switching to another message. This might be bad, because 
after returning from processEvents(), the assumptions about the objects used 
in that function could be invalid (maybe even the 'this' pointer is invalid 
because the user deleted the message).

Using signals and slots is a lot safer, such things can't happen as easily as 
with processEvents().

And the 38 usages of processEvents() concern me a bit, but at least 
processEvents() doesn't seem to be as problematic as QEventLoop, which almost 
always has problems (see for example 
http://bugs.kde.org/show_bug.cgi?id=165540 for a backtrace introduced by event 
loops).

Please go for a signal/slot solution.

Regards,
Thomas.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080708/9ca1ff79/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list