Fix download model output if percentage is None

This commit is contained in:
Florian Bruhin 2014-06-12 10:20:27 +02:00
parent 8d9372045d
commit 3150a88a3b

View File

@ -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():