Finally no race conds
This commit is contained in:
parent
e4a605915d
commit
cae58cb750
@ -240,7 +240,7 @@ pub fn create_efi_row(
|
||||
move |row: DriveMountRow| {
|
||||
listbox.remove(&row);
|
||||
(*used_partition_array_refcell.borrow_mut())
|
||||
.retain(|x| &x.partition.part_name != &row.partition());
|
||||
.retain(|x| x.used_by != row.id());
|
||||
partition_changed_action.activate(Some(
|
||||
&glib::variant::Variant::from_data_with_type(
|
||||
row.id().to_string(),
|
||||
@ -472,7 +472,7 @@ pub fn create_boot_row(
|
||||
move |row: DriveMountRow| {
|
||||
listbox.remove(&row);
|
||||
(*used_partition_array_refcell.borrow_mut())
|
||||
.retain(|x| &x.partition.part_name != &row.partition());
|
||||
.retain(|x| x.used_by != row.id());
|
||||
partition_changed_action.activate(Some(
|
||||
&glib::variant::Variant::from_data_with_type(
|
||||
row.id().to_string(),
|
||||
@ -709,7 +709,7 @@ pub fn create_root_row(
|
||||
move |row: DriveMountRow| {
|
||||
listbox.remove(&row);
|
||||
(*used_partition_array_refcell.borrow_mut())
|
||||
.retain(|x| &x.partition.part_name != &row.partition());
|
||||
.retain(|x| x.used_by != row.id());
|
||||
partition_changed_action.activate(Some(
|
||||
&glib::variant::Variant::from_data_with_type(
|
||||
row.id().to_string(),
|
||||
@ -910,7 +910,7 @@ pub fn create_mount_row(
|
||||
move |row: DriveMountRow| {
|
||||
listbox.remove(&row);
|
||||
(*used_partition_array_refcell.borrow_mut())
|
||||
.retain(|x| &x.partition.part_name != &row.partition());
|
||||
.retain(|x| x.used_by != row.id());
|
||||
partition_changed_action.activate(Some(
|
||||
&glib::variant::Variant::from_data_with_type(
|
||||
row.id().to_string(),
|
||||
@ -989,7 +989,7 @@ fn post_check_drive_mount(
|
||||
}
|
||||
} else {
|
||||
(*used_partition_array_refcell.borrow_mut())
|
||||
.retain(|x| &x.partition.part_name != &row.partition());
|
||||
.retain(|x| x.used_by != row.id());
|
||||
}
|
||||
partition_changed_action.activate(Some(
|
||||
&glib::variant::Variant::from_data_with_type(
|
||||
@ -1009,6 +1009,12 @@ fn post_check_drive_mount(
|
||||
#[strong]
|
||||
null_checkbutton,
|
||||
#[strong]
|
||||
null_checkbutton,
|
||||
#[strong]
|
||||
used_partition_array_refcell,
|
||||
#[strong]
|
||||
partition_changed_action,
|
||||
#[strong]
|
||||
partition,
|
||||
#[strong]
|
||||
row,
|
||||
@ -1024,7 +1030,15 @@ fn post_check_drive_mount(
|
||||
}
|
||||
} else {
|
||||
(*partition_row_struct.swap_fs_error.borrow_mut()) = true;
|
||||
(*used_partition_array_refcell.borrow_mut()).retain(|x| x.used_by != row.id());
|
||||
null_checkbutton.set_active(true);
|
||||
row.set_partition("");
|
||||
partition_changed_action.activate(Some(
|
||||
&glib::variant::Variant::from_data_with_type(
|
||||
row.id().to_string(),
|
||||
glib::VariantTy::STRING,
|
||||
),
|
||||
));
|
||||
partition_row_struct.widget.set_sensitive(false);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user