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

29 lines
709 B
QML

import QtQuick 2.4
Item {
Timer{
id:syncTimer
repeat: true
onTriggered: {
updatenews.setDatabase();
updatenews.login();
updatenews.startsync();
}
}
function startSyncTimer(interval){
syncTimer.interval=interval*60000;
//print("synctimer interval "+syncTimer.interval)
syncTimer.start()
}
Component.onCompleted: {
if (root.globaloptions.hasOwnProperty("syncinterval") && root.globaloptions.syncinterval !=null && root.globaloptions.syncinterval !=0){
startSyncTimer(root.globaloptions.syncinterval)
}
root.updateSyncinterval.connect(startSyncTimer)
}
}