Fix crashes after completion refactoring

This commit is contained in:
Florian Bruhin 2014-06-25 16:48:28 +02:00
parent 5c143da40b
commit 9238135867

View File

@ -178,14 +178,16 @@ class Completer(QObject):
return
model = self._get_new_completion(parts, cursor_part)
if model is None:
logger.debug("No completion model for {}.".format(parts))
if model != self.view.model():
self.view.hide()
return
if model != self.view.model():
self.view.set_model(model)
if model is None:
self.view.hide()
else:
self.view.set_model(model)
if model is None:
logger.debug("No completion model for {}.".format(parts))
return
pattern = parts[cursor_part] if parts else ''
self.view.model().pattern = pattern