From 1dd11dd8f82fa67e82da19d03e9b59e908f1bafd Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 23 Jan 2010 19:01:10 +0000 Subject: [PATCH] Fix possible issue where torrents would not be displayed in the transfer list --- src/transferlistwidget.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 726e0f321..572bb513f 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -446,6 +446,19 @@ void TransferListWidget::refreshList() { // Refresh only if displayed if(main_window->getCurrentTabIndex() != TAB_TRANSFER) return; 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 torrents = BTSession->getSession()->get_torrents(); + std::vector::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; irowCount(); ++i) { int s = updateTorrent(i); switch(s) {