1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 20:44:15 +00:00

- Fixed a crash when displaying properties of a torrent then deleting the torrent

This commit is contained in:
Christophe Dumez 2006-10-16 18:16:56 +00:00
parent 1a6b445652
commit 6e5b805dc3

View File

@ -187,10 +187,15 @@ void properties::loadFilteredFiles(){
void properties::updateProgress(){ void properties::updateProgress(){
std::vector<float> fp; std::vector<float> fp;
h.file_progress(fp); try{
torrent_info torrentInfo = h.get_torrent_info(); h.file_progress(fp);
for(int i=0; i<torrentInfo.num_files(); ++i){ torrent_info torrentInfo = h.get_torrent_info();
PropListModel->setData(PropListModel->index(i, PROGRESS), QVariant((double)fp[i])); for(int i=0; i<torrentInfo.num_files(); ++i){
PropListModel->setData(PropListModel->index(i, PROGRESS), QVariant((double)fp[i]));
}
}catch(invalid_handle e){
// torrent was removed, closing properties
close();
} }
} }