Display detailed device names in the TDE hardware manager

This relates to Bug 1666
pull/2/head
Timothy Pearson 11 years ago
parent 8b103159ba
commit 6b07b19b83

@ -144,7 +144,7 @@ void TDEHWManager::populateTreeView()
TDEGenericHardwareList hwlist = hwdevices->listByDeviceClass(TDEGenericDeviceType::RootSystem); TDEGenericHardwareList hwlist = hwdevices->listByDeviceClass(TDEGenericDeviceType::RootSystem);
TDEGenericDevice *hwdevice; TDEGenericDevice *hwdevice;
for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) { for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) {
DeviceIconItem* item = new DeviceIconItem(base->deviceTree, hwdevice->friendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice); DeviceIconItem* item = new DeviceIconItem(base->deviceTree, hwdevice->detailedFriendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice);
if ((!selected_syspath.isNull()) && (hwdevice->systemPath() == selected_syspath)) { if ((!selected_syspath.isNull()) && (hwdevice->systemPath() == selected_syspath)) {
base->deviceTree->ensureItemVisible(item); base->deviceTree->ensureItemVisible(item);
base->deviceTree->setSelected(item, true); base->deviceTree->setSelected(item, true);
@ -160,7 +160,7 @@ void TDEHWManager::populateTreeView()
TDEGenericDevice *hwdevice; TDEGenericDevice *hwdevice;
TDEGenericHardwareList hwlist = hwdevices->listByDeviceClass((TDEGenericDeviceType::TDEGenericDeviceType)i); TDEGenericHardwareList hwlist = hwdevices->listByDeviceClass((TDEGenericDeviceType::TDEGenericDeviceType)i);
for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) { for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) {
DeviceIconItem* item = new DeviceIconItem(rootitem, hwdevice->friendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice); DeviceIconItem* item = new DeviceIconItem(rootitem, hwdevice->detailedFriendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice);
if ((!selected_syspath.isNull()) && (hwdevice->systemPath() == selected_syspath)) { if ((!selected_syspath.isNull()) && (hwdevice->systemPath() == selected_syspath)) {
base->deviceTree->ensureItemVisible(item); base->deviceTree->ensureItemVisible(item);
base->deviceTree->setSelected(item, true); base->deviceTree->setSelected(item, true);
@ -178,7 +178,7 @@ void TDEHWManager::populateTreeViewLeaf(DeviceIconItem *parent, bool show_by_con
TDEGenericDevice *hwdevice; TDEGenericDevice *hwdevice;
for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) { for ( hwdevice = hwlist.first(); hwdevice; hwdevice = hwlist.next() ) {
if (hwdevice->parentDevice() == parent->device()) { if (hwdevice->parentDevice() == parent->device()) {
DeviceIconItem* item = new DeviceIconItem(parent, hwdevice->friendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice); DeviceIconItem* item = new DeviceIconItem(parent, hwdevice->detailedFriendlyName(), hwdevice->icon(base->deviceTree->iconSize()), hwdevice);
if ((!selected_syspath.isNull()) && (hwdevice->systemPath() == selected_syspath)) { if ((!selected_syspath.isNull()) && (hwdevice->systemPath() == selected_syspath)) {
base->deviceTree->ensureItemVisible(item); base->deviceTree->ensureItemVisible(item);
base->deviceTree->setSelected(item, true); base->deviceTree->setSelected(item, true);
@ -197,8 +197,8 @@ void TDEHWManager::deviceChanged(TDEGenericDevice* device) {
TDEGenericDevice* candidate = item->device(); TDEGenericDevice* candidate = item->device();
if (candidate) { if (candidate) {
if (candidate->systemPath() == device->systemPath()) { if (candidate->systemPath() == device->systemPath()) {
if (item->text(0) != device->friendlyName()) { if (item->text(0) != device->detailedFriendlyName()) {
item->setText(0, device->friendlyName()); item->setText(0, device->detailedFriendlyName());
} }
} }
} }

Loading…
Cancel
Save