A while ago I got a N950 (the MeeGo/Harmattan developer device) from Nokia (thank you very much). I’ve been playing around with it a bit and preparing for porting a Symbian/QML app. Porting the actual QML application is easy. Just adjust the layouts here and there, produce higher resolution variants of bitmap graphics, etc. The nastier part is finding out how to do some things that are not provided by Qt. In my case I would’ve wanted to use the native “camera roll” component that the native apps use for picking an image taken with the device camera.
I asked around IRC and Twitter, Googled, tried to find documentation and after an hour gave up. Despite of this kind of thing being so fundamental service, it looks like it’s not available. Ok, there’s probably some good reason rooted in the messy history of the Harmattan UI and such service would’ve been provided for developers if original plans had held, so let’s not get into that…
Anyway making your own picker isn’t really that hard. QtMobility has QML bindings for the Gallery module, which provides you a data model filled with whatever images, videos, music or files on the device you ask for. Great. The only question left is where to get the thumbnails for the images? I looked around, asked around, googled around if you can ask the DocumentGalleryModel for them (an URI to the thumbnail just like to the actual file), but I couldn’t find the answer.
The actual engine providing the data for DocumentGalleryModel in Harmattan is a component called Tracker. After a little digging I found out (well actually Sami Rosendahl pointed out) that the Tracker stores the thumbnails to ~/.thumbnails/
So without any further blabbering here’s the QML for a minimal flickable photo grid. In a real app you probably want to add some filters to the model to avoid pulling every photo to the same list, but to divide them up to months or something instead but I’ll leave that to you. (And yes you can probably get that thumbnail URI from the tracker, but this is just my cunning plan to get a person in the know to come and spill the beans in the comment section )