projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19e4ebd
)
Don't allow newlines in buffer names
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Mon, 8 Feb 2016 20:29:14 +0000
(21:29 +0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Mon, 8 Feb 2016 21:31:19 +0000
(22:31 +0100)
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.
src/client/networkmodel.cpp
patch
|
blob
|
history
diff --git
a/src/client/networkmodel.cpp
b/src/client/networkmodel.cpp
index
c85f579
..
c49d119
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();
+
+ // 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;