Commit a109e44b authored by Luci Stanescu's avatar Luci Stanescu

Fixed ContactListView.paintEvent to not assume there are any groups

parent 51cb5da6
......@@ -872,9 +872,10 @@ class ContactListView(QListView):
painter.drawRoundedRect(rect.adjusted(1, 1, -1, -1), 3, 3)
painter.end()
model = self.model()
last_group = model.contact_groups[-1]
if last_group.widget.drop_indicator is self.BelowItem:
contact_groups = model.contact_groups
if contact_groups and contact_groups[-1].widget.drop_indicator is self.BelowItem:
# draw the bottom part of the drop indicator for the last group
last_group = contact_groups[-1]
rect = self.visualRect(model.index(model.items.index(last_group)))
line_rect = QRectF(rect.adjusted(18, rect.height(), 0, 5))
arc_rect = line_rect.adjusted(-5, -3, -line_rect.width(), -3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment