This commit is contained in:
Florian Bruhin 2014-03-09 20:31:40 +01:00
parent a19571fe21
commit e61d7f724f
3 changed files with 6 additions and 5 deletions

View File

@ -18,12 +18,10 @@
"""Configuration storage and config-related utilities.""" """Configuration storage and config-related utilities."""
import os import os
import io
import os.path import os.path
import logging import logging
import textwrap import textwrap
from configparser import (ConfigParser, ExtendedInterpolation, NoSectionError, from configparser import ConfigParser, ExtendedInterpolation
NoOptionError)
#from qutebrowser.utils.misc import read_file #from qutebrowser.utils.misc import read_file
import qutebrowser.config.configdata as configdata import qutebrowser.config.configdata as configdata

View File

@ -271,8 +271,10 @@ class CompletionModel(QAbstractItemModel):
""" """
if parent.model() is not None and parent.model() is not self: if parent.model() is not None and parent.model() is not self:
logging.debug("row {}, column {}, parent {}, parentmodel {}, self {}".format(row, column, parent, parent.model(), self)) logging.warn("index() called with wrong parent! - "
from qutebrowser.utils.debug import set_trace; set_trace() "row {}, column {}, parentmodel {}, self {}".format(
row, column, parent.model(), self))
return
if (0 <= row < self.rowCount(parent) and if (0 <= row < self.rowCount(parent) and
0 <= column < self.columnCount(parent)): 0 <= column < self.columnCount(parent)):
pass pass

View File

@ -79,6 +79,7 @@ class CompletionFilterModel(QSortFilterProxyModel):
return self.index(self.rowCount(cat) - 1, 0, cat) return self.index(self.rowCount(cat) - 1, 0, cat)
def setSourceModel(self, model): def setSourceModel(self, model):
"""Override QSortFilterProxyModel's setSourceModel to clear pattern."""
logging.debug("Setting source model: {}".format(model)) logging.debug("Setting source model: {}".format(model))
self.pattern = '' self.pattern = ''
super().setSourceModel(model) super().setSourceModel(model)