[Kde-pim] Akonadi::AgentBase::Observer Class Reference

Daniel Vrátil dvratil at redhat.com
Sun Nov 17 13:51:29 GMT 2013


Hi,

On Sunday 17 of November 2013 13:41:11 Martin Koller wrote:
> In this documentation
> http://api.kde.org/4.x-api/kdepimlibs-apidocs/akonadi/html/classAkonadi_1_1A
> gentBase_1_1Observer.html I read:
> 
> "Do not call the base implementation of reimplemented virtual methods! The
> default implementation disconnected themselves from the
> Akonadi::ChangeRecorder to enable internal optimizations for unused
> notifications."

This is correct.

> 
> But in the example below, I find:
> 
> void ExampleObserver::itemChanged( const Item &item )
> * {
> *   // do something with item
> *   kDebug() << "Item id=" << item.id();
> *
> *   // let base implementation tell the change recorder that we  
> <<<<<<<<<<<<<<<<<<<< ???? *   // have processed the change
> *   AgentBase::Observer::itemChanged( item );
> * }
> 
> what's correct now ?

This is less-correct :) It's safe to call parent implementation of 
itemChanged() because it does not have the disconnect optimization (most users 
reimplements itemChanged, so the optimization makes no sense here), while for 
example itemLinked() has it. That is however an implementation detail that 
users should not depend on and can change in future.

I'll fix the example in master, thanks for spotting it.

Cheers,
Dan

-- 
Daniel Vrátil
KDE Desktop Team
Associate Software Engineer, Red Hat, Inc.

GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20131117/0bed973a/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