Skip to content

Commit

Permalink
Cleanup: removing more ultimately unused vars for unnecessary combobo…
Browse files Browse the repository at this point in the history
…x checks
  • Loading branch information
SeongGino committed Sep 5, 2024
1 parent f51e9ec commit a1d2f57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
16 changes: 6 additions & 10 deletions guiwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ void guiWindow::SerialLoad()
rightOffset[i]->setText(buffer[3]), profilesTable[i].rightOffset = buffer[3].toInt(), profilesTable_orig[i].rightOffset = profilesTable[i].rightOffset;
TLled[i]->setText(buffer[4]), profilesTable[i].TLled = buffer[4].toFloat(), profilesTable_orig[i].TLled = profilesTable[i].TLled;
TRled[i]->setText(buffer[5]), profilesTable[i].TRled = buffer[5].toFloat(), profilesTable_orig[i].TRled = profilesTable[i].TRled;
profilesTable[i].irSensitivity = buffer[6].toInt(), profilesTable_orig[i].irSensitivity = profilesTable[i].irSensitivity, irSens[i]->setCurrentIndex(profilesTable[i].irSensitivity), irSensOldIndex[i] = profilesTable[i].irSensitivity;
profilesTable[i].runMode = buffer[7].toInt(), profilesTable_orig[i].runMode = profilesTable[i].runMode, runMode[i]->setCurrentIndex(profilesTable[i].runMode), runModeOldIndex[i] = profilesTable[i].runMode;
profilesTable[i].irSensitivity = buffer[6].toInt(), profilesTable_orig[i].irSensitivity = profilesTable[i].irSensitivity, irSens[i]->setCurrentIndex(profilesTable[i].irSensitivity);
profilesTable[i].runMode = buffer[7].toInt(), profilesTable_orig[i].runMode = profilesTable[i].runMode, runMode[i]->setCurrentIndex(profilesTable[i].runMode);
layoutMode[i]->setCurrentIndex(buffer[8].toInt()), profilesTable[i].layoutType = buffer[8].toInt(), profilesTable_orig[i].layoutType = profilesTable[i].layoutType;
color[i]->setStyleSheet(QString("background-color: #%1").arg(buffer[9].toLong(), 6, 16, QLatin1Char('0'))), profilesTable[i].color = buffer[9].toLong(), profilesTable_orig[i].color = profilesTable[i].color;
selectedProfile[i]->setText(buffer[10]), profilesTable[i].profName = buffer[10], profilesTable_orig[i].profName = profilesTable[i].profName;
Expand Down Expand Up @@ -1606,10 +1606,8 @@ void guiWindow::irBoxes_activated(int index)
}
}

if(index != irSensOldIndex[slot]) {
profilesTable[slot].irSensitivity = index;
}
irSensOldIndex[slot] = index;
profilesTable[slot].irSensitivity = index;

DiffUpdate();
}

Expand All @@ -1626,10 +1624,8 @@ void guiWindow::runModeBoxes_activated(int index)
}
}

if(index != runModeOldIndex[slot]) {
profilesTable[slot].runMode = index;
}
runModeOldIndex[slot] = index;
profilesTable[slot].runMode = index;

DiffUpdate();
}

Expand Down
8 changes: 2 additions & 6 deletions guiwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,12 @@ private slots:
uint8_t tempWarning = 35;
uint8_t tempShutoff = 42;

// Indexed array map of the current physical layout of the board.
// Indexed array map of the current physical layout of the board;
// Also doubles as combobox sanity check.
// Key = pin number, Value = pin function
// Values: -2 = N/A, -1 = reserved, 0 = available, unused
QMap<uint8_t, int8_t> currentPins;

// Uses the same logic as pinBoxesOldIndex, since the irSensor and runMode comboboxes
// are hooked to a single signal.
uint8_t irSensOldIndex[4];
uint8_t runModeOldIndex[4];

bool testMode = false;

// for timer
Expand Down

0 comments on commit a1d2f57

Please sign in to comment.