Archive for April, 2007

Porting is Slow.

Porting application to the new qt4 / kde4 api is a lot of work. I admit it is a lot more work then I thought at the start of the porting effort.

I started working on Mailody last year and figured it would be a breeze to port it and then continue with new features (which I’ve already programmed in my mind a dozen times now). Instead I now have the feeling that we are building the application pretty much from scratch.

All features we implemented need love to implement again and large portions need to be rewritten, for example the model/view structure requires large changes in the code base. I’ve no real complaints about the new api, it’s nice to work with and I can reach what I want with the api. The only problem is that it is just a lot of work.

The class I like most at this moment is the QSortFilterProxyModel, this is the class you can use to influence the sorting and filtering of the items in a model/view. In Mailody’s case it was simple to implement the ‘hide-deleted-but-show-them-when-a-new-message-arrives’-feature and to sort the items based on the youngest child in a thread. On the other hand using a Proxy complicates the mapping to and from items in the model with another level, but overall model/view is nice when you get the hang of it. The only bug I encountered was that a repaint() on the view does not seem to work.

If you still have not started porting your application, consider this a warning, you need time to do it. Mailody’s plan was to release at the same times as KDE releases alfa’s and beta’s. I’ve put that idea out of mind, at least for the alfa.

Model / View, here I come.

Allright, I give up. I’ve tried for a week now to get Mailody to work properly with a QTreeWidget. I’ve now settled with the idea that whatever happens, this will not be the future for Mailody. Inserting 200 mailboxes in a mailbox QTreeWidget is ok, but as soon as you talk about larger quantities (for example the headerlist) speed becomes a problem. And that’s just one of the problems I’ve with it.

So, this weekend I will spend on learning the Model / View thing. Some quick experiments show that it’s faster, I hope it stays that way when i’ve it working with the actual data. To be continued…