mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-15 00:34:42 +09:00
Trash data instead of deleting data
Upon single flatpak uninstall and batch uninstall, the user can choose to trash user data. This makes it so that data is trashed instead of deleted
This commit is contained in:
@@ -116,6 +116,7 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
|
||||
return total
|
||||
|
||||
def uninstall_response(self, widget, response_id, _c, index):
|
||||
app_id = self.host_flatpaks[index][2]
|
||||
ref = self.host_flatpaks[index][8]
|
||||
name = self.host_flatpaks[index][0]
|
||||
command = ["flatpak-spawn", "--host", "flatpak", "remove", ref, "-y"]
|
||||
@@ -123,7 +124,7 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
|
||||
self.should_pulse = False
|
||||
return 1
|
||||
if response_id == "purge":
|
||||
command.append("--delete-data")
|
||||
subprocess.run(['flatpak-spawn', '--host', 'gio', 'trash', f"{self.user_data_path}{app_id}"])
|
||||
|
||||
handler_id = self.connect('close-request', lambda event: True) # Make window unable to close
|
||||
self.main_progress_bar.set_visible(True)
|
||||
@@ -610,7 +611,7 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
|
||||
name = self.host_flatpaks[self.selected_host_flatpak_indexes[i]][0]
|
||||
command = ["flatpak-spawn", "--host", "flatpak", "remove", ref, "-y"]
|
||||
if delete_data:
|
||||
command.append("--delete-data")
|
||||
subprocess.run(['flatpak-spawn', '--host', 'gio', 'trash', f"{self.user_data_path}{app_id}"])
|
||||
|
||||
'''try:
|
||||
subprocess.run(command, capture_output=False, check=True)
|
||||
|
||||
Reference in New Issue
Block a user