mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-13 00:42:49 -05:00
network: never allow rescans during update, more selective parsing from
gdbus monitor
This commit is contained in:
@@ -133,18 +133,30 @@ Singleton {
|
|||||||
command: lowPriorityCmd.concat(["gdbus", "monitor", "--system", "--dest", "org.freedesktop.NetworkManager"])
|
command: lowPriorityCmd.concat(["gdbus", "monitor", "--system", "--dest", "org.freedesktop.NetworkManager"])
|
||||||
running: false
|
running: false
|
||||||
|
|
||||||
|
property var lastRefreshTime: 0
|
||||||
|
property int minRefreshInterval: 1000
|
||||||
|
|
||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
splitMarker: "\n"
|
splitMarker: "\n"
|
||||||
onRead: line => {
|
onRead: line => {
|
||||||
if (line.includes("StateChanged") || line.includes("PrimaryConnectionChanged") || line.includes("WirelessEnabled") || line.includes("ActiveConnection")) {
|
const now = Date.now()
|
||||||
refreshNetworkState()
|
if (line.includes("PropertiesChanged") && line.includes("org.freedesktop.NetworkManager.AccessPoint")) {
|
||||||
} else if (line.includes("PropertiesChanged") && line.includes("org.freedesktop.NetworkManager.AccessPoint") && line.includes("'Strength'")) {
|
if (line.includes("'Strength'") && root.activeAccessPointPath && line.includes(root.activeAccessPointPath)) {
|
||||||
if (root.activeAccessPointPath && line.includes(root.activeAccessPointPath)) {
|
parseSignalStrengthFromDbus(line)
|
||||||
parseSignalStrengthFromDbus(line)
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line.includes("StateChanged") ||
|
||||||
|
line.includes("PrimaryConnectionChanged") ||
|
||||||
|
line.includes("WirelessEnabled") ||
|
||||||
|
(line.includes("ActiveConnection") && line.includes("State"))) {
|
||||||
|
|
||||||
|
if (now - nmStateMonitor.lastRefreshTime > nmStateMonitor.minRefreshInterval) {
|
||||||
|
nmStateMonitor.lastRefreshTime = now
|
||||||
|
refreshNetworkState()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (line.includes("PropertiesChanged") && !line.includes("AccessPoint") && !line.includes("LastSeen")) {
|
|
||||||
refreshNetworkState()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,7 +415,6 @@ Singleton {
|
|||||||
getWifiIP.running = true
|
getWifiIP.running = true
|
||||||
getCurrentWifiInfo.running = true
|
getCurrentWifiInfo.running = true
|
||||||
getActiveAccessPoint.running = true
|
getActiveAccessPoint.running = true
|
||||||
// Ensure SSID is resolved even if scan output lacks ACTIVE marker
|
|
||||||
if (root.currentWifiSSID === "") {
|
if (root.currentWifiSSID === "") {
|
||||||
if (root.wifiConnectionUuid) {
|
if (root.wifiConnectionUuid) {
|
||||||
resolveWifiSSID.running = true
|
resolveWifiSSID.running = true
|
||||||
@@ -456,7 +467,7 @@ Singleton {
|
|||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: getCurrentWifiInfo
|
id: getCurrentWifiInfo
|
||||||
command: root.wifiInterface ? lowPriorityCmd.concat(["nmcli", "-t", "-f", "IN-USE,SIGNAL,SSID", "device", "wifi", "list", "ifname", root.wifiInterface]) : []
|
command: root.wifiInterface ? lowPriorityCmd.concat(["nmcli", "-t", "-f", "IN-USE,SIGNAL,SSID", "device", "wifi", "list", "ifname", root.wifiInterface, "--rescan", "no"]) : []
|
||||||
running: false
|
running: false
|
||||||
|
|
||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
|
|||||||
Reference in New Issue
Block a user