summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-03 03:54:00 +0100
committerhut <hut@lavabit.com>2013-02-03 03:54:00 +0100
commite7a99b5aac2dda22566be77ae81af00ca189953a (patch)
tree705a453f91c1dbcb901350291544b08791a4b81e
parent90b8d4399f53490d3180786cb92e7a12f694f92c (diff)
downloadranger-e7a99b5aac2dda22566be77ae81af00ca189953a.tar.gz
fsobject.file: remove is_image(), use existing "image" attribute
-rw-r--r--ranger/core/actions.py4
-rw-r--r--ranger/fsobject/file.py3
-rw-r--r--ranger/gui/widgets/browsercolumn.py2
3 files changed, 3 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 80db1aa5..5ffe315e 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -777,7 +777,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			return
 
 		pager = self.ui.open_embedded_pager()
-		if self.settings.preview_images and self.thisfile.is_image():
+		if self.settings.preview_images and self.thisfile.image:
 			pager.set_image(self.thisfile.realpath)
 		else:
 			pager.set_source(self.thisfile.get_preview_source(pager.wid, pager.hei))
@@ -796,7 +796,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		pager = self.ui.browser.pager
 		path = file.realpath
 
-		if self.settings.preview_images and file.is_image():
+		if self.settings.preview_images and file.image:
 			pager.set_image(path)
 			return None
 
diff --git a/ranger/fsobject/file.py b/ranger/fsobject/file.py
index b79c6c7a..8598a1d6 100644
--- a/ranger/fsobject/file.py
+++ b/ranger/fsobject/file.py
@@ -61,9 +61,6 @@ class File(FileSystemObject):
 			return True
 		return False
 
-	def is_image(self):
-		return self.mimetype and self.mimetype.startswith('image/')
-
 	def has_preview(self):
 		if not self.fm.settings.preview_files:
 			return False
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 02c2a5f0..a5579c15 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -168,7 +168,7 @@ class BrowserColumn(Pager):
 			Pager.close(self)
 			return
 
-		if self.fm.settings.preview_images and self.target.is_image():
+		if self.fm.settings.preview_images and self.target.image:
 			self.set_image(self.target.realpath)
 			Pager.draw(self)
 		else: