Get rid of _lastmodel in completer
This commit is contained in:
parent
0f41366269
commit
813783d976
@ -39,7 +39,6 @@ class Completer(QObject):
|
|||||||
view: The CompletionView associated with this completer.
|
view: The CompletionView associated with this completer.
|
||||||
ignore_change: Whether to ignore the next completion update.
|
ignore_change: Whether to ignore the next completion update.
|
||||||
_models: dict of available completion models.
|
_models: dict of available completion models.
|
||||||
_lastmodel: The model set in the last iteration.
|
|
||||||
|
|
||||||
Signals:
|
Signals:
|
||||||
change_completed_part: Text which should be substituted for the word
|
change_completed_part: Text which should be substituted for the word
|
||||||
@ -56,7 +55,6 @@ class Completer(QObject):
|
|||||||
super().__init__(view)
|
super().__init__(view)
|
||||||
self.view = view
|
self.view = view
|
||||||
self.ignore_change = False
|
self.ignore_change = False
|
||||||
self._lastmodel = None
|
|
||||||
|
|
||||||
self._models = {
|
self._models = {
|
||||||
'option': {},
|
'option': {},
|
||||||
@ -195,12 +193,9 @@ class Completer(QObject):
|
|||||||
if model is None:
|
if model is None:
|
||||||
logger.debug("No completion model for {}.".format(parts))
|
logger.debug("No completion model for {}.".format(parts))
|
||||||
else:
|
else:
|
||||||
logger.debug("New completion: {} / last: {}".format(
|
logger.debug("New completion: {}".format(
|
||||||
model.srcmodel.__class__.__name__,
|
model.srcmodel.__class__.__name__))
|
||||||
self._lastmodel.srcmodel.__class__.__name__ if self._lastmodel
|
if model != self.view.model():
|
||||||
is not None else "None"))
|
|
||||||
if model != self._lastmodel:
|
|
||||||
self._lastmodel = model
|
|
||||||
if model is None:
|
if model is None:
|
||||||
self.view.hide()
|
self.view.hide()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user