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')
previous revision' href='/akspecs/ranger/blame/doc/pydoc/ranger.gui.widgets.taskview.html?id=2ca2e862e616eba862ac80f5ee0003d1aa984a32'>^
4c13e1f2 ^

























34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^




62cd83ba ^
4c13e1f2 ^


ef0157ff ^
4c13e1f2 ^


c9383c72 ^
4c13e1f2 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152