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)
|
void ValidationError::setMessage(const QString &message)
|
||||||
{
|
{
|
||||||
|
if (m_message == message)
|
||||||
|
return;
|
||||||
|
|
||||||
m_message = message;
|
m_message = message;
|
||||||
|
|
||||||
if (m_label) {
|
if (!m_label)
|
||||||
if (message.isEmpty()) {
|
return;
|
||||||
clear();
|
|
||||||
} else {
|
if (message.isEmpty()) {
|
||||||
m_label->setStyleSheet(kStyleErrorActiveLabel);
|
clear();
|
||||||
m_label->setText(message);
|
} else {
|
||||||
}
|
m_label->setStyleSheet(kStyleErrorActiveLabel);
|
||||||
|
m_label->setText(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue