Skip to content

Commit

Permalink
Merge pull request #60 from VortexAcherontic/refac_volumes
Browse files Browse the repository at this point in the history
Minor refactor for volumes
  • Loading branch information
Dvlv authored Feb 20, 2024
2 parents 41c1903 + dccd5f7 commit a80bfb4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,20 +663,22 @@ fn create_new_distrobox(window: &ApplicationWindow) {

let mut volumes: Vec<String> = vec![];
if volume_box_list_clone.is_visible() {
while let Some(row) = volume_box_list_clone.last_child() {
let entry_row = row
.first_child()
let mut index = 0;
let mut row = volume_box_list_clone.row_at_index(index);
while row != None {
let entry_row = row.clone()
.unwrap().first_child()
.unwrap()
.first_child()
.unwrap()
.first_child()
.unwrap()
.downcast::<adw::EntryRow>()
.unwrap();

let volume_arg = format!("{}:{}", entry_row.title(), entry_row.text());
volumes.push(volume_arg);
volume_box_list_clone.remove(&row);
index += 1;
row = volume_box_list_clone.row_at_index(index);
}
}

Expand Down

0 comments on commit a80bfb4

Please sign in to comment.