Forbid newlines in rename torrent dialog.

This commit is contained in:
Nick Tiskov 2013-07-11 14:16:13 +04:00
parent f261c18d73
commit c6329f6327

View File

@ -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);
}