Plugin customization GUI: Sort plugins by name

This commit is contained in:
Kovid Goyal 2010-05-16 21:21:21 -06:00
parent 66d2604458
commit fcdcd68adf

View File

@ -109,6 +109,9 @@ class PluginModel(QAbstractItemModel):
self._data[plugin.type].append(plugin)
self.categories = sorted(self._data.keys())
for plugins in self._data.values():
plugins.sort(cmp=lambda x, y: cmp(x.name.lower(), y.name.lower()))
def index(self, row, column, parent):
if not self.hasIndex(row, column, parent):
return QModelIndex()