fix to issue #165

This commit is contained in:
Oleksiy Nedobiychuk 2025-08-31 20:51:04 +02:00
parent 46ef2b6e53
commit 3151b1634c
3 changed files with 99 additions and 30 deletions

View file

@ -3,6 +3,7 @@ pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Bluetooth
import qs.Commons
Singleton {
id: root
@ -85,8 +86,23 @@ Singleton {
function canConnect(device) {
if (!device)
return false
/*
Paired
return !device.paired && !device.pairing && !device.blocked
Means youve successfully exchanged keys with the device.
The devices remember each other and can authenticate without repeating the pairing process.
Example: once your headphones are paired, you dont need to type a PIN every time.
Hence, instead of !device.paired, should be device.connected
*/
return !device.connected && !device.pairing && !device.blocked
}
function canDisconnect(device) {
if (!device)
return false
return device.connected && !device.pairing && !device.blocked
}
function getSignalStrength(device) {
@ -162,7 +178,6 @@ Singleton {
return
}
device.trusted = false
device.disconnect()
}