diff --git a/applet/contents/ui/DeviceListItem.qml b/applet/contents/ui/DeviceListItem.qml --- a/applet/contents/ui/DeviceListItem.qml +++ b/applet/contents/ui/DeviceListItem.qml @@ -29,28 +29,17 @@ readonly property var currentActivePortIndex: ActivePortIndex readonly property var currentMuted: Muted readonly property var activePortIndex: ActivePortIndex + property bool onlyone: false draggable: false label: { - if (currentPort && currentPort.description) { - var model = type === "sink" ? paSinkModel : paSourceModel; - var itemLength = currentPort.description.length; - for (var i = 0; i < model.rowCount(); i++) { - if (i !== index) { - var port = model.data(model.index(i, 0), model.role("Ports")) - [model.data(model.index(i, 0), model.role("ActivePortIndex"))]; - if (port && port.description) { - var length = Math.min(itemLength, port.description.length) - if (currentPort.description.substring(0, length) === port.description.substring(0, length)) { - return i18nc("label of device items", "%1 (%2)", currentPort.description, Description); - } - } - } + if (currentPort) { + if (onlyone) { + return currentPort.description; } - return currentPort.description; - } else { - return Description; + return i18nc("label of device items", "%1 (%2)", currentPort.description, Description); } + return Description; } onCurrentActivePortIndexChanged: { diff --git a/applet/contents/ui/main.qml b/applet/contents/ui/main.qml --- a/applet/contents/ui/main.qml +++ b/applet/contents/ui/main.qml @@ -434,7 +434,6 @@ id: streamsView spacing: 0 visible: tabBar.currentTab == streamsTab - readonly property bool simpleMode: (sinkInputView.count >= 1 && sourceOutputView.count == 0) || (sinkInputView.count == 0 && sourceOutputView.count >= 1) property int maximumWidth: scrollView.viewport.width width: maximumWidth Layout.maximumWidth: maximumWidth @@ -490,7 +489,6 @@ ColumnLayout { id: devicesView visible: tabBar.currentTab == devicesTab - readonly property bool simpleMode: sinkView.count == 1 && sourceView.count == 1 property int maximumWidth: scrollView.viewport.width width: maximumWidth Layout.maximumWidth: maximumWidth @@ -522,6 +520,7 @@ boundsBehavior: Flickable.StopAtBounds; delegate: DeviceListItem { type: "sink" + onlyone: sinkView.count === 1 } } @@ -551,6 +550,7 @@ boundsBehavior: Flickable.StopAtBounds; delegate: DeviceListItem { type: "source" + onlyone: sourceView.count === 1 } } }