More sql code review fixes

This commit is contained in:
Ryan Roden-Corrent 2017-06-08 07:34:35 -04:00
parent 9b0395db08
commit 3a4ef09f58
3 changed files with 5 additions and 6 deletions

View File

@ -149,7 +149,7 @@ class CompletionView(QTreeView):
def _resize_columns(self):
"""Resize the completion columns based on column_widths."""
width = self.size().width()
column_widths = self.model.column_widths
column_widths = self.model().column_widths
pixel_widths = [(width * perc // 100) for perc in column_widths]
if self.verticalScrollBar().isVisible():
@ -295,7 +295,7 @@ class CompletionView(QTreeView):
def _maybe_show(self):
if (config.get('completion', 'show') == 'always' and
model.count() > 0):
self.model().count() > 0):
self.show()
else:
self.hide()

View File

@ -44,5 +44,5 @@ def check_history(quteproc, httpbin, tmpdir, expected):
@bdd.then("the history should be empty")
def check_history_empty(quteproc, httpbin):
check_history(quteproc, '', httpbin)
def check_history_empty(quteproc, httpbin, tmpdir):
check_history(quteproc, httpbin, tmpdir, '')

View File

@ -107,7 +107,6 @@ def test_entries_before(hist):
assert times == [12348, 12347, 12346]
def test_clear(qtbot, tmpdir, hist, mocker):
hist.add_url(QUrl('http://example.com/'))
hist.add_url(QUrl('http://www.qutebrowser.org/'))
@ -186,7 +185,7 @@ def cleanup_init():
try:
from PyQt5.QtWebKit import QWebHistoryInterface
QWebHistoryInterface.setDefaultInterface(None)
except Exception:
except ImportError:
pass