mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Validate label names to make sure there is no character forbidden by the file system
This commit is contained in:
parent
2b289655c1
commit
037e57b687
4 changed files with 49 additions and 11 deletions
|
@ -868,11 +868,20 @@ void TransferListWidget::toggleSelectedFirstLastPiecePrio() {
|
|||
void TransferListWidget::askNewLabelForSelection() {
|
||||
// Ask for label
|
||||
bool ok;
|
||||
QString label = QInputDialog::getText(this, tr("New Label"), tr("Label:"), QLineEdit::Normal, "", &ok);
|
||||
if (ok && !label.isEmpty()) {
|
||||
// Assign label to selection
|
||||
setSelectionLabel(label);
|
||||
}
|
||||
QString label = "";
|
||||
bool invalid;
|
||||
do {
|
||||
invalid = false;
|
||||
label = QInputDialog::getText(this, tr("New Label"), tr("Label:"), QLineEdit::Normal, label, &ok);
|
||||
if (ok && !label.isEmpty()) {
|
||||
if(misc::isValidFileSystemName(label)) {
|
||||
setSelectionLabel(label);
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("Invalid label name"), tr("Please don't use any special characters in the label name."));
|
||||
invalid = true;
|
||||
}
|
||||
}
|
||||
}while(invalid);
|
||||
}
|
||||
|
||||
void TransferListWidget::renameSelectedTorrent() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue