From 3ca9dab083d06e02342b669bffee907003eb2642 Mon Sep 17 00:00:00 2001 From: Yari Polla Date: Thu, 19 Oct 2023 19:43:57 +0200 Subject: [PATCH] dataproviders: declare BluetoothInfo as Singleton --- components/mobileshell/mobileshellplugin.cpp | 2 +- .../mobileshell/qml/dataproviders/BluetoothInfo.qml | 2 ++ .../qml/statusbar/indicators/BluetoothIndicator.qml | 10 +++------- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/mobileshell/mobileshellplugin.cpp b/components/mobileshell/mobileshellplugin.cpp index 9476ed7a..377b1c2d 100644 --- a/components/mobileshell/mobileshellplugin.cpp +++ b/components/mobileshell/mobileshellplugin.cpp @@ -62,7 +62,7 @@ void MobileShellPlugin::registerTypes(const char *uri) // /dataproviders qmlRegisterSingletonType(resolvePath("dataproviders/AudioInfo.qml"), uri, 1, 0, "AudioInfo"); qmlRegisterSingletonType(resolvePath("dataproviders/BatteryInfo.qml"), uri, 1, 0, "BatteryInfo"); - qmlRegisterType(resolvePath("dataproviders/BluetoothInfo.qml"), uri, 1, 0, "BluetoothInfo"); + qmlRegisterSingletonType(resolvePath("dataproviders/BluetoothInfo.qml"), uri, 1, 0, "BluetoothInfo"); qmlRegisterType(resolvePath("dataproviders/SignalStrengthInfo.qml"), uri, 1, 0, "SignalStrengthInfo"); // /homescreen diff --git a/components/mobileshell/qml/dataproviders/BluetoothInfo.qml b/components/mobileshell/qml/dataproviders/BluetoothInfo.qml index 422230d1..48f1e40b 100644 --- a/components/mobileshell/qml/dataproviders/BluetoothInfo.qml +++ b/components/mobileshell/qml/dataproviders/BluetoothInfo.qml @@ -6,6 +6,8 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ +pragma Singleton + import QtQuick 2.2 import QtQuick.Layouts 1.4 import org.kde.bluezqt 1.0 as BluezQt diff --git a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml index 91f344da..2928c48a 100644 --- a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml @@ -10,16 +10,12 @@ import QtQuick import QtQuick.Layouts import org.kde.kirigami 2.20 as Kirigami -import org.kde.bluezqt as BluezQt - -import "../../dataproviders" as DataProviders +import org.kde.plasma.private.mobileshell 1.0 as MobileShell Kirigami.Icon { id: connectionIcon - readonly property var provider: DataProviders.BluetoothInfo {} + source: "network-bluetooth" - source: "network-bluetooth" // provider.icon - - visible: provider.isVisible + visible: MobileShell.BluetoothInfo.isVisible }