mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 01:06:03 +03:00
- Fixed a crash when displaying properties of a torrent then deleting the torrent
This commit is contained in:
parent
1a6b445652
commit
6e5b805dc3
1 changed files with 9 additions and 4 deletions
|
@ -187,10 +187,15 @@ void properties::loadFilteredFiles(){
|
|||
|
||||
void properties::updateProgress(){
|
||||
std::vector<float> fp;
|
||||
h.file_progress(fp);
|
||||
torrent_info torrentInfo = h.get_torrent_info();
|
||||
for(int i=0; i<torrentInfo.num_files(); ++i){
|
||||
PropListModel->setData(PropListModel->index(i, PROGRESS), QVariant((double)fp[i]));
|
||||
try{
|
||||
h.file_progress(fp);
|
||||
torrent_info torrentInfo = h.get_torrent_info();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue