1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

- BUGFIX: Fixed torrent create (can only one file or one folder)

This commit is contained in:
Christophe Dumez 2007-09-02 17:03:33 +00:00
parent 3e783873ec
commit 792101731f
3 changed files with 17 additions and 13 deletions

2
TODO
View File

@ -54,7 +54,6 @@
- 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent - 128m 29m 16m S 4.8 2.9 0:02.28 qbittorrent
* beta 7 * beta 7
- Fix storage st creation + hasher in torrent creation - Fix storage st creation + hasher in torrent creation
- Pause all when window in hidden should pause all (both tabs)
- Translations update (IN PROGRESS) - Translations update (IN PROGRESS)
- Wait for some bug fixes in libtorrent : - Wait for some bug fixes in libtorrent :
- Number of seeds non null for finished torrent (Ticket #122) - 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 drag'n drop on non-KDE systems
- BUGFIX: Fixed log context menu position - BUGFIX: Fixed log context menu position
- BUGFIX: Made pause/resume all function affect both (dl/up) tabs when window is hidden - 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 - COSMETIC: Improved some icons

View File

@ -90,7 +90,7 @@
</size> </size>
</property> </property>
<property name="text" > <property name="text" >
<string>Input files or directories:</string> <string>Input file or directory:</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -64,26 +64,30 @@ void createtorrent::on_browse_destination_clicked(){
void createtorrent::on_addFolder_button_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); 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); input_list->addItem(dir);
addFolder_button->setEnabled(false);
addFile_button->setEnabled(false);
}
} }
void createtorrent::on_addFile_button_clicked(){ 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 = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath(), QString(), 0, QFileDialog::ShowDirsOnly);
QString file; if(!file.isEmpty()) {
foreach(file, files){ input_list->addItem(file);
if(input_list->findItems(file, Qt::MatchCaseSensitive).size() == 0){ addFolder_button->setEnabled(false);
input_list->addItem(file); addFile_button->setEnabled(false);
}
} }
} }
void createtorrent::on_removeFolder_button_clicked(){ void createtorrent::on_removeFolder_button_clicked(){
QModelIndexList selectedIndexes = input_list->selectionModel()->selectedIndexes(); QModelIndexList selectedIndexes = input_list->selectionModel()->selectedIndexes();
for(int i=selectedIndexes.size()-1; i>=0; --i){ if(!selectedIndexes.size()) return;
QListWidgetItem *item = input_list->takeItem(selectedIndexes.at(i).row()); Q_ASSERT(selectedIndexes.size() == 1);
delete item; QListWidgetItem *item = input_list->takeItem(selectedIndexes.first().row());
} delete item;
addFolder_button->setEnabled(true);
addFile_button->setEnabled(true);
} }
void createtorrent::on_removeTracker_button_clicked(){ void createtorrent::on_removeTracker_button_clicked(){