Reply to topic

Accessing Kontact data

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
38
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.
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
38
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
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!

 
Reply to topic

Bookmarks



Who is online

Registered users: AElfwine, alake, anditosan, Artmessiah, Baidu [Spider], Bing [Bot], edmael, Exabot [Bot], garthecho, geaplanet, Google [Bot], google01103, Horus, inksi, Joif, ken300, La Ninje, lazyit, mtvee, pedrorodriguez, pvonz, thalesgava, tienhung, VP1986, Yahoo [Bot]