- Fixed a bug in torrent content selection when there is only one file in the torrent

This commit is contained in:
Christophe Dumez
2007-09-16 09:41:05 +00:00
parent c478ba59ac
commit 488bd90303
2 changed files with 12 additions and 6 deletions

View File

@@ -352,9 +352,11 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
QStandardItem *item = parent->child(i, INDEX);
int index = item->text().toInt();
if(index < 0) {
getPriorities(parent->child(i, NAME), priorities);
qDebug("getPriorities(), found a folder, checking its children");
getPriorities(parent->child(i), priorities);
} else {
item = parent->child(i, PRIORITY);
qDebug("getPriorities(), found priority %d for file at index %d", item->text().toInt(), index);
priorities[index] = item->text().toInt();
}
}
@@ -373,6 +375,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
return;
}
for(unsigned int i=0; i<nbFiles; ++i) {
qDebug("%d ", priorities[i]);
pieces_file.write(misc::toQByteArray(priorities[i])+misc::toQByteArray("\n"));
}
pieces_file.close();