Review of Contact List Code

David Edmundson david at davidedmundson.co.uk
Thu Mar 10 14:10:53 CET 2011


This is really just for people working on the contact list.

I've been doing a few minor edits on it recently and there is a lot of code
that really needs tidying up before it can be merged. I thought I would
highlight these here so we can all work on that, and get it fixed soon.

1) Coding Style

We follow this
http://techbase.kde.org/Policies/Kdelibs_Coding_Style

In particular
if (something) { <- brace on the end of the line. Always put the brace, even
if it's for 1 line.

}

--------

2) Don't hardcode fonts and colours in the delegate code.

If you write font.setSize(10); that doesn't work if someone has vision
issues or even just owns a massive resolution monitor.

Use KGlobalSettings::smallestReadableFont()
 - and its equivalents for other fonts.

With this sizeHint code needs to be more complex, and use font metric
information to work out the minimum height the box needs to be.

Same for colours. If you switch your colour scheme in systemsettings to
"Obsidian Coast" a dark colour scheme, your delegate with the hardcoded
background colour stands out really obviously as being wrong.
QPalette should have everything you need.

---------

3) Looking at whether the alias is blank or not seems a slightly hacky way
to try and separate headings in the model from contacts.

I'm not sure what a better approach is, but there must be one.

--------

Overall it's still pretty awesome, hopefully this will speed up the process
of having it merged into the real master.

I'm happy to help with any of these.

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-telepathy/attachments/20110310/789069da/attachment.htm 


More information about the KDE-Telepathy mailing list