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