From 99530728c51b60e25280eceb7e71ebc6ede6f79c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 31 Jul 2007 09:25:54 +0000 Subject: [PATCH] Update torrent progress when its content changed (filtered files) --- Changelog | 1 + TODO | 1 - src/GUI.cpp | 7 +++++-- src/GUI.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index d60d63c9f..f1121c556 100644 --- a/Changelog +++ b/Changelog @@ -44,6 +44,7 @@ - BUGFIX: search plugin update - do not display only last version changelog - BUGFIX: Search plugin update - fixed missing new lines in changelog - BUGFIX: The number of search results was not reset when clicking on 'Clear' button + - BUGFIX: Update torrent progress when its content changed (filtered files) - COSMETIC: Redesigned torrent properties a little - COSMETIC: Redesigned options a little - COSMETIC: Display more logs messages concerning features diff --git a/TODO b/TODO index 089f7c076..92a369416 100644 --- a/TODO +++ b/TODO @@ -47,7 +47,6 @@ - Translations update (IN PROGESS) - Optimize and cleanup code - add asserts to squash remaining bugs - - Update progress (as well as size) when a torrent's content hash changed (filtered files) - Check that there is no problem with right click menu in torrent content (all files filtered for example) - Wait for some bug fixes in libtorrent : - upload/download limit per torrent diff --git a/src/GUI.cpp b/src/GUI.cpp index 48cff6c46..a0c258f1c 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -1243,14 +1243,17 @@ void GUI::showProperties(const QModelIndex &index){ torrent_handle h = BTSession->getTorrentHandle(fileHash); properties *prop = new properties(this, BTSession, h); connect(prop, SIGNAL(mustHaveFullAllocationMode(torrent_handle)), BTSession, SLOT(reloadTorrent(torrent_handle))); - connect(prop, SIGNAL(filteredFilesChanged(QString)), this, SLOT(updateFileSize(QString))); + connect(prop, SIGNAL(filteredFilesChanged(QString)), this, SLOT(updateFileSizeAndProgress(QString))); prop->show(); } -void GUI::updateFileSize(QString hash){ +void GUI::updateFileSizeAndProgress(QString hash){ int row = getRowFromHash(hash); Q_ASSERT(row != -1); DLListModel->setData(DLListModel->index(row, SIZE), QVariant((qlonglong)BTSession->torrentEffectiveSize(hash))); + torrent_handle h = BTSession->getTorrentHandle(hash); + torrent_status torrentStatus = h.status(); + DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress)); } // Set BT session configuration diff --git a/src/GUI.h b/src/GUI.h index 6c7008122..59373bd8c 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -171,7 +171,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ void portListeningFailure(); void trackerAuthenticationRequired(torrent_handle& h); void setTabText(int index, QString text); - void updateFileSize(QString hash); + void updateFileSizeAndProgress(QString hash); void sortProgressColumnDelayed(); void addUrlSeedError(QString url, QString msg);