completion: Don't unnecessarily expand all items.

Instead of calling expandAll() and iterating through all items, we can just
force the top-level items to be expanded.
This commit is contained in:
Florian Bruhin 2015-03-14 22:51:53 +01:00
parent cdbb118238
commit 9512a52d21

View File

@ -193,7 +193,8 @@ class CompletionView(QTreeView):
self.setModel(model)
if sel_model is not None:
sel_model.deleteLater()
self.expandAll()
for i in range(model.rowCount()):
self.expand(model.index(i, 0))
self._resize_columns()
model.rowsRemoved.connect(self.maybe_resize_completion)
model.rowsInserted.connect(self.maybe_resize_completion)