From e247f8d2e4d922e258b8999e6ae8467d6da9a730 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Sep 2016 17:45:54 -0500 Subject: Fix display of unknown attributes in device manager details dialog (cherry picked from commit 3c8aaa46e757646f1971bc294a5a41a87ec25720) --- kcontrol/hwmanager/devicepropsdlg.cpp | 26 +++++++++++++++----------- kcontrol/hwmanager/devicepropsdlgbase.ui | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'kcontrol') diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index aaa859c33..f64f35835 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -341,17 +341,21 @@ TQString assembleSwitchList(TDESwitchType::TDESwitchType switches) { return (TDEEventDevice::friendlySwitchList(switches).join("
")); } +static TQString formatDisplayString(TQString input) { + return TQStyleSheet::escape(input); +} + void DevicePropertiesDialog::populateDeviceInformation() { if (m_device) { base->labelDeviceType->setText(m_device->friendlyDeviceType()); base->iconDeviceType->setPixmap(m_device->icon(TDEIcon::SizeSmall)); - base->labelDeviceName->setText(m_device->friendlyName()); - base->labelDeviceNode->setText((m_device->deviceNode().isNull())?i18n(""):m_device->deviceNode()); - base->labelSystemPath->setText(m_device->systemPath()); - base->labelSubsytemType->setText(m_device->subsystem()); - base->labelDeviceDriver->setText((m_device->deviceDriver().isNull())?i18n(""):m_device->deviceDriver()); - base->labelDeviceClass->setText((m_device->PCIClass().isNull())?i18n(""):m_device->PCIClass()); - base->labelModalias->setText((m_device->moduleAlias().isNull())?i18n(""):m_device->moduleAlias()); + base->labelDeviceName->setText(formatDisplayString(m_device->friendlyName())); + base->labelDeviceNode->setText(formatDisplayString((m_device->deviceNode().isNull())?i18n(""):m_device->deviceNode())); + base->labelSystemPath->setText(formatDisplayString(m_device->systemPath())); + base->labelSubsytemType->setText(formatDisplayString(m_device->subsystem())); + base->labelDeviceDriver->setText(formatDisplayString((m_device->deviceDriver().isNull())?i18n(""):m_device->deviceDriver())); + base->labelDeviceClass->setText(formatDisplayString((m_device->PCIClass().isNull())?i18n(""):m_device->PCIClass())); + base->labelModalias->setText(formatDisplayString((m_device->moduleAlias().isNull())?i18n(""):m_device->moduleAlias())); // These might be redundant #if 0 @@ -363,7 +367,7 @@ void DevicePropertiesDialog::populateDeviceInformation() { base->labelVendorModel->hide(); base->stocklabelVendorModel->hide(); #endif - base->labelSerialNumber->setText((m_device->serialNumber().isNull())?i18n(""):m_device->serialNumber()); + base->labelSerialNumber->setText(formatDisplayString((m_device->serialNumber().isNull())?i18n(""):m_device->serialNumber())); if (m_device->subsystem() == "pci") { base->labelBusID->setText(m_device->busID()); @@ -380,15 +384,15 @@ void DevicePropertiesDialog::populateDeviceInformation() { TQString mountPoint = sdevice->mountPath(); if (mountPoint == "") mountPoint = i18n(""); - base->labelDiskMountpoint->setText(mountPoint); + base->labelDiskMountpoint->setText(formatDisplayString(mountPoint)); TQString fsName = sdevice->fileSystemName(); if (fsName == "") fsName = i18n(""); - base->labelDiskFileSystemType->setText(fsName); + base->labelDiskFileSystemType->setText(formatDisplayString(fsName)); TQString volUUID = sdevice->diskUUID(); if (volUUID == "") volUUID = i18n(""); - base->labelDiskUUID->setText(volUUID); + base->labelDiskUUID->setText(formatDisplayString(volUUID)); // Show status TQString status_text = ""; diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui index 6d31c759e..7cfe80b68 100644 --- a/kcontrol/hwmanager/devicepropsdlgbase.ui +++ b/kcontrol/hwmanager/devicepropsdlgbase.ui @@ -50,7 +50,7 @@ iconDeviceType - + labelDeviceType -- cgit v1.2.1