[Kde-pim] [patch] Printing emails [version 2]

Jaroslaw Staniek js at iidea.pl
Fri Jul 11 09:39:18 BST 2008


Ingo Klöcker said the following, On 2008-07-11 01:04:
> On Wednesday 09 July 2008, Jaroslaw Staniek wrote:
>> Thomas McGuire said the following, On 2008-07-08 18:43:
>>> Please go for a signal/slot solution.
>> Attached for review.
>>
>> - added KHtmlPartHtmlWriter::finished() signal, connected to
>> KMReaderWin::slotPrintMsg().
>> - previous KMReaderWin::printMsg() code splitted into two pieces:
>>    1st - KMReaderWin::printMsg( KMMessage* aMsg ) - connects the
>> finished() signal and calls setMsg(),
>>    2nd - KMReaderWin::slotPrintMsg() - is a response for finished()
>> signal, calls mViewer->view()->print() and deletesLater() the
>> KMReaderWin.
>>
>> - at KMPrintCommand level, we keep QPointer<KMReaderWin> s_printerWin
>>    globally until the KMReaderWin object is destroyed;
>> - on KMPrintCommand::execute() we call
>> s_printerWin->htmlWriter()->reset() to stop any previous processing
> 
> Using a static object is a no-go.
> 
> +  if ( s_printerWin && s_printerWin->htmlWriter() )
> +    s_printerWin->htmlWriter()->reset(); // stop any previous 
> processing
> 
> This will cause problems if the user manages to print twice in rapid 
> succession because the second print job will kill the first one.

KMReaderWin::printMsg() is async now, so if we keep using KMReaderWin on the 
stack, it'll be destroyed just a (see the patch in my previous post). That was 
the reason for the change.

Of course we need to address risks you have explained, but perhaps in a 
different way. My original proposal of using for() loop and processEvents() 
worked with "in place" with object on the stack, but the timer-based solution 
needs something more.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)
_______________________________________________
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