Use SystemClock support library instead of date
This commit is contained in:
@@ -1,27 +1,19 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
property string time
|
Singleton {
|
||||||
|
id: root
|
||||||
|
readonly property string time: {
|
||||||
|
Qt.formatDateTime(clock.date, "hh:mm:ss ddd dd.MM.yyyy")
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
SystemClock {
|
||||||
id: dateProc
|
id: clock
|
||||||
command: ["date"]
|
precision: SystemClock.Seconds
|
||||||
running: true
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
onStreamFinished: root.time = this.text
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
|
||||||
intervall: 1000
|
|
||||||
running: true
|
|
||||||
repeat: true
|
|
||||||
onTriggered: dateProc.running = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user