mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Forbid newlines in rename torrent dialog.
This commit is contained in:
parent
f261c18d73
commit
c6329f6327
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue