about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/fsobject/directory.py36
-rw-r--r--ranger/gui/widgets/filelist.py6
2 files changed, 21 insertions, 21 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index f5aeade4..136752f8 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -170,32 +170,33 @@ class Directory(FileSystemObject, SettingsAware):
 		self.loading = False
 		self.load_generator = None
 
-	def load_content(self, schedule=False):
+	def load_content(self, schedule=None):
 		"""
 		Loads the contents of the directory. Use this sparingly since
 		it takes rather long.
 		"""
 
-		self.load_once()
-		
-		if schedule is None:
-			schedule = self.size > 30
+		if not self.loading:
+			self.load_once()
+			
+			if schedule is None:
+				schedule = self.size > 30
+
+			if self.load_generator is None:
+				self.load_generator = self.load_bit_by_bit()
 
-		if self.load_generator is None:
-			self.load_generator = self.load_bit_by_bit()
+				if schedule and self.fm:
+					self.fm.loader.add(self)
+				else:
+					for _ in self.load_generator:
+						pass
+					self.load_generator = None
 
-			if schedule and self.fm:
-				self.fm.loader.add(self)
-			else:
+			elif not schedule or not self.fm:
 				for _ in self.load_generator:
 					pass
 				self.load_generator = None
 
-		elif not schedule or not self.fm:
-			for _ in self.load_generator:
-				pass
-			self.load_generator = None
-
 
 	def sort(self):
 		"""Sort the containing files"""
@@ -322,8 +323,7 @@ class Directory(FileSystemObject, SettingsAware):
 	def load_content_once(self, *a, **k):
 		"""Load the contents of the directory if not done yet"""
 		if not self.content_loaded:
-			if not self.loading:
-				self.load_content(*a, **k)
+			self.load_content(*a, **k)
 			return True
 		return False
 
@@ -351,7 +351,7 @@ class Directory(FileSystemObject, SettingsAware):
 			cached_mtime = 0
 
 		if real_mtime != cached_mtime:
-			self.load_content()
+			self.load_content(*a, **k)
 			return True
 		return False
 
diff --git a/ranger/gui/widgets/filelist.py b/ranger/gui/widgets/filelist.py
index 8b4443d3..999cfd12 100644
--- a/ranger/gui/widgets/filelist.py
+++ b/ranger/gui/widgets/filelist.py
@@ -74,7 +74,7 @@ class FileList(Widget):
 
 	def finalize(self):
 		if self.postpone_drawing:
-			self.target.load_content_if_outdated(schedule=None)
+			self.target.load_content_if_outdated()
 			self.draw_directory()
 			self.postpone_drawing = False
 
@@ -140,8 +140,8 @@ class FileList(Widget):
 				self.color_reset()
 				return
 
-		self.target.load_content_if_outdated()
-		self.target.sort_if_outdated()
+		if not self.target.load_content_if_outdated():
+			self.target.sort_if_outdated()
 
 		if self.main_display:
 			base_color.append('maindisplay')
/a> 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304