X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=c49d11905013a51329b4e1d9ecc9cb026843ffd4;hb=0e755439e2447649e91c2d016e088b05b4637add;hp=c85f579f296d272a15624dd2690a1e70c1a5dc57;hpb=b0fcfdea3deb5e45961745d743c8468e905744b1;p=quassel.git diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index c85f579f..c49d1190 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;