mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Merge pull request #2174 from sorokin/fix-empty-combobox
Fix emptying of 'piece size' combobox when user enable 'auto' checkbox and no files are selected
This commit is contained in:
commit
7dd4e4aca8
@ -220,9 +220,9 @@ void TorrentCreatorDlg::on_checkAutoPieceSize_clicked(bool checked)
|
|||||||
|
|
||||||
void TorrentCreatorDlg::updateOptimalPieceSize()
|
void TorrentCreatorDlg::updateOptimalPieceSize()
|
||||||
{
|
{
|
||||||
quint64 torrent_size = fsutils::computePathSize(textInputPath->text());
|
qint64 torrent_size = fsutils::computePathSize(textInputPath->text());
|
||||||
qDebug("Torrent size is %lld", torrent_size);
|
qDebug("Torrent size is %lld", torrent_size);
|
||||||
if (torrent_size == 0) return;
|
if (torrent_size < 0) return;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
qulonglong nb_pieces = 0;
|
qulonglong nb_pieces = 0;
|
||||||
do {
|
do {
|
||||||
@ -238,7 +238,7 @@ void TorrentCreatorDlg::updateOptimalPieceSize()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}while(i<m_piece_sizes.size());
|
}while(i<(m_piece_sizes.size()-1));
|
||||||
comboPieceSize->setCurrentIndex(i);
|
comboPieceSize->setCurrentIndex(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user