summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-23 20:37:23 +0100
committerhut <hut@lavabit.com>2009-12-23 20:37:23 +0100
commit99e6cf47f533a95bfffea93ebecdb7614a8e14f0 (patch)
treecb4efad6adc5eda15dfc5ecf1620bb55c4d80878
parent0f337fce2f5f8ae8890b280fd83bd549bdce7d6b (diff)
downloadranger-99e6cf47f533a95bfffea93ebecdb7614a8e14f0.tar.gz
fixed marking (again)
-rw-r--r--ranger/fsobject/directory.py16
-rw-r--r--ranger/fsobject/fsobject.py2
2 files changed, 7 insertions, 11 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 44c4cf96..d7583025 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -48,7 +48,7 @@ class Directory(SuperClass, SettingsAware):
 		self.old_directories_first = self.settings.directories_first
 	
 	def mark_item(self, item, val):
-		item._mark(bool(val))
+		item._mark(val)
 		if val:
 			if item in self.files:
 				self.marked_items.add(item)
@@ -57,21 +57,17 @@ class Directory(SuperClass, SettingsAware):
 				self.marked_items.remove(item)
 
 	def toggle_mark(self, item):
-		if item.marked:
-			return self.unmark_item(item)
-		return self.mark_item(item)
+		self.mark_item(item, not item.marked)
 
 	def toggle_all_marks(self):
 		for item in self.files:
 			self.toggle_mark(item)
 	
 	def mark_all(self, val):
-		if val:
-			for item in self.files:
-				self.mark_item(item)
-		else:
-			for item in self.files:
-				self.unmark_item(item)
+		for item in self.files:
+			self.mark_item(item, val)
+
+		if not val:
 			self.marked_items.clear()
 			self._clear_marked_items()
 	
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index d968d65f..b1354da1 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -98,7 +98,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 	
 	def _mark(self, boolean):
 		"""Called by directory.mark_item() and similar functions"""
-		self.marked = boolean
+		self.marked = bool(boolean)
 
 	def load(self):
 		"""reads useful information about the filesystem-object from the