diff --git a/src/addnewtorrentdialog.cpp b/src/addnewtorrentdialog.cpp index 890b552ad..3fe953045 100644 --- a/src/addnewtorrentdialog.cpp +++ b/src/addnewtorrentdialog.cpp @@ -394,7 +394,7 @@ void AddNewTorrentDialog::renameSelectedFile() bool ok; const QString new_name_last = QInputDialog::getText(this, tr("Rename the file"), tr("New name:"), QLineEdit::Normal, - index.data().toString(), &ok); + index.data().toString(), &ok).trimmed(); if (ok && !new_name_last.isEmpty()) { if (!fsutils::isValidFileSystemName(new_name_last)) { QMessageBox::warning(this, tr("The file could not be renamed"), diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index 5dc8f740a..30e6b3df7 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -511,7 +511,7 @@ void PropertiesWidget::renameSelectedFile() { bool ok; QString new_name_last = QInputDialog::getText(this, tr("Rename the file"), tr("New name:"), QLineEdit::Normal, - index.data().toString(), &ok); + index.data().toString(), &ok).trimmed(); if (ok && !new_name_last.isEmpty()) { if (!fsutils::isValidFileSystemName(new_name_last)) { QMessageBox::warning(this, tr("The file could not be renamed"), diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index abe5865d3..f534e94b3 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -593,7 +593,7 @@ void TransferListWidget::askNewLabelForSelection() { bool invalid; do { invalid = false; - const QString label = QInputDialog::getText(this, tr("New Label"), tr("Label:"), QLineEdit::Normal, "", &ok); + const QString label = QInputDialog::getText(this, tr("New Label"), tr("Label:"), QLineEdit::Normal, "", &ok).trimmed(); if (ok && !label.isEmpty()) { if (fsutils::isValidFileSystemName(label)) { setSelectionLabel(label);