improve some process handling

This commit is contained in:
notiant
2026-03-26 19:30:41 +01:00
committed by GitHub
parent 78c0b2fe25
commit dffdfcffc4
2 changed files with 10 additions and 20 deletions
-10
View File
@@ -80,16 +80,6 @@ Singleton {
} }
} }
// Re-run polling once bluetoothctl availability is known
Connections {
target: ProgramCheckerService
function onBluetoothctlAvailableChanged() {
if (ProgramCheckerService.bluetoothctlAvailable) {
ctlPollTimer.restart();
}
}
}
// Track adapter state changes // Track adapter state changes
Connections { Connections {
target: adapter target: adapter
+10 -10
View File
@@ -106,8 +106,8 @@ Singleton {
target: Time target: Time
function onResumed() { function onResumed() {
Logger.i("Network", "System resumed - forcing state poll"); Logger.i("Network", "System resumed - forcing state poll");
deviceStatusProcess.running = true; deviceStatusProcess.restart();
connectivityCheckProcess.running = true; connectivityCheckProcess.restart();
} }
} }
@@ -156,8 +156,8 @@ Singleton {
if (root.airplaneModeToggled) { if (root.airplaneModeToggled) {
root.airplaneModeToggled = false; root.airplaneModeToggled = false;
if (root.wifiEnabled) { if (root.wifiEnabled) {
connectivityCheckProcess.running = true; connectivityCheckProcess.restart();
deviceStatusProcess.running = true; deviceStatusProcess.restart();
scan(); scan();
} else { } else {
root.networks = ({}); root.networks = ({});
@@ -178,14 +178,15 @@ Singleton {
root.airplaneModeEnabled = false; root.airplaneModeEnabled = false;
ToastService.showNotice(I18n.tr("toast.airplane-mode.title"), I18n.tr("common.disabled"), "plane-off"); ToastService.showNotice(I18n.tr("toast.airplane-mode.title"), I18n.tr("common.disabled"), "plane-off");
Logger.i("AirplaneMode", "Disabled"); Logger.i("AirplaneMode", "Disabled");
connectivityCheckProcess.restart();
deviceStatusProcess.restart(); deviceStatusProcess.restart();
scan(); scan();
return; return;
} }
if (root.wifiEnabled) { if (root.wifiEnabled) {
ToastService.showNotice(I18n.tr("common.wifi"), I18n.tr("common.enabled"), "wifi"); ToastService.showNotice(I18n.tr("common.wifi"), I18n.tr("common.enabled"), "wifi");
connectivityCheckProcess.running = true; connectivityCheckProcess.restart();
deviceStatusProcess.running = true; deviceStatusProcess.restart();
scan(); scan();
} else { } else {
ToastService.showNotice(I18n.tr("common.wifi"), I18n.tr("common.disabled"), "wifi-off"); ToastService.showNotice(I18n.tr("common.wifi"), I18n.tr("common.disabled"), "wifi-off");
@@ -224,7 +225,6 @@ Singleton {
Quickshell.execDetached(["rfkill", "block", "all"]); Quickshell.execDetached(["rfkill", "block", "all"]);
} else { } else {
Quickshell.execDetached(["rfkill", "unblock", "all"]); Quickshell.execDetached(["rfkill", "unblock", "all"]);
} }
} }
@@ -307,7 +307,7 @@ Singleton {
} }
if (wifiConnected && activeWifiIf) { if (wifiConnected && activeWifiIf) {
wifiDetailsLoading = true; wifiDetailsLoading = true;
deviceStatusProcess.running = true; deviceStatusProcess.restart();
} }
} }
@@ -319,7 +319,7 @@ Singleton {
} }
if (ethernetConnected && activeEthernetIf) { if (ethernetConnected && activeEthernetIf) {
ethernetDetailsLoading = true; ethernetDetailsLoading = true;
deviceStatusProcess.running = true; deviceStatusProcess.restart();
} }
} }
@@ -1165,7 +1165,7 @@ Singleton {
onRead: data => { onRead: data => {
if (data.endsWith(": connected") || data.endsWith(": disconnected")) { if (data.endsWith(": connected") || data.endsWith(": disconnected")) {
Logger.d("Network", "State changed: " + data); Logger.d("Network", "State changed: " + data);
deviceStatusProcess.running = true; deviceStatusProcess.restart();
} }
} }
} }