Update torrent progress when its content changed (filtered files)

This commit is contained in:
Christophe Dumez 2007-07-31 09:25:54 +00:00
parent 99a58b9208
commit 99530728c5
4 changed files with 7 additions and 4 deletions

View file

@ -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