dataproviders: declare BluetoothInfo as Singleton

This commit is contained in:
Yari Polla 2023-10-19 19:43:57 +02:00
parent 72657628b6
commit 3ca9dab083
3 changed files with 6 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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
}