fix: the name of sound device shouldn't be edited (#880)

We can edit the name of sound device in the dock, it should not
be happened. Just set the item uneditable.

Log:

Co-authored-by: kamiyadm <chenhuixing@deepin.org>
This commit is contained in:
kamiyadm 2023-07-05 10:28:18 +08:00 committed by GitHub
parent fb3f888157
commit 101dec15ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,6 +268,7 @@ void SoundDevicesWidget::addPort(const SoundDevicePort *port)
// TODO: get right icon
portItem->setIcon(QIcon());
portItem->setText(deviceName);
portItem->setEditable(false);
portItem->setFlags(portItem->flags() & ~Qt::ItemIsSelectable);
portItem->setTextColorRole(QPalette::BrightText);
portItem->setData(QVariant::fromValue<const SoundDevicePort *>(port), DeviceObjRole);