neversun / bodyweight-timer

time supporting app for traing purposes (bodyweight-training) on Jolla Sailfish OS
MIT License
5 stars 3 forks source link

Order of property-assignments undefined, could lead to problems #2

Closed LinuCC closed 9 years ago

LinuCC commented 9 years ago

As written in This stackoverflow post, the order in which the properties are defined is not deterministic. This could lead to a problem, for example in Tabata.qml:

    property variant    value1ReturnFromDB:     DB.getDatabaseValuesFor(page,"value1")
    ...
    property int        value1:                 value1ReturnFromDB[0]

It is possible that the assignment of value1 will be executed before value1ReturnFromDB, making value1 undefined even if the database-call succeeded with the correct data.

neversun commented 9 years ago

This should fix it 5c7ea014a49c4cfecfc119aec486ff9991c648ec