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

Adapted th qt part to core.gui.directory_tree.

This commit is contained in:
Virgil Dupras
2010-02-07 16:00:58 +01:00
parent b5dd9651c3
commit 76d351d8be
5 changed files with 26 additions and 49 deletions

View File

@@ -23,6 +23,11 @@ class DirectoryNode(Node):
self._loaded = False
self._state = STATE_ORDER.index(self._app.directories.get_state(path))
def __len__(self):
if not self._loaded:
self._load()
return Node.__len__(self)
def _load(self):
self.clear()
subpaths = self._app.directories.get_subfolders(self._directory_path)
@@ -30,12 +35,6 @@ class DirectoryNode(Node):
self.append(DirectoryNode(self._app, path, path[-1]))
self._loaded = True
@property
def children_count(self):
if not self._loaded:
self._load()
return len(self)
# The state propery is an index to the combobox
@property
def state(self):