1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Made marking changes much faster and also made data fetching lazy in dupe nodes.

This commit is contained in:
Virgil Dupras
2010-02-12 11:21:39 +01:00
parent 9b82e1478f
commit a4bf1c8be6
6 changed files with 44 additions and 14 deletions

View File

@@ -21,6 +21,9 @@ class GUIObject(Listener):
def dupes_selected(self):
pass
def marking_changed(self):
pass
def results_changed(self):
pass

View File

@@ -19,8 +19,20 @@ class DupeNode(Node):
self._app = app
self._group = group
self._dupe = dupe
self.data = app._get_display_info(dupe, group, False)
self.data_delta = app._get_display_info(dupe, group, True)
self._data = None
self._data_delta = None
@property
def data(self):
if self._data is None:
self._data = self._app._get_display_info(self._dupe, self._group, False)
return self._data
@property
def data_delta(self):
if self._data_delta is None:
self._data_delta = self._app._get_display_info(self._dupe, self._group, True)
return self._data_delta
@property
def markable(self):
@@ -113,6 +125,9 @@ class ResultTree(GUIObject, Tree):
self.view.refresh()
#--- Event Handlers
def marking_changed(self):
self.view.invalidate_markings()
def results_changed(self):
self._refresh()
self.view.refresh()

View File

@@ -21,4 +21,4 @@ class StatsLabel(GUIObject):
def results_changed(self):
self.view.refresh()
marking_changed = results_changed