Models Moving Plan

David Edmundson david at davidedmundson.co.uk
Fri Oct 19 15:33:19 UTC 2012


Below is my plan for updating the models in KTp, getting it _ready_
for the port to supporting metacontacts.

It should help my review requests make sense :). After each step, all
code should compile and work without any bugs.
By doing it in small steps it breaks everything into something easier
to manage, and should be easier to find bugs as they happen.

Please read through before the meeting on Thursday. So that in the
meeting we can start assigning tasks to help get this done faster.

Model Changing Plan:

1 - Stop using a model of all contacts to make combo boxes of Accounts.

Move accounts list model from KCM, use that for anything that needs
accounts as AccountsModel, rename current model of Contacts to
ContactsModel.

Models ready. Not updated _all_ repos (yet).

2 - Port _all_ code away from using ContactsModelItem
    (get to a point that ContactsModelItem can be private.
    Need to expose AccountPtr and ContactPtr as roles, and have a role
for rowType which is an enum of "Account, Contact, Group. Person"
(last one is to be added later) )

Models ready. Not updated all repos. It's a lot of work in the Contact List.

3 - Make GroupsModel work without ContactModelItem, and 	support
grouping a tree. Also allow grouping by arbitrary roles, so we can
group by Account (as Nepomuk model won't be a tree of accounts)

Ready, Initial testing worked on the normal model proved really well.
Needs testing on the Nepomuk Model. (Aleix, Martin, would be good if
one of you could ping me to help try it)

4 - Turn ContactsModel from the tree into a list, so it's a similar
structure to Nepomuk model.

So much code is having to build a tree then flatten it, which is
silly. This also causes a bug with sorting in the
contacts-list-applet.
GroupsModel above allows for grouping by account, so we can use that.
Suggest using GlobalAccountManager. List models are pretty easy to
make.

Not started

5 - Kill FlatModelProxy

Kill it to death.

Not started

6 - Share roles enum and names between ContactListModel (ours) and the
one from KPeople

Not started

7 - Allow replacing the ContactsListModel with KPeople model.

Everything will work flawlessly without any issues whatsoever.

Not started


More information about the KDE-Telepathy mailing list