Formatting
This commit is contained in:
parent
80c7f663f1
commit
916d86cd97
3 changed files with 8 additions and 11 deletions
|
|
@ -40,22 +40,19 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: updateTimer
|
id: updateTimer
|
||||||
interval: 60 * 1000
|
interval: 60 * 1000
|
||||||
repeat: true
|
repeat: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
updateWeather();
|
updateWeather()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
function init() {
|
function init() {// does nothing but ensure the singleton is created
|
||||||
// does nothing but ensure the singleton is created
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
function updateWeather() {
|
function updateWeather() {
|
||||||
if ((data.weatherLastFetch === "") || (Time.timestamp >= data.weatherLastFetch + weatherUpdateFrequency)) {
|
if ((data.weatherLastFetch === "") || (Time.timestamp >= data.weatherLastFetch + weatherUpdateFrequency)) {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ Singleton {
|
||||||
|
|
||||||
// Returns a Unix Timestamp (in seconds)
|
// Returns a Unix Timestamp (in seconds)
|
||||||
readonly property string timestamp: {
|
readonly property string timestamp: {
|
||||||
return Math.floor(Date.now() / 1000);
|
return Math.floor(Date.now() / 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format an easy to read approximate duration ex: 4h32m
|
// Format an easy to read approximate duration ex: 4h32m
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue