X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=ddc71dd4f4ab19c5579b07922f93d4e391ee5bfd;hb=cd2c2456d5051d97bddf171738b319a98a7f5178;hp=4d49efb2daceb1adb3a796aa9c532667b0487ed8;hpb=a3b64148aa400aae9aad44c99b683151302d9d7a;p=quassel.git diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 4d49efb2..ddc71dd4 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -463,6 +463,12 @@ bool QueryBufferItem::setData(int column, const QVariant &value, int role) 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;