Fix DownloadView __repr__ if model is None. Fixes #170.

This commit is contained in:
Florian Bruhin 2014-10-08 17:19:51 +02:00
parent b7f2a6d143
commit de86a26473

View File

@ -64,7 +64,12 @@ class DownloadView(QListView):
self.customContextMenuRequested.connect(self.show_context_menu)
def __repr__(self):
return utils.get_repr(self, count=self.model().rowCount())
model = self.model()
if model is None:
count = 'None'
else:
count = model.rowCount()
return utils.get_repr(self, count=count)
@pyqtSlot('QPoint')
def show_context_menu(self, point):