Friendiqa/source-linux/qml/genericqml/LinuxSync.qml

30 lines
749 B
QML
Raw Normal View History

2019-06-25 20:59:10 +02:00
import QtQuick 2.4
Item {
Timer{
id:syncTimer
repeat: true
onTriggered: {
updatenews.setDatabase();
updatenews.login();
2022-03-01 21:59:21 +01:00
updatenews.setSyncAll(true)
2019-06-25 20:59:10 +02:00
updatenews.startsync();
}
}
2020-05-24 21:14:23 +02:00
function startSyncTimer(interval){
syncTimer.interval=interval*60000;
//print("synctimer interval "+syncTimer.interval)
syncTimer.start()
}
2019-06-25 20:59:10 +02:00
Component.onCompleted: {
if (root.globaloptions.hasOwnProperty("syncinterval") && root.globaloptions.syncinterval !=null && root.globaloptions.syncinterval !=0){
2020-05-24 21:14:23 +02:00
startSyncTimer(root.globaloptions.syncinterval)
2019-06-25 20:59:10 +02:00
}
2020-05-24 21:14:23 +02:00
root.updateSyncinterval.connect(startSyncTimer)
2019-06-25 20:59:10 +02:00
}
}