Warning, /plasma/plasma-mobile/components/mobileshell/qml/volumeosd/DeviceListItem.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org> 0003 SPDX-FileCopyrightText: 2021 Devin Lin <espidev@gmail.com> 0004 0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 import QtQuick 2.0 0009 0010 import org.kde.plasma.private.volume 0.1 0011 0012 // adapted from https://invent.kde.org/plasma/plasma-pa/-/blob/master/applet/contents/ui/DeviceListItem.qml 0013 ListItemBase { 0014 readonly property var currentPort: Ports[ActivePortIndex] 0015 readonly property var currentActivePortIndex: ActivePortIndex 0016 readonly property var currentMuted: Muted 0017 readonly property var activePortIndex: ActivePortIndex 0018 property bool onlyone: false 0019 0020 label: { 0021 if (currentPort && currentPort.description) { 0022 if (onlyone || !Description) { 0023 return currentPort.description; 0024 } else { 0025 return i18nc("label of device items", "%1 (%2)", currentPort.description, Description); 0026 } 0027 } 0028 if (Description) { 0029 return Description; 0030 } 0031 if (Name) { 0032 return Name; 0033 } 0034 return i18n("Device name not found"); 0035 } 0036 }