diff --git a/TODO b/TODO index 24966cdb5..7bd74e943 100644 --- a/TODO +++ b/TODO @@ -54,7 +54,6 @@ - 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent * beta 7 - Fix storage st creation + hasher in torrent creation - - Pause all when window in hidden should pause all (both tabs) - Translations update (IN PROGRESS) - Wait for some bug fixes in libtorrent : - Number of seeds non null for finished torrent (Ticket #122) @@ -91,4 +90,5 @@ beta6->beta7 changelog: - BUGFIX: Fixed drag'n drop on non-KDE systems - BUGFIX: Fixed log context menu position - BUGFIX: Made pause/resume all function affect both (dl/up) tabs when window is hidden +- BUGFIX: Fixed torrent create (can only one file or one folder) - COSMETIC: Improved some icons diff --git a/src/createtorrent.ui b/src/createtorrent.ui index 42b4b648b..a451e3efe 100644 --- a/src/createtorrent.ui +++ b/src/createtorrent.ui @@ -90,7 +90,7 @@ - Input files or directories: + Input file or directory: diff --git a/src/createtorrent_imp.cpp b/src/createtorrent_imp.cpp index 8033db40c..979f95644 100644 --- a/src/createtorrent_imp.cpp +++ b/src/createtorrent_imp.cpp @@ -64,26 +64,30 @@ void createtorrent::on_browse_destination_clicked(){ void createtorrent::on_addFolder_button_clicked(){ QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly); - if(!dir.isEmpty() && input_list->findItems(dir, Qt::MatchCaseSensitive).size() == 0) + if(!dir.isEmpty()) { input_list->addItem(dir); + addFolder_button->setEnabled(false); + addFile_button->setEnabled(false); + } } void createtorrent::on_addFile_button_clicked(){ - QStringList files = QFileDialog::getOpenFileNames(this, tr("Select files to add to the torrent"), QDir::homePath(), QString(), 0, QFileDialog::ShowDirsOnly); - QString file; - foreach(file, files){ - if(input_list->findItems(file, Qt::MatchCaseSensitive).size() == 0){ - input_list->addItem(file); - } + QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath(), QString(), 0, QFileDialog::ShowDirsOnly); + if(!file.isEmpty()) { + input_list->addItem(file); + addFolder_button->setEnabled(false); + addFile_button->setEnabled(false); } } void createtorrent::on_removeFolder_button_clicked(){ QModelIndexList selectedIndexes = input_list->selectionModel()->selectedIndexes(); - for(int i=selectedIndexes.size()-1; i>=0; --i){ - QListWidgetItem *item = input_list->takeItem(selectedIndexes.at(i).row()); - delete item; - } + if(!selectedIndexes.size()) return; + Q_ASSERT(selectedIndexes.size() == 1); + QListWidgetItem *item = input_list->takeItem(selectedIndexes.first().row()); + delete item; + addFolder_button->setEnabled(true); + addFile_button->setEnabled(true); } void createtorrent::on_removeTracker_button_clicked(){