about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-31 05:35:08 +0200
committerhut <hut@lavabit.com>2010-03-31 05:35:08 +0200
commit4fdc58b802cb6e67c3f87c41570e00fdd0432312 (patch)
treedab17b605fa440df5c312ef513821c09f2f83173
parenta614f0485f872bfca3a84fb3400a0c6177988413 (diff)
downloadranger-4fdc58b802cb6e67c3f87c41570e00fdd0432312.tar.gz
fsobject.directory: removed traces of old_*
That mechanism is obsolete since signals were implemented
-rw-r--r--ranger/fsobject/directory.py35
1 files changed, 7 insertions, 28 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 140faef1..8f9dd1cf 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -59,9 +59,6 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 
 	order_outdated = False
 	content_outdated = False
-	old_show_hidden = None
-	old_filter = None
-	old_hidden_filter = None
 
 	sort_dict = {
 		'basename': sort_by_basename,
@@ -81,26 +78,14 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 
 		self.marked_items = list()
 
-		# to find out if something has changed:
-		self.old_show_hidden = self.settings.show_hidden
-		self.old_filter = self.filter
-		self.old_hidden_filter = self.settings.hidden_filter
+		for opt in ('sort_directories_first', 'sort', 'sort_reverse',
+				'sort_case_insensitive'):
+			self.settings.signal_bind('setopt.' + opt,
+					self.request_resort, weak=True)
 
-		self.handlers = []
-		lst = ('sort_directories_first', 'sort', 'sort_reverse',
-				'sort_case_insensitive')
-		for opt in lst:
-			self.handlers.append(self.settings.signal_bind('setopt.' + opt,
-					self.request_resort, weak=True))
-
-		lst = ('filter', 'hidden_filter', 'show_hidden')
-		for opt in lst:
-			self.handlers.append(self.settings.signal_bind('setopt.' + opt,
-				self.request_reload, weak=True))
-
-	def __del__(self):
-		for handler in self.handlers:
-			self.settings.signal_unbind(handler)
+		for opt in ('filter', 'hidden_filter', 'show_hidden'):
+			self.settings.signal_bind('setopt.' + opt,
+				self.request_reload, weak=True)
 
 	def request_resort(self):
 		self.order_outdated = True
@@ -224,7 +209,6 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 					else:
 						self.mark_item(item, False)
 
-				self.old_sort_directories_first = None
 				self.sort()
 
 				if len(self.files) > 0:
@@ -304,11 +288,6 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 		else:
 			self.correct_pointer()
 
-		self.old_sort_directories_first = self.settings.sort_directories_first
-		self.old_sort = self.settings.sort
-		self.old_sort_reverse = self.settings.sort_reverse
-		self.old_sort_case_insensitive = self.settings.sort_case_insensitive
-
 	def sort_if_outdated(self):
 		"""Sort the containing files if they are outdated"""
 		if self.order_outdated: