updates now checks helper
This commit is contained in:
+26
-2
@@ -10,6 +10,7 @@ Singleton {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int availableUpdates: 0
|
property int availableUpdates: 0
|
||||||
|
property bool commandReady
|
||||||
property bool loaded
|
property bool loaded
|
||||||
property double now: Date.now()
|
property double now: Date.now()
|
||||||
property var updates: ({})
|
property var updates: ({})
|
||||||
@@ -46,7 +47,7 @@ Singleton {
|
|||||||
running: true
|
running: true
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (!root.loaded)
|
if (!root.loaded || !root.commandReady)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updatesProc.running = true;
|
updatesProc.running = true;
|
||||||
@@ -62,10 +63,33 @@ Singleton {
|
|||||||
onTriggered: root.now = Date.now()
|
onTriggered: root.now = Date.now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: cmdDetect
|
||||||
|
|
||||||
|
command: ["sh", "-c", "command -v yay || command -v paru"]
|
||||||
|
running: true
|
||||||
|
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
const cmd = this.text.trim();
|
||||||
|
let helper;
|
||||||
|
|
||||||
|
if (cmd.length > 0) {
|
||||||
|
helper = cmd.split("/").pop();
|
||||||
|
} else {
|
||||||
|
helper = "pacman";
|
||||||
|
}
|
||||||
|
|
||||||
|
updatesProc.command = [helper, "-Qu"];
|
||||||
|
root.commandReady = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: updatesProc
|
id: updatesProc
|
||||||
|
|
||||||
command: ["checkupdates"]
|
command: []
|
||||||
running: false
|
running: false
|
||||||
|
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
|
|||||||
Reference in New Issue
Block a user