X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fqtui%2Ftopicwidget.cpp;h=336b902d128a8f4eb7bd4ede1d3496613798756c;hb=4e51500401db3c85dbe5e92e5e5c15b6e3c87787;hp=ff3ce650685f8f15ac6e46f6a93385fbb8b839be;hpb=cc6e7c08709c4e761e2fd9c2e322751015497003;p=quassel.git diff --git a/src/qtui/topicwidget.cpp b/src/qtui/topicwidget.cpp index ff3ce650..336b902d 100644 --- a/src/qtui/topicwidget.cpp +++ b/src/qtui/topicwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * 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 * @@ -152,13 +152,17 @@ void TopicWidget::setTopic(const QModelIndex& index) } } - _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)