Add system modification tracking for reversible installs

This commit is contained in:
lashman
2026-02-27 23:35:27 +02:00
parent 6e2e7e8e36
commit 8dd0dc71ed
9 changed files with 207 additions and 10 deletions

View File

@@ -969,6 +969,7 @@ fn build_system_tab(record: &AppImageRecord, db: &Rc<Database>, toast_overlay: &
},
);
} else {
integrator::undo_all_modifications(&db_ref, record_id).ok();
integrator::remove_integration(&record_clone).ok();
db_ref.set_integrated(record_id, false, None).ok();
}

View File

@@ -131,7 +131,7 @@ pub fn show_duplicate_dialog(
let mut removed_count = 0;
for (record_id, record_path, _record_name, integrated) in records.iter() {
if *integrated {
// Fetch the full record to properly remove integration
integrator::undo_all_modifications(&db_confirm, *record_id).ok();
if let Ok(Some(full_record)) = db_confirm.get_appimage_by_id(*record_id) {
integrator::remove_integration(&full_record).ok();
}
@@ -260,6 +260,7 @@ fn build_group_widget(
delete_btn.connect_clicked(move |btn| {
// Remove integration if any
if record_clone.integrated {
integrator::undo_all_modifications(&db_ref, record_id).ok();
integrator::remove_integration(&record_clone).ok();
db_ref.set_integrated(record_id, false, None).ok();
}

View File

@@ -192,7 +192,7 @@ pub fn show_integration_dialog(
dialog.connect_response(None, move |_dialog, response| {
if response == "integrate" {
match integrator::integrate(&record_clone) {
match integrator::integrate_tracked(&record_clone, &db_ref) {
Ok(result) => {
if let Some(ref icon_path) = result.icon_install_path {
log::info!("Icon installed to: {}", icon_path.display());