From c6329f6327d016d9232ed72454f807a3618c9e62 Mon Sep 17 00:00:00 2001 From: Nick Tiskov Date: Thu, 11 Jul 2013 14:16:13 +0400 Subject: [PATCH] Forbid newlines in rename torrent dialog. --- src/transferlistwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index c7205325a..9d30991c5 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -624,8 +624,9 @@ void TransferListWidget::renameSelectedTorrent() { if (!h.is_valid()) return; // Ask for a new Name bool ok; - const QString name = QInputDialog::getText(this, tr("Rename"), tr("New name:"), QLineEdit::Normal, h.name(), &ok); + QString name = QInputDialog::getText(this, tr("Rename"), tr("New name:"), QLineEdit::Normal, h.name(), &ok); if (ok && !name.isEmpty()) { + name.replace(QRegExp("\r?\n|\r"), " "); // Rename the torrent listModel->setData(mi, name, Qt::DisplayRole); }