diff options
Diffstat (limited to 'src/fringlib/fringwalker.py')
-rw-r--r-- | src/fringlib/fringwalker.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/fringlib/fringwalker.py b/src/fringlib/fringwalker.py index 1bf5c68..d328627 100644 --- a/src/fringlib/fringwalker.py +++ b/src/fringlib/fringwalker.py @@ -15,7 +15,8 @@ class FringWalker( gobject.GObject ): 'list-changed': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)), 'finished': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)), 'manually-stopped': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, () ), - 'progress': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT,gobject.TYPE_INT)), + 'progress': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, + (gobject.TYPE_INT,gobject.TYPE_INT,gobject.TYPE_STRING)), } def __init__(self, sumlistcollection): @@ -35,11 +36,11 @@ class FringWalker( gobject.GObject ): self.thread.stopsignal = True self.thread = None - def _progress_fn(self, walkthread, c, l, r): + def _progress_fn(self, walkthread, c, l, r, currentlyScanning): # only emit if called from the current request if walkthread == self.thread: gtk.gdk.threads_enter() - self.emit("progress", c, l) + self.emit("progress", c, l, currentlyScanning) self.emit("list-changed", r) gtk.gdk.threads_leave() @@ -94,6 +95,7 @@ class WalkThread( threading.Thread ): """ Parse the root directory """ self.result = SumList(self.__uri_tail(self.uri), None, 0) + self.master._progress_fn(self, 0, 1, self.result, self.uri) # write some debug information starttime = time.time() @@ -116,20 +118,20 @@ class WalkThread( threading.Thread ): # emit an intermediate version to fill up the screen while waiting self.result.sort() self.master.collection.set_sumlist(unicode(self.uri),self.result) - self.master._progress_fn(self, 0, len(subdirectories), self.result) # walk the subdirectories c = 0 for directory in subdirectories: c += 1 - self.result.append_child( self.build_tree_gnomevfs(self.uri.append_path(directory)) ) + sub = self.build_tree_gnomevfs(self.uri.append_path(directory)) + self.result.append_child( sub ) if self.stopsignal: return self.result.sort() self.master.collection.set_sumlist(unicode(self.uri),self.result) - self.master._progress_fn(self, c, len(subdirectories), self.result) + self.master._progress_fn(self, c, len(subdirectories), self.result, sub.name) # emit final signal self.master._finished_fn(self,self.result) |