This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Accessing Kontact data

Tags: None
(comma "," separated)
User avatar
bill-lancaster
Registered Member
Posts
55
Karma
0
OS

Accessing Kontact data

Mon Nov 05, 2012 4:18 pm
I have my contacts sync'd with Google.
Where is the contact data stored on my PC and in what fform is it kept?
User avatar
progdan
KDE Developer
Posts
90
Karma
0
OS

Re: Accessing Kontact data

Mon Nov 05, 2012 5:14 pm
Locally it's cached in Akonadi database (depending on your configuration, it can be a MySQL or a PostgreSQL database). As a user, you should not be concerned about how and where the items are cached though. The only real storage is still on Google servers and Akonadi only makes sure that every change you made locally is also written there.


Daniel Vrátil | www.dvratil.cz | dvratil@kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)
User avatar
bill-lancaster
Registered Member
Posts
55
Karma
0
OS

Re: Accessing Kontact data

Mon Nov 05, 2012 5:37 pm
Thank you - that's very helpful.
I'd like to have a read only access so the cache you mention would be usefull.
My application uses mysql (i'm prepared to try postgres though).
How can I determine which db type is used and any hints as to how to access it?
User avatar
progdan
KDE Developer
Posts
90
Karma
0
OS

Re: Accessing Kontact data  Topic is solved

Mon Nov 05, 2012 6:04 pm
You find it in "System Settings" -> "Akonadi Configuration" -> "Akonadi Server Configuration"

However you should never access the database directly (the scheme can change any time, you could corrupt your data), but use available client classes instead [0].

To get Google contacts, you would run Akonadi::CollectionFetchJob() to fetch all collections, then find the "google" one and run Akonadi::ItemFetchJob() to retrieve all contacts within the given collection. Much easier then and safer then digging into the database directly ;)

[0] http://ap.kde.org/4.x-api/kdepimlibs-ap ... index.html


Daniel Vrátil | www.dvratil.cz | dvratil@kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)
User avatar
bill-lancaster
Registered Member
Posts
55
Karma
0
OS

Re: Accessing Kontact data

Tue Nov 06, 2012 7:10 am
Thank you very much - I now have some interesting stuff to do!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]