Browse Source

Make ".." always appear even if dir is unlistable (likely lacking permissions), closes #1938

Juan Linietsky 9 years ago
parent
commit
adc13e9027
2 changed files with 10 additions and 0 deletions
  1. 5 0
      scene/gui/file_dialog.cpp
  2. 5 0
      tools/editor/editor_file_dialog.cpp

+ 5 - 0
scene/gui/file_dialog.cpp

@@ -339,6 +339,11 @@ void FileDialog::update_file_list() {
 		}
 	}
 
+	if (dirs.find("..")==NULL) {
+		//may happen if lacking permissions
+		dirs.push_back("..");
+	}
+
 	dirs.sort_custom<NoCaseComparator>();
 	files.sort_custom<NoCaseComparator>();
 

+ 5 - 0
tools/editor/editor_file_dialog.cpp

@@ -536,6 +536,11 @@ void EditorFileDialog::update_file_list() {
 		}
 	}
 
+	if (dirs.find("..")==NULL) {
+		//may happen if lacking permissions
+		dirs.push_back("..");
+	}
+
 	dirs.sort_custom<NoCaseComparator>();
 	files.sort_custom<NoCaseComparator>();