Browse Source

Merge pull request #765 from Gelmir/no_newline_for_rename

Forbid newlines in rename torrent dialog.
adaptive-webui-19844
sledgehammer999 12 years ago
parent
commit
0cfa3ba06d
  1. 3
      src/transferlistwidget.cpp

3
src/transferlistwidget.cpp

@ -624,8 +624,9 @@ void TransferListWidget::renameSelectedTorrent() {
if (!h.is_valid()) return; if (!h.is_valid()) return;
// Ask for a new Name // Ask for a new Name
bool ok; 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()) { if (ok && !name.isEmpty()) {
name.replace(QRegExp("\r?\n|\r"), " ");
// Rename the torrent // Rename the torrent
listModel->setData(mi, name, Qt::DisplayRole); listModel->setData(mi, name, Qt::DisplayRole);
} }

Loading…
Cancel
Save