[Kde-pim] Review Request: Add isConfiguring method to AgentBase to easily limit to one configuration dialog per agent.

Martin Bednár serafean at gmail.com
Fri Sep 30 16:54:49 BST 2011


Le Jeudi 29 de septembre 2011 21:21:31 Kevin Krammer a écrit :
> On Wednesday, 2011-09-14, Martin Bednár wrote:
> > I haven't found a way of telling the base class that an overloaded
> > function from one of its child has been called except calling a
> > parent's function in the child (IOW the agent must be modifie in any
> > case). I would appreciate any insight you may have into this.
> 
> The call comes in via D-Bus, so some code at the agent side needs to
> transform that into a method call.
> 
> This is where we can intercept.

Thanks, hadn't thought of that... In fact, didn't , know it was possible.

> 
> After a quick look that place is found in the ControlAdaptor class.
> It is generated from the XML based D-Bus interface description for the Agent
> Control Interface.
> For each D-Bus method it currently calls the respective method on the
> AgentBase object it got in its constructor.
> 
> The call to configure basically looks like this:
> 
> D-Bus -> ControlAdaptor -> AgentBase
> 
> 
> Look for
>  new Akonadi__ControlAdaptor
> in agentbase.cpp on how it is instantiated.
> 
> What we now would to have is a call to a different method so we can check if
> there is a configure call in progress.
> 
> First we need a class very similar to the ControlAdaptor class, i.e.
> something that takes an AgentBase instance and forwards calls to that.
> 
> Then we need to change the CMakeLists.txt file such that the generated
> ControlAdaptor takes an instance of that new class in its constructor.
> 
> The call will then look like this:
> 
> D-Bus -> ControlAdaptor -> NewClass -> AgentBase.
> 
> In NewClass::configure() we can then check a member on whether there is a
> call to configure in progress.
> If it is not, we set the flag and call AgentBase::configure()
> We can either reset the flag on return of AgentBase::configure() or when
> AgentBase emits one of its configure finished signal.

I'll do it this way then...

Thanks,

Martin
-------------- 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/20110930/8e8c82ac/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