diff --git a/src/addnewtorrentdialog.cpp b/src/addnewtorrentdialog.cpp index 1aac1e252..5e5783950 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 1f17a3509..e27ef5782 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 438165b51..f27387aca 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -589,7 +589,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);