fix "local variable 'txt' referenced before assignment"

This commit is contained in:
Damien Elmes 2014-01-13 19:07:34 +09:00
parent cc98ef3763
commit c5df294a28

View File

@ -96,10 +96,14 @@ class DataModel(QAbstractTableModel):
return
elif role == Qt.DisplayRole and section < len(self.activeCols):
type = self.columnType(section)
txt = None
for stype, name in self.browser.columns:
if type == stype:
txt = name
break
# handle case where extension has set an invalid column type
if not txt:
txt = self.browser.columns[0][1]
return txt
else:
return