/***************************************************************************
- * Copyright (C) 2005-2019 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
}
}
- _topic = sanitizeTopic(newtopic);
- _readonly = readonly;
+ 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();
+ ui.topicEditButton->setVisible(!_readonly);
+ ui.topicLabel->setText(_topic);
+ ui.topicLineEdit->setPlainText(_topic);
+ switchPlain();
+ }
}
void TopicWidget::setReadOnly(const bool& readonly)