Since it is possible to enter newlines when renaming a buffer via
the GUI, we need to have a sanity check that cuts off the additional
lines.
Fixes #1389.
case Qt::EditRole:
{
QString newName = value.toString();
case Qt::EditRole:
{
QString newName = value.toString();
+
+ // Sanity check - buffer names must not contain newlines!
+ int nlpos = newName.indexOf('\n');
+ if (nlpos >= 0)
+ newName = newName.left(nlpos);
+
if (!newName.isEmpty()) {
Client::renameBuffer(bufferId(), newName);
return true;
if (!newName.isEmpty()) {
Client::renameBuffer(bufferId(), newName);
return true;