Commit 830bded4 authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham

[Applet]Always get valid device and stream name

Summary: Added more checks and an error message.

Reviewers: #plasma, drosca, ngraham, #vdg

Reviewed By: ngraham, #vdg

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27205
parent e8779cf4
......@@ -33,13 +33,20 @@ ListItemBase {
draggable: false
label: {
if (currentPort) {
if (onlyone) {
if (currentPort && currentPort.description) {
if (onlyone || !Description) {
return currentPort.description;
} else {
return i18nc("label of device items", "%1 (%2)", currentPort.description, Description);
}
return i18nc("label of device items", "%1 (%2)", currentPort.description, Description);
}
return Description;
if (Description) {
return Description;
}
if (Name) {
return Name;
}
return i18n("Device name not found");
}
onCurrentActivePortIndexChanged: {
......
......@@ -134,7 +134,7 @@ PlasmaComponents.ListItem {
Item {
Layout.fillWidth: true
visible: contextMenuButton.visble
visible: contextMenuButton.visible
}
SmallToolButton {
......
......@@ -25,7 +25,16 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.private.volume 0.1
ListItemBase {
label: Client ? Client.name : Name
label: {
if (Client && Client.name) {
return Client.name;
}
if (Name) {
return Name;
}
return i18n("Stream name not found");
}
icon: IconName
iconUsesPlasmaTheme: false
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment