This commit is contained in:
Nav
2022-01-16 18:54:58 +00:00
parent b9d05e03eb
commit ae00ed8013
6 changed files with 19 additions and 18 deletions

View File

@@ -54,7 +54,7 @@ RegisterGroupWidget::RegisterGroupWidget(
bodyLayout->setContentsMargins(0, 0,0,0);
bodyLayout->setSpacing(0);
for (auto& descriptor : registerDescriptors) {
for (const auto& descriptor : registerDescriptors) {
if (!descriptor.name.has_value()) {
continue;
}
@@ -117,14 +117,14 @@ void RegisterGroupWidget::expand() {
}
void RegisterGroupWidget::setAllRegistersVisible(bool visible) {
for (auto& registerWidget : this->registerWidgets) {
for (const auto& registerWidget : this->registerWidgets) {
registerWidget->setVisible(visible);
}
}
void RegisterGroupWidget::filterRegisters(const std::string& keyword) {
int matchingWidgetCount = 0;
for (auto& registerWidget : this->registerWidgets) {
for (const auto& registerWidget : this->registerWidgets) {
if (keyword.empty()
|| (registerWidget->descriptor.name.value().find(keyword) != std::string::npos)
) {

View File

@@ -126,7 +126,7 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget(
void TargetRegistersPaneWidget::filterRegisters(const QString& keyword) {
auto stdKeyword = keyword.toLower().toStdString();
for (auto& registerGroupWidget : this->registerGroupWidgets) {
for (const auto& registerGroupWidget : this->registerGroupWidgets) {
// If the group name matches the keyword, then don't bother iterating through all the register widgets
if (keyword.isEmpty() || registerGroupWidget->name.contains(keyword, Qt::CaseInsensitive)) {
registerGroupWidget->setVisible(true);