fix: fix not defined errors in recursive_add_files_into_tree_store()
recursive_add_files_into_tree_store() tried to refer to 'filepath', which is not defined. Use the parent_file's path to replace 'filepath'. The function also tried to refer to 'files', which is also not defined. Seems to be a typo of 'child_files'.merge-requests/12/head
parent
cc6d331670
commit
8afa897776
|
@ -121,12 +121,13 @@ impl WorkspaceImplementedEditor for EchidnaWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fn recursive_add_files_into_tree_store(&self, parent_file: File, tree: &TreeStore) {
|
fn recursive_add_files_into_tree_store(&self, parent_file: File, tree: &TreeStore) {
|
||||||
let child_enumerate_cancellable = Cancellable::new();
|
let child_enumerate_cancellable = Cancellable::new();
|
||||||
|
|
||||||
let child_files = parent_file
|
let child_files = parent_file
|
||||||
.enumerate_children(
|
.enumerate_children(
|
||||||
"*",
|
"*",
|
||||||
|
@ -135,17 +136,13 @@ fn recursive_add_files_into_tree_store(&self, parent_file: File, tree: &TreeStor
|
||||||
)
|
)
|
||||||
.expect(
|
.expect(
|
||||||
format!(
|
format!(
|
||||||
"Could not look up the children files of {:?} because:\n{:#?}",
|
"Could not look up the children files of {:?} because:",
|
||||||
filepath
|
parent_file.path().expect("No path for the parent file")
|
||||||
)
|
)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
);
|
);
|
||||||
let filepath = &parent_file
|
for file_iter in child_files {
|
||||||
.path()
|
let file_info = file_iter.expect("Could not get the file info");
|
||||||
.expect("Could not get the file path of the file.");
|
|
||||||
|
|
||||||
for file_iter in files {
|
|
||||||
let file_info = file_iter.expect();
|
|
||||||
let file = parent_file.child(file_info.name());
|
let file = parent_file.child(file_info.name());
|
||||||
let tree_iter = tree.append(None);
|
let tree_iter = tree.append(None);
|
||||||
tree.set_value(&tree_iter, 2, &file_info.name().to_str().to_value());
|
tree.set_value(&tree_iter, 2, &file_info.name().to_str().to_value());
|
||||||
|
|
Loading…
Reference in New Issue