- _updating_name_widget = true;
- _name_widget->setEditText(name);
- _updating_name_widget = false;
+
+ if (name != name_widget_->currentText())
+ name_widget_->setEditText(name);
+
+ // Store the channel name in sigrok::Channel so that it
+ // will end up in the .sr file upon save.
+ channel_->set_name(name.toUtf8().constData());