[Kde-pim] Re: Akonadi in a commandline tool

Michael Schuerig michael.lists at schuerig.de
Fri Apr 29 17:25:45 BST 2011


On Friday 29 April 2011, Stephen Kelly wrote:
> Michael Schuerig wrote:
> > I'm trying to access Akonadi in a commandline tool, however there
> > are still some crucial tasks I haven't found a way to achieve:
> > 
> > * Getting a list of the user-visible names of all (top level)
> > collections.
> > * Instantiating a Collection given its user-visible name.
> > * Restricting a SPARQL query to a single collection.
> > * Providing useful error messages for malformed SPARQL queries.
> > 
> > In GUI apps, the first two tasks are apparently handled by
> > Akonadi::EntityTreeModel, but as that class is tied rather
> > intimately to GUI functionality, I'm not sure if it is the right
> > thing for my purpose.
> 
> The point of Akonadi::EntityTreeModel is to *not* be tied to gui
> functionality at all, but allow gui functionality to rely intimately
> on it.

Please correct me if I'm wrong. It is my understanding that models in 
Qt/KDE define a common SPI for anything that is supposed to be displayed 
in views. As such, the model implementation itself preferably is just an 
adapter that moulds underlying functionality into that interface. It is 
my impression that EntityTreeModel is a lot more than an adapter, it 
encompasses functionality that is not readily available elsewhere.

> It could be used in a command line tool just fine, but that's not to
> say it's definitely right for the purpose. I might put together an
> example application showing how it can be done/useful for the
> purpose.

If using EntityTreeModel in non-GUI contexts such as commmandline tools 
and daemons is the accepted way then I go along. If all I want is read-
only access to some data as it is right now, I get overwhelmed if I have 
to go through interfaces that confront me with, say, headers and change 
monitoring. Obviously, I can achieve my purpose with such an interface, 
but as I'm still very much learning my way around the internals of KDE 
and Akonadi, I suspect I may have missed a way using a narrower 
interface.

Michael

-- 
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
_______________________________________________
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