summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-01-04 22:21:39 +0100
committerhut <hut@lavabit.com>2012-01-04 22:21:39 +0100
commit8d0782c20ce033ae69fa6f134f68af0e9862acdc (patch)
tree8901f956ddae53b1c36ba4c0a989ce257d2a3e38
parentdd7e3aea6df8d3b85dd6ada555198f4a2209c78f (diff)
downloadranger-8d0782c20ce033ae69fa6f134f68af0e9862acdc.tar.gz
widgets.statusbar: Include marked directory sizes in statusbar summary
-rw-r--r--ranger/core/actions.py1
-rw-r--r--ranger/gui/widgets/statusbar.py6
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='') +
15-02-25 01:24:11 -0800 committer Kartik K. Agaram <vc@akkartik.com> 2015-02-25 01:24:11 -0800 832 - call-stack for C++ version' href='/akkartik/mu/commit/cpp/.traces/get?h=main&id=6f5d7864f6c0c62b8849349cb182c61f8dbed452'>6f5d7864 ^
ab9e2eae ^
57699011 ^
6f5d7864 ^
916ae8f5 ^
916ae8f5 ^

ab9e2eae ^


57699011 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28