shift-shell/components/mobileshell/qml/dataproviders/NetworkInfo.qml
Devin Lin ee1a311af7 components/mobileshell: Introduce singleton for plasma-nm lib
We currently create several instances of the plasma-nm objects over the shell. Use a single singleton to avoid having to load it multiple times.
2025-04-25 14:58:18 -04:00

15 lines
No EOL
468 B
QML

// SPDX-FileCopyrightText: 2025 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
pragma Singleton
import QtQuick
import org.kde.plasma.networkmanagement as PlasmaNM
QtObject {
// Initialization of PlasmaNM.Handler is quite heavy, initialize it once for the shell as a singleton.
readonly property PlasmaNM.Handler handler: PlasmaNM.Handler {}
readonly property PlasmaNM.WirelessStatus wirelessStatus: PlasmaNM.WirelessStatus {}
}