Set the maximum for the individual file history item to MB to avoid > 2GB crash

This commit is contained in:
Miguel Jacq 2020-06-30 13:40:26 +10:00
parent cefa271d29
commit de81447b8f
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -453,7 +453,7 @@ class IndividualFileHistoryItem(HistoryItem):
else:
self.total_bytes = data["filesize"]
self.progress_bar.setMinimum(0)
self.progress_bar.setMaximum(data["filesize"])
self.progress_bar.setMaximum(data["filesize"] / 1024)
self.progress_bar.total_bytes = data["filesize"]
# Start at 0
@ -462,7 +462,7 @@ class IndividualFileHistoryItem(HistoryItem):
def update(self, downloaded_bytes):
self.downloaded_bytes = downloaded_bytes
self.progress_bar.setValue(downloaded_bytes)
self.progress_bar.setValue(downloaded_bytes / 1024)
if (downloaded_bytes / 1024 ) == (self.progress_bar.total_bytes / 1024):
self.status_code_label.setText("200")
self.status_code_label.setStyleSheet(