[SailfishDevel] How to use Insomniac?

Thomas Tanghus thomas at tanghus.net
Wed Oct 14 21:29:22 UTC 2015


On Wednesday 14 October 2015 17:28:36 jollailija at gmail.com wrote:
> Well, it turns out I didn't do the QML side of Insomniac correctly and it
> seems to work sometimes at random. It worked during my test but now it
> doesn't seem to work at all. Did you (Tanghus) write any documentation
> about the usage of Insomniac {} in QML? 

Sorry, no docs at all but it works mostly like a Timer component. I hadn't
expected any real use of it, but rather Harbour to open up for a proper 
implementation. It was really just a workaround - and learning experience :)

To start with just read the QML Timer docs and you'd be fine. AFAIRC
the only difference is the 'timerWindow' property which sets a window in 
seconds for the desired wake up time, because according to the libiphb docs
the wake up time precision can't be guarantied.
Therefore you'll also need a wake up *regular* Timer to adjust for any
differences. But start with getting the Insomniac timer to work :)

> What part of it does the waking
> up?

It looks like you're missing the onTimeOut to actually react on the wake up.

https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/harbour-kitchentimer.qml#L158

> Thanks for bearing with me :)

You're welcome and I'm glad if you can use it.

> (my QMl file is at github.com/jollailija/simplestopwatch in case you need to
> look at it)

-- 
Med venlig hilsen / Best regards

Thomas Tanghus

A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20151014/dbe8a8db/attachment.pgp>


More information about the Devel mailing list