Merge pull request #2990 from Cacodemon345/patch-116

qt_mcadevicelist: device IDs are always 4 hex digits long
This commit is contained in:
Miran Grča
2022-12-22 16:53:58 +01:00
committed by GitHub

View File

@@ -22,7 +22,7 @@ MCADeviceList::MCADeviceList(QWidget *parent)
for (int i = 0; i < mca_get_nr_cards(); i++) {
uint32_t deviceId = (mca_read_index(0x00, i) | (mca_read_index(0x01, i) << 8));
if (deviceId != 0xFFFF) {
QString hexRepresentation = QString::number(deviceId, 16).toUpper();
QString hexRepresentation = QString::asprintf("%04X", deviceId);
ui->listWidget->addItem(QString("Slot %1: 0x%2 (@%3.ADF)").arg(i + 1).arg(hexRepresentation, hexRepresentation));
}
}