clang-format in src/qt

This commit is contained in:
Jasmine Iwanek
2025-10-03 22:42:29 -04:00
parent 10151c738d
commit ca424aed32
104 changed files with 3358 additions and 3294 deletions

View File

@@ -123,10 +123,10 @@ Harddrives::populateBusChannels(QAbstractItemModel *model, int bus, SettingsBusT
{
model->removeRows(0, model->rowCount());
int busRows = 0;
int shifter = 1;
int orer = 1;
int subChannelWidth = 1;
int busRows = 0;
int shifter = 1;
int orer = 1;
int subChannelWidth = 1;
QList<int> busesToCheck;
QList<int> channelsInUse;
switch (bus) {
@@ -160,15 +160,15 @@ Harddrives::populateBusChannels(QAbstractItemModel *model, int bus, SettingsBusT
busesToCheck.append(HDD_BUS_SCSI);
break;
case CDROM_BUS_MKE:
shifter = 2;
orer = 3;
busRows = 4;
shifter = 2;
orer = 3;
busRows = 4;
busesToCheck.append(CDROM_BUS_MKE);
break;
default:
break;
}
if(sbt != nullptr && !busesToCheck.empty()) {
if (sbt != nullptr && !busesToCheck.empty()) {
for (auto const &checkBus : busesToCheck) {
channelsInUse.append(sbt->busChannelsInUse(checkBus));
}
@@ -179,9 +179,9 @@ Harddrives::populateBusChannels(QAbstractItemModel *model, int bus, SettingsBusT
auto idx = model->index(i, 0);
model->setData(idx, QString("%1:%2").arg(i >> shifter).arg(i & orer, subChannelWidth, 10, QChar('0')));
model->setData(idx, ((i >> shifter) << shifter) | (i & orer), Qt::UserRole);
const auto *channelModel = qobject_cast<QStandardItemModel*>(model);
auto *channelItem = channelModel->item(i);
if(channelItem) {
const auto *channelModel = qobject_cast<QStandardItemModel *>(model);
auto *channelItem = channelModel->item(i);
if (channelItem) {
channelItem->setEnabled(!channelsInUse.contains(i));
}
}