From 7ad39003f404df8539a22c93cf54196593e52c04 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 11 Jan 2010 20:09:32 +0000 Subject: [PATCH] - Fix error in torrent addition dialog when the label name is left empty --- src/torrentadditiondlg.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index 28fc74507..06825c7db 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -433,14 +433,16 @@ public slots: return; } } - if (!misc::isValidFileSystemName(comboLabel->currentText().trimmed())) { + QString current_label = comboLabel->currentText().trimmed(); + if (!current_label.isEmpty() && !misc::isValidFileSystemName(current_label)) { QMessageBox::warning(this, tr("Invalid label name"), tr("Please don't use any special characters in the label name.")); return; } // Save savepath TorrentTempData::setSavePath(hash, savePath.path()); qDebug("Torrent label is: %s", comboLabel->currentText().trimmed().toLocal8Bit().data()); - TorrentTempData::setLabel(hash, comboLabel->currentText().trimmed()); + if(!current_label.isEmpty()) + TorrentTempData::setLabel(hash, current_label); // Is download sequential? TorrentTempData::setSequential(hash, checkIncrementalDL->isChecked()); // Save files path