[Kde-pim] Review Request: Add isConfiguring method to AgentBase to easily limit to one configuration dialog per agent.
Kevin Krammer
kevin.krammer at gmx.at
Thu Sep 29 20:21:31 BST 2011
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.
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.
Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110929/fa30ad61/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