From 8d0782c20ce033ae69fa6f134f68af0e9862acdc Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 4 Jan 2012 22:21:39 +0100 Subject: widgets.statusbar: Include marked directory sizes in statusbar summary --- ranger/core/actions.py | 1 + ranger/gui/widgets/statusbar.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 1fe99ada..8106a89b 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -122,6 +122,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): def get_cumulative_size(self): for f in self.env.get_selection() or (): f.look_up_cumulative_size() + self.ui.status.request_redraw() self.ui.redraw_main_column() def redraw_window(self): diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index a7d3fc73..7948b201 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -236,9 +236,9 @@ class StatusBar(Widget): if len(target.marked_items) == len(target.files): right.add(human_readable(target.disk_usage, separator='')) else: - right.add(human_readable(sum(f.size \ - for f in target.marked_items \ - if f.is_file), separator='')) + sumsize = sum(f.size for f in target.marked_items if not + f.is_directory or f._cumulative_size_calculated) + right.add(human_readable(sumsize, separator='')) right.add("/" + str(len(target.marked_items))) else: right.add(human_readable(target.disk_usage, separator='') + -- cgit 1.4.1-2-gfad0