diff options
author | nfnty <git@nfnty.se> | 2015-10-13 20:38:27 +0200 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-02-08 04:43:04 +0100 |
commit | 92ed0b31b775dfa25bf417520c830273142a185e (patch) | |
tree | cfd202de07276a797d6f0074d88f49f86ee5d446 /ranger/container/directory.py | |
parent | 6d24d8cdcd6ef1b004f7d6d92374b9297819b503 (diff) | |
download | ranger-92ed0b31b775dfa25bf417520c830273142a185e.tar.gz |
VCS: Separate VCS Thread
Diffstat (limited to 'ranger/container/directory.py')
-rw-r--r-- | ranger/container/directory.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py index 95dbd730..9725ae45 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -306,10 +306,9 @@ class Directory(FileSystemObject, Accumulator, Loadable): files = [] disk_usage = 0 - if self.vcs: - self.vcs.check() - if self.vcs.track: - self.vcs.update() + if self.vcs and self.vcs.track and not self.vcs.is_root: + self.vcspathstatus = self.vcs.get_status_subpath( + self.path, is_directory=True) for name in filenames: try: @@ -339,7 +338,8 @@ class Directory(FileSystemObject, Accumulator, Loadable): if item.vcs.is_root: self.has_vcschild = True else: - item.vcspathstatus = self.vcs.get_status_subpath(item.path) + item.vcspathstatus = self.vcs.get_status_subpath( + item.path, is_directory=True) else: item = File(name, preload=stats, path_is_abs=True, basename_is_rel_to=basename_is_rel_to) @@ -384,6 +384,8 @@ class Directory(FileSystemObject, Accumulator, Loadable): finally: self.loading = False self.fm.signal_emit("finished_loading_dir", directory=self) + if self.vcs: + self.fm.ui.vcsthread.wakeup() def unload(self): self.loading = False @@ -422,7 +424,6 @@ class Directory(FileSystemObject, Accumulator, Loadable): pass self.load_generator = None - def sort(self): """Sort the contained files""" if self.files_all is None: @@ -588,7 +589,8 @@ class Directory(FileSystemObject, Accumulator, Loadable): def load_content_if_outdated(self, *a, **k): """Load the contents of the directory if outdated""" - if self.load_content_once(*a, **k): return True + if self.load_content_once(*a, **k): + return True if self.files_all is None or self.content_outdated: self.load_content(*a, **k) |