fix: code review
This commit is contained in:
parent
5ee3c6938f
commit
f16ee322e1
|
@ -120,8 +120,7 @@ QtObject:
|
|||
|
||||
proc setDeviceName*(self: ProfileView, deviceName: string) {.slot.} =
|
||||
devices.setDeviceName(deviceName)
|
||||
self.isDeviceSetup = true
|
||||
self.deviceSetupChanged()
|
||||
self.setDeviceSetup(true)
|
||||
|
||||
proc syncAllDevices*(self: ProfileView) {.slot.} =
|
||||
devices.syncAllDevices()
|
||||
|
|
|
@ -4,11 +4,9 @@ import libstatus/installations
|
|||
import json
|
||||
|
||||
proc setDeviceName*(name: string) =
|
||||
discard getSettings()
|
||||
discard setInstallationMetadata(getSetting[string]("installation-id", "", true), name, hostOs)
|
||||
|
||||
proc isDeviceSetup*():bool =
|
||||
discard getSettings()
|
||||
let installationId = getSetting[string]("installation-id", "", true)
|
||||
let responseResult = parseJSON($getOurInstallations())["result"]
|
||||
if responseResult.kind == JNull:
|
||||
|
|
|
@ -145,16 +145,6 @@ Item {
|
|||
|
||||
Timer {
|
||||
id: timer
|
||||
function setTimeout(cb, delayTime) {
|
||||
timer.interval = delayTime;
|
||||
timer.repeat = false;
|
||||
timer.triggered.connect(cb);
|
||||
timer.triggered.connect(function release () {
|
||||
timer.triggered.disconnect(cb); // This is important
|
||||
timer.triggered.disconnect(release); // This is important as well
|
||||
});
|
||||
timer.start();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
function setTimeout(cb, delayTime) {
|
||||
timer.interval = delayTime;
|
||||
timer.repeat = false;
|
||||
timer.triggered.connect(cb);
|
||||
timer.triggered.connect(function release () {
|
||||
timer.triggered.disconnect(cb); // This is important
|
||||
timer.triggered.disconnect(release); // This is important as well
|
||||
});
|
||||
timer.start();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue