X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=c49d11905013a51329b4e1d9ecc9cb026843ffd4;hb=bbe4e00c72ef57febad268b6937d950c01969a54;hp=6da58323b38ebeae0e27921e04b1a86d82b628e6;hpb=695758015a80eb8c158a9ac4c0f1c0b547e70df3;p=quassel.git diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 6da58323..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; @@ -723,7 +729,7 @@ void ChannelBufferItem::addUsersToCategory(const QList &ircUsers) QHash >::const_iterator catIter = categories.constBegin(); while (catIter != categories.constEnd()) { catIter.key()->addUsers(catIter.value()); - catIter++; + ++catIter; } }