Skip to content

Commit

Permalink
Merge pull request #892 from ales-erjavec/settings-max-contexts
Browse files Browse the repository at this point in the history
ContextHandler: Limit the number of saved (local) contexts
  • Loading branch information
astaric committed Dec 8, 2015
2 parents c05d7db + f4e1943 commit be4d33b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Orange/widgets/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,11 @@ def move_context_up(widget, index):
setting.time = time.time()
widget.context_settings.insert(0, setting)

@staticmethod
def add_context(widget, setting):
def add_context(self, widget, setting):
"""Add the context to the top of the list."""
s = widget.context_settings
s.insert(0, setting)
del s[len(s):]
del s[self.MAX_SAVED_CONTEXTS:]

def clone_context(self, old_context, *args):
"""Construct a copy of the context settings suitable for the context
Expand Down

0 comments on commit be4d33b

Please sign in to comment.