From 293ebc8d46b70338fabaa504aea04119ee6ba1b4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 29 Jan 2014 15:40:55 +0100 Subject: [PATCH] Add some asserts --- qutebrowser/widgets/completion.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/widgets/completion.py b/qutebrowser/widgets/completion.py index 989338be4..d76949be5 100644 --- a/qutebrowser/widgets/completion.py +++ b/qutebrowser/widgets/completion.py @@ -93,6 +93,8 @@ class CompletionView(QTreeView): """ width = e.size().width() cols = self.model.columnCount() + assert cols >= 1 + assert width / cols > 1 for i in range(cols): self.setColumnWidth(i, width / cols) super().resizeEvent(e) @@ -130,6 +132,8 @@ class CompletionView(QTreeView): bottomright = geom.topRight() delta = QPoint(0, 200) topleft = bottomleft - delta + assert topleft.x() < bottomright.x() + assert topleft.y() < bottomright.y() self.setGeometry(QRect(topleft, bottomright)) def cmd_text_changed(self, text):