Fix download model output if percentage is None
This commit is contained in:
parent
8d9372045d
commit
3150a88a3b
@ -58,7 +58,11 @@ class DownloadModel(QAbstractListModel):
|
||||
item = self.downloadmanager.downloads[index.row()]
|
||||
except IndexError:
|
||||
return QVariant()
|
||||
return str(item.percentage) # FIXME
|
||||
perc = item.percentage
|
||||
if perc is None:
|
||||
return QVariant()
|
||||
else:
|
||||
return str(round(perc)) # FIXME
|
||||
|
||||
def rowCount(self, parent):
|
||||
if parent.isValid():
|
||||
|
Loading…
Reference in New Issue
Block a user