mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 14:04:23 +00:00
Fix possible issue where torrents would not be displayed in the transfer list
This commit is contained in:
parent
2ce375d8eb
commit
1dd11dd8f8
@ -446,6 +446,19 @@ void TransferListWidget::refreshList() {
|
|||||||
// Refresh only if displayed
|
// Refresh only if displayed
|
||||||
if(main_window->getCurrentTabIndex() != TAB_TRANSFER) return;
|
if(main_window->getCurrentTabIndex() != TAB_TRANSFER) return;
|
||||||
unsigned int nb_downloading = 0, nb_seeding=0, nb_active=0, nb_inactive = 0;
|
unsigned int nb_downloading = 0, nb_seeding=0, nb_active=0, nb_inactive = 0;
|
||||||
|
if(BTSession->getSession()->get_torrents().size() != (uint)listModel->rowCount()) {
|
||||||
|
// Oups, we have torrents that are not displayed, fix that
|
||||||
|
std::vector<torrent_handle> torrents = BTSession->getSession()->get_torrents();
|
||||||
|
std::vector<torrent_handle>::iterator itr = torrents.begin();
|
||||||
|
while(itr != torrents.end()) {
|
||||||
|
QTorrentHandle h(*itr);
|
||||||
|
if(h.is_valid() && getRowFromHash(h.hash()) < 0) {
|
||||||
|
addTorrent(h);
|
||||||
|
}
|
||||||
|
itr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
for(int i=0; i<listModel->rowCount(); ++i) {
|
for(int i=0; i<listModel->rowCount(); ++i) {
|
||||||
int s = updateTorrent(i);
|
int s = updateTorrent(i);
|
||||||
switch(s) {
|
switch(s) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user