Sort rooms by name
This commit is contained in:
parent
05592edd40
commit
de0937f35a
1 changed files with 8 additions and 1 deletions
|
@ -213,10 +213,17 @@ impl AppOp {
|
|||
let store: gtk::TreeStore = self.gtk_builder.get_object("rooms_tree_store")
|
||||
.expect("Couldn't find rooms_tree_store in ui file.");
|
||||
|
||||
let mut array: Vec<(String, String)> = vec![];
|
||||
for (id, name) in rooms {
|
||||
array.push((name, id));
|
||||
}
|
||||
|
||||
array.sort_by(|x, y| x.0.to_lowercase().cmp(&y.0.to_lowercase()));
|
||||
|
||||
for v in array {
|
||||
store.insert_with_values(None, None,
|
||||
&[0, 1],
|
||||
&[&name, &id]);
|
||||
&[&v.0, &v.1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue