[Kde-pim] Review Request: add AgentInstance::setOption method, to set an option via DBus

Kevin Krammer kevin.krammer at gmx.at
Fri May 22 09:20:32 BST 2009



> On 2009-05-21 11:58:36, Kevin Krammer wrote:
> > It seems I don't get the general idea about this quite complex approach of constructing D-Bus method names.
> > If we require an interface to set arbitrary options, why not add one setOption(string, variant) method to the D-Bus interface?
> >
> 
> Constantin Berzan wrote:
>     This makes it easier for apps that need to configure an agent/resource, because they no longer have to worry about:
>     * obtaining a dbus interface in the first place
>     * checking for errors
>     These two tasks are instead neatly encapsulated in AgentInstance.
>     
>     My rationale for doing this is that the code for configuring a resource via dbus was pretty hairy without this, so I was looking into nicer ways of doing it.  But if the consensus is that it's unnecessary, I'm more than happy to do it the old way.
> 
> Constantin Berzan wrote:
>     One thing I've forgotten to mention:
>     All of this stemmed from the fact that I needed to get access to the maildir resource's dbus interface from the outboxinterface library (currently in playground). I couldn't use the qdbusxml2cpp-generated class because that would add a dependency from kdepimlibs to kdepim.  (The intention is to move outboxinterface to kdepimlibs when it is ready.)

Hmm, I got the general idea, but I didn't get the idea about this kind of implementation, i.e. creating method signatures on the fly, using extremely low level Qt API to get types, etc.

Why is it necessary that the sender interprets the call?
What's the reason to not let it be handled on the receiver side, which actually knows what the parameters mean?

As for build dependencies: solvable by moving the interface down the stack, no?


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/734/#review1170
-----------------------------------------------------------


On 2009-05-21 23:45:01, Constantin Berzan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/734/
> -----------------------------------------------------------
> 
> (Updated 2009-05-21 23:45:01)
> 
> 
> Review request for KDE PIM.
> 
> 
> Summary
> -------
> 
> This makes it possible to configure an agent / resource via DBus without having to go through the trouble of creating a QDBusInterface.  The code existed before in Firstrun, an internal class in kdepimlibs/akonadi.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdepimlibs/akonadi/agentinstance.h 970429 
>   /trunk/KDE/kdepimlibs/akonadi/agentinstance.cpp 970429 
>   /trunk/KDE/kdepimlibs/akonadi/agentinstance_p.h 970429 
>   /trunk/KDE/kdepimlibs/akonadi/firstrun.cpp 970429 
>   /trunk/KDE/kdepimlibs/akonadi/firstrun_p.h 970429 
> 
> Diff: http://reviewboard.kde.org/r/734/diff
> 
> 
> Testing
> -------
> 
> * maildir resource creation and configuration from the outboxinterface lib in playground/pim (not commited to svn yet)
> * maildir resource creation and configuration via Firstrun, by putting a default file in ~/kde/share/apps/akonadi/firstrun.  Settings of type QString and bool have been tested.
> 
> 
> Thanks,
> 
> Constantin
> 
>

_______________________________________________
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