clipboard: prevent restart spin loop of watchers. Fix #1954

This commit is contained in:
Lemmy
2026-02-24 09:09:17 -05:00
parent f7c156a509
commit c13db3635c
+24 -8
View File
@@ -251,27 +251,43 @@ Singleton {
id: watchText
stdout: StdioCollector {}
onExited: (exitCode, exitStatus) => {
if (root.autoWatch && root.watchersStarted) {
Qt.callLater(() => {
watchText.running = true;
});
if (root.autoWatch && root.watchersStarted && Settings.data.appLauncher.clipboardWatchTextCommand.trim() !== "") {
watchTextRestartTimer.restart();
}
}
}
Timer {
id: watchTextRestartTimer
interval: 1000
repeat: false
onTriggered: {
if (root.autoWatch && root.watchersStarted)
watchText.running = true;
}
}
// Image watcher
Process {
id: watchImage
stdout: StdioCollector {}
onExited: (exitCode, exitStatus) => {
if (root.autoWatch && root.watchersStarted) {
Qt.callLater(() => {
watchImage.running = true;
});
if (root.autoWatch && root.watchersStarted && Settings.data.appLauncher.clipboardWatchImageCommand.trim() !== "") {
watchImageRestartTimer.restart();
}
}
}
Timer {
id: watchImageRestartTimer
interval: 1000
repeat: false
onTriggered: {
if (root.autoWatch && root.watchersStarted)
watchImage.running = true;
}
}
// Capture current clipboard text when needed
Process {
id: captureTextProc