FileBrowser: Added an empty item when there are no files in the current folder
This commit is contained in:
		| @@ -736,6 +736,12 @@ class fileBrowser(Listbox): | |||||||
| 						continue | 						continue | ||||||
| 				files.append((os.path.abspath(i), i)) | 				files.append((os.path.abspath(i), i)) | ||||||
| 		folders.extend(files) | 		folders.extend(files) | ||||||
|  | 		# If there are no files or directories, let's say "empty" | ||||||
|  | 		# This will avoid the program to crash and will look nicer. | ||||||
|  | 		if len(folders) == 0: | ||||||
|  | 			folders.append(("collapse", _("empty"))) | ||||||
|  | 		if len(folders) | ||||||
|  |  | ||||||
| 		return folders | 		return folders | ||||||
|  |  | ||||||
| 	def getDir(self): | 	def getDir(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user