diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index 518b636ff..84f3b9b89 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -111,7 +111,10 @@ QList EventManager::getPropFilesInfo(QString hash) const { file["name"] = name; } file["size"] = misc::friendlyUnit((double)fi->size); - file["progress"] = fp[i]/(double)fi->size; + if(fi->size > 0) + file["progress"] = fp[i]/(double)fi->size; + else + file["progress"] = 1.; // Empty file... file["priority"] = priorities[i]; files << file; ++i; diff --git a/src/torrentfilesmodel.h b/src/torrentfilesmodel.h index c161215f0..048b8034b 100644 --- a/src/torrentfilesmodel.h +++ b/src/torrentfilesmodel.h @@ -272,7 +272,10 @@ public: void updateFilesProgress(std::vector fp) { for(unsigned int i=0; isetProgress((float)fp[i]/(float)item->getSize()); + if(item->getSize() > 0) + item->setProgress((float)fp[i]/(float)item->getSize()); + else + item->setProgress(1.); // Empty file... } emit layoutChanged(); }