diff --git a/common.py b/common.py index 5b7f681..7cf6056 100644 --- a/common.py +++ b/common.py @@ -18,7 +18,7 @@ from __future__ import division, print_function -__version__ = '2.1' +__version__ = '2.1.1' import sys import os.path diff --git a/player.py b/player.py index 9fded47..8ccb12d 100755 --- a/player.py +++ b/player.py @@ -208,7 +208,6 @@ def drawForeground(self, g, rect): poly = poly.intersected(QPolygonF(rect)) g.drawConvexPolygon(poly) - @cached_property def all_cells(self): return list(self.all(Cell)) @@ -217,6 +216,11 @@ def all_cells(self): def all_columns(self): return list(self.all(Column)) + def reset_cache(self): + for attr in ['all_cells', 'all_columns']: + try: + delattr(self, attr) + except AttributeError: pass def solve_step(self): """Derive everything that can be concluded from the current state. @@ -431,20 +435,14 @@ def save_geometry_qt(self): def restore_geometry_qt(self, value): self.restoreGeometry(QByteArray.fromBase64(value.encode('ascii'))) - def reset_cache(self): - for attr in ['all_cells', 'all_columns']: - try: - delattr(self, attr) - except AttributeError: pass - def close_file(self): self.current_file = None self.scene.clear() self.scene.remaining = 0 self.scene.mistakes = 0 + self.scene.reset_cache() for it in [self.title_label, self.author_align_label, self.author_label, self.information_label]: it.hide() - self.reset_cache() self.copy_action.setEnabled(False) return True