refactor: validatorError::setMessage return early
This commit is contained in:
parent
6851046c5a
commit
ccd40c2927
1 changed files with 11 additions and 7 deletions
|
|
@ -25,15 +25,19 @@ const QString &ValidationError::message() const
|
|||
|
||||
void ValidationError::setMessage(const QString &message)
|
||||
{
|
||||
if (m_message == message)
|
||||
return;
|
||||
|
||||
m_message = message;
|
||||
|
||||
if (m_label) {
|
||||
if (message.isEmpty()) {
|
||||
clear();
|
||||
} else {
|
||||
m_label->setStyleSheet(kStyleErrorActiveLabel);
|
||||
m_label->setText(message);
|
||||
}
|
||||
if (!m_label)
|
||||
return;
|
||||
|
||||
if (message.isEmpty()) {
|
||||
clear();
|
||||
} else {
|
||||
m_label->setStyleSheet(kStyleErrorActiveLabel);
|
||||
m_label->setText(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue