Without this change, it's almost impossible to edit the topic with the
topic widget in busy channels because every message would trigger the
dataChanged signal which would reset the topic and switch the topic
widget out of editing mode.
Fixes #1485.
}
}
- _topic = sanitizeTopic(newtopic);
- _readonly = readonly;
-
- ui.topicEditButton->setVisible(!_readonly);
- ui.topicLabel->setText(_topic);
- ui.topicLineEdit->setPlainText(_topic);
- switchPlain();
+ QString sanitizedNewTopic = sanitizeTopic(newtopic);
+ if (readonly != _readonly || sanitizedNewTopic != _topic)
+ {
+ _topic = sanitizedNewTopic;
+ _readonly = readonly;
+
+ ui.topicEditButton->setVisible(!_readonly);
+ ui.topicLabel->setText(_topic);
+ ui.topicLineEdit->setPlainText(_topic);
+ switchPlain();
+ }
}
void TopicWidget::setReadOnly(const bool& readonly)