refactor: LineEditValidator only call errorMessage::isEmpty once

This commit is contained in:
sithlord48
2025-12-27 11:32:42 -05:00
committed by Nick Bolton
parent 530bcad8a6
commit 9976caafab

View File

@ -40,7 +40,9 @@ QValidator::State LineEditValidator::validate(QString &input, int &) const
}
}
if (errorMessage.isEmpty()) {
const bool isEmpty = errorMessage.isEmpty();
if (isEmpty) {
m_pLineEdit->setStyleSheet({});
} else { // The values here are for fusion style
int radius = 3;
@ -70,7 +72,7 @@ QValidator::State LineEditValidator::validate(QString &input, int &) const
m_pError->setMessage(errorMessage);
}
return errorMessage.isEmpty() ? Acceptable : Intermediate;
return isEmpty ? Acceptable : Intermediate;
}
} // namespace validators