https://bugs.kde.org/show_bug.cgi?id=488447

--- Comment #7 from Vladimir Solomatin <proge...@yandex.ru> ---
(Disclaimer: I do not know anything about neither QML, nor Plasma Applet
internals)

I tried to debug things myself, and the preliminary results were pretty weird
(like, the `if` branch taken in `text` was seemingly not the same as `if`
branch taken in `helpfulAction`), but after some time bug has suddenly
disappeared by itself for me too, and I was unable to complete the debugging
process.
But, for little I was able to gather before bug has stopped reproducing, it
seems to me that the bug somewhere in the QML handling side of things rather
than in the QML markup of the applet itself.

I applied your patch, and also added extensive (I hope so) `console.log()`
coverage for later:
```qml
                    text: {
                        // We cannot use the adapter count here because that
can be zero when
                        // bluetooth is disabled even when there are physical
devices
                        console.log("!!! text, btManager =", btManager);
                        console.log("!!! text, root =", root);
                        console.log("!!! text, BluezQt.Manager =",
BluezQt.Manager);
                        console.log("!!! text, BluezQt.Manager.rfkill =",
BluezQt.Manager.rfkill);
                        if (BluezQt.Manager.rfkill.state ===
BluezQt.Rfkill.Unknown) {
                            console.log("!!! text 1, rfkill.state =",
BluezQt.Manager.rfkill.state);
                            return i18n("No Bluetooth adapters available");
                        } else if (btManager.bluetoothBlocked) {
                            console.log("!!! text 2, btManager.bluetoothBlocked
=", btManager.bluetoothBlocked);
                            return i18n("Bluetooth is disabled");
                        } else if (root.emptyList) {
                            console.log("!!! text 3, root.emptyList =",
root.emptyList);
                            return i18n("No devices found");
                        } else {
                            console.log("!!! text 4");
                            return "";
                        }
                    }

                    helpfulAction: {
                        console.log("!!! button, btManager =", btManager);
                        console.log("!!! button, root =", root);
                        console.log("!!! button, BluezQt.Manager =",
BluezQt.Manager);
                        console.log("!!! button, BluezQt.Manager.rfkill =",
BluezQt.Manager.rfkill);
                        if (BluezQt.Manager.rfkill.state ===
BluezQt.Rfkill.Unknown) {
                            console.log("!!! button 1, rfkill.state =",
BluezQt.Manager.rfkill.state);
                            return null;
                        } else if (btManager.bluetoothBlocked) {
                            console.log("!!! button 2,
btManager.bluetoothBlocked =", btManager.bluetoothBlocked);
                            return enableBluetoothAction;
                        } else if (root.emptyList) {
                            console.log("!!! button 3, root.emptyList =",
root.emptyList);
                            return addBluetoothDeviceAction;
                        } else {
                            console.log("!!! button 4");
                            return null;
                        }
                    }
```
I will try to continue to look into it when the bug will be back again.

Thank you!

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to