Profile for Subsurface-mobile on Android

Dirk Hohndel dirk at hohndel.org
Tue Dec 1 18:34:21 PST 2015


So a little digging and a sprinkling of qDebug() statements finally helped me to figure out what's going wrong with the profile on Android. It a race condition. In a weird backwards way.

So when we call plotDive that updates the dataModel with the plotInfo and then emits dataChanged() - the different components of the profile listen to that signal and update the graphical representation. The next time the profile is painted it all looks as intended.

Now in Subsurface-mobile we called plotDive() and then a couple of lines after that we called render to pain the profile into a pixmap. For reasons I'm not sure I fully understand, running this under Linux on my laptop always worked. But on Android, the paint() members of the different components of the profile were called BEFORE the slots that were connected with the dataChanged() signal. Which meant that quite frequently very little of the profile was rendered correctly.

I believe I have this fixed. I now call plotDive() from QMLProfile::setDiveId() and not from QMLProfile::paint() - but if I'm honest I think this is just hiding the problem... we need a way to know when the profile is fully updated and ready to be rendered...

The other issue that's still confounding me is the sizing of the profile. I played around with this and what I'm seeing on screen makes very little sense to me. Any help with that would be appreciated.

Current APKs are in downloads/daily

/D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151201/0215d776/attachment.html>


More information about the subsurface mailing list