about summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-10-11 07:23:38 +0200
committerhut <hut@lavabit.com>2010-10-11 07:28:02 +0200
commite3ad1e7ecdedcd3f8badec20b243ab2079262e98 (patch)
treebef0c7ddd9f17920eb032582ee3ec3be99f32702 /ranger/core/actions.py
parent3744fed33e482856ffbdd692a4fba1e2ce3037dd (diff)
downloadranger-e3ad1e7ecdedcd3f8badec20b243ab2079262e98.tar.gz
widgets.browserview: fix collapse_preview option
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r--ranger/core/actions.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 235be620..a815b111 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -581,6 +581,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			# self.previews['/tmp/foo.jpg'][(80, 24)] = "the content..."
 			# self.previews['/tmp/foo.jpg']['loading'] = False
 			# A -1 in tuples means "any"; (80, -1) = wid. of 80 and any hei.
+			# The key 'foundpreview' is added later. Values in (True, False)
 			try:
 				data = self.previews[path]
 			except:
@@ -600,6 +601,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 					exit = signal.process.poll()
 					content = signal.loader.stdout_buffer
 					content += signal.process.stdout.read()
+					data['foundpreview'] = True
 					if exit == 0:
 						data[(width, height)] = content
 					elif exit == 3:
@@ -608,8 +610,11 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 						data[(width, -1)] = content
 					elif exit == 5:
 						data[(-1, -1)] = content
+					elif exit == 1:
+						data[(-1, -1)] = None
+						data['foundpreview'] = False
 					else:
-						data[(-1, -1)] = None # XXX
+						data[(-1, -1)] = None
 					if self.env.cf.path == path:
 						self.ui.browser.pager.need_redraw = True
 						self.ui.browser.need_redraw = True