mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Merge pull request #404 from sledgehammer999/del_whitespace
Remove leading and trailing whitespace when choosing filenames. Fixes is...
This commit is contained in:
commit
a3163a419a
@ -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"),
|
||||
|
@ -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"),
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user