Getting Started and Progressing with Plasma-Phonebook App

Plasma-Phonebook is a Plasma Mobile Application which is synonymous to the Contacts application, which is commonly used in Android Operating System. It helps in management of contacts, in terms of Adding, Deleting, and Modifying them.

I found this application very interesting while exploring and so I choose to start contributing to it, and ta-daa, here I am writing my very first blog on Plasma Mobile Phonebook. So Lets Get Started!!

The application extracts its data, i.e. the contacts from the kpeople library, which acts as backend for the plasma – phonebook app. The NextCloud Contacts integration is done using KDE sink API. This sink helps in syncing contacts (from NextCloud) to kpeople. Here’s what happens. When Plasma-phonebook app is started, an instance of kpeople (the backend) is created, and following which all the datasources of kpeople are called upon to serve their master 😌

** Sink : is an offline-caching, synchronization and indexing system for calendars,
contacts, mails, etc.
kpeople : It acts as backend for the plasma-phonebook app. **

This is what Plasma Phonebook looks like after the contacts are Sink(ed) .

Presently, the addContact and deleteContact functionalities already exist. So the task is to add edit contact functionality to enable users to edit contacts synced from Nextcloud account using Plasma-Phonebook app. This will reflect the changes in the Nextcloud account and also in our phonebook.

So I figured out the following –
When we edit a contact from plasma-phonebook then the setCustomProperty function is called. This function is declared in AbstractEditableContact class in kpeople. This class is inherited by SinkContact in kpeople-sink. ‘setCustomProperty’ is overridden in this class and defined here. The edit contact functionalities are implemented here. This is the function that needs to be fixed to implement ‘edit contact’ functionality.

After working on it, I realized that the modify function was not executed properly, and so when I added a “.exec() ” to it (refer to the above image), it did execute but modified a single contact.

And with this, Tada!
Our system for NextCloud CardDav Integration with modify contact functionality is here \o/

You can follow the similar procedure to manage contacts by implementing the edit contacts functionalities…
Until next blog, keep loving !

Leave a comment

Design a site like this with WordPress.com
Get started