projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't allow newlines in buffer names
[quassel.git]
/
src
/
client
/
networkmodel.cpp
diff --git
a/src/client/networkmodel.cpp
b/src/client/networkmodel.cpp
index
4d49efb
..
ddc71dd
100644
(file)
--- 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();
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;