mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-24 01:08:06 -06:00
Forbid newlines in rename torrent dialog.
This commit is contained in:
committed by
sledgehammer999
parent
a09b10e3ec
commit
ace4989763
@@ -612,8 +612,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user