[Kde-pim] Notifications on KMail

Ingo Klöcker kloecker at kde.org
Thu Jul 15 18:56:43 BST 2010


On Wednesday 14 July 2010, Artur Souza (MoRpHeUz) wrote:
> 2010/7/14 Ingo Klöcker <kloecker at kde.org>:
> > Let's say the composer needs to ask the user which OpenPGP keys
> > shall be used for encrypting the message. If there was a callback
> > then the composer would simply call this callback. The UI
> > component would then show the dialog and return the list of
> > OpenPGP keys as return value of the callback. After the callback
> > returns the composer can continue its work.
> 
> +1 for your solution on this use case!
> 
> > In the signal/slot scenario at least that component that connects
> > the signals with the slots needs to know the provider of the
> > signals and the provider of the slots.
> 
> I think that now I understood the reason behind your suggestion,
> thanks for the explanation! For the use cases that you pointed out I
> agree that callbacks make more sense.
> 
> However, I was talking about just the "failed()" and "success()"
> signals that are already used everywhere in the composer window for
> example. This signals are mainly for reporting and usually just
> connected to one slot each.

Ah. Okay.


> I agree that when you need any kind of input from the user it's way
> better to use the callback mechanism that you just explained. At
> first I was just doing a comparison between the way that the
> failed() and success() signals are treated in the UI (KMessageBox vs
> KNotify) and tried to show the scenarios where one or another were
> already used.
> 
> Do you think that for this specific use case of reporting what
> happened (fail/success) we still need the callback? As there is no
> user interaction (it's just a mechanism to allow the user to know
> what happened) I tend to think that just KNotify would be good
> enough for the job and for more complex scenarios (like asking which
> OpenGPG key the user wants to use) we could go with the callback
> mechanism.

I'm not opposed to using signals for the simple cases, but please keep 
in mind that using two different mechanisms (signal/slot for simple 
things and a callback interface for the more complex things) will make 
the code more complex.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100715/c3abcb5b/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