summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-12 10:38:27 +0200
committerhut <hut@lavabit.com>2010-04-12 11:27:52 +0200
commit444f836128a96ec877d1a4a7412be5d185cc6464 (patch)
tree128c4e1085cd3dcb1dfcb5b71e4e0553811f545f /ranger
parent44a28601f4e1ab857e75ee4a48f45464f2ff3eff (diff)
downloadranger-444f836128a96ec877d1a4a7412be5d185cc6464.tar.gz
Fixed handling of directories with GC'd subdirs
Diffstat (limited to 'ranger')
-rw-r--r--ranger/fsobject/directory.py5
-rw-r--r--ranger/gui/widgets/statusbar.py11
2 files changed, 9 insertions, 7 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 79e32bff..29f0042c 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -237,6 +237,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 		Loads the contents of the directory. Use this sparingly since
 		it takes rather long.
 		"""
+		self.content_outdated = False
 
 		if not self.loading:
 			self.load_once()
@@ -370,8 +371,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 
 		if self.load_content_once(*a, **k): return True
 
-		if self.content_outdated:
-			self.content_outdated = False
+		if self.files is None or self.content_outdated:
 			self.load_content(*a, **k)
 			return True
 
@@ -403,6 +403,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 		"""The number of containing files"""
 		if not self.accessible or not self.content_loaded:
 			raise ranger.fsobject.NotLoadedYet()
+		assert self.files is not None
 		return len(self.files)
 
 	def __eq__(self, other):
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 75fbbe89..78666a3d 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -146,10 +146,9 @@ class StatusBar(Widget):
 		else:
 			target = self.env.at_level(0).pointed_obj
 
-		if target is None:
-			return
-
-		if target.accessible is False:
+		if target is None \
+				or not target.accessible \
+				or (target.is_directory and target.files is None):
 			return
 
 		perms = target.get_permission_string()
@@ -208,7 +207,9 @@ class StatusBar(Widget):
 		if target is None:
 			return
 
-		if not target.content_loaded or not target.accessible:
+		if target is None \
+				or not target.accessible \
+				or (target.is_directory and target.files is None):
 			return
 
 		pos = target.scroll_begin
03:41 +0200 HACKING: update' href='/akspecs/ranger/commit/HACKING?h=v1.4.2&id=3ee05c163e370d28dfabc9c43b0a3b7c0a212443'>3ee05c16 ^
f8f6f7f9 ^






29028631 ^
f8f6f7f9 ^









f8f6f7f9 ^






dade4742 ^
fd29d7e6 ^
0df1d653 ^
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