From 1dfcda39d39e22870feba6dbd8fc576e0535c94d Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Thu, 27 Jun 2024 22:53:29 -0400 Subject: [PATCH] kcms/wifi: Fix toggle not updating the first time Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/363 --- kcms/wifi/ui/main.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kcms/wifi/ui/main.qml b/kcms/wifi/ui/main.qml index 79a8fc57..df5e72d4 100644 --- a/kcms/wifi/ui/main.qml +++ b/kcms/wifi/ui/main.qml @@ -3,7 +3,7 @@ // SPDX-License-Identifier: LGPL-2.0-or-later import QtQuick -import QtQuick.Layouts +import QtQuick.Layouts import QtQuick.Controls as Controls import org.kde.plasma.networkmanagement as PlasmaNM @@ -86,7 +86,7 @@ SimpleKCM { id: wifiSwitch text: i18n("Wi-Fi") checked: enabledConnections.wirelessEnabled - onClicked: { + onCheckedChanged: { handler.enableWireless(checked); checked = Qt.binding(() => enabledConnections.wirelessEnabled); } @@ -119,11 +119,11 @@ SimpleKCM { model: mobileProxyModel delegate: ConnectionItemDelegate { editMode: root.editMode - + // connected or saved property bool shouldDisplay: (Uuid != "") || ConnectionState === PlasmaNM.Enums.Activated onShouldDisplayChanged: savedCard.updateCount() - + // separate property for visible since visible is false when the whole card is not visible visible: shouldDisplay } @@ -159,7 +159,7 @@ SimpleKCM { property bool shouldDisplay: !((Uuid != "") || ConnectionState === PlasmaNM.Enums.Activated) onShouldDisplayChanged: availableCard.updateCount() - + visible: shouldDisplay } }