Fix calling gio trash with no paths, when batch uninstalling packages

This commit is contained in:
heliguy4599
2024-10-10 23:53:41 -04:00
parent 0bd56e3ad1
commit 95dfdaa5cd
2 changed files with 5 additions and 4 deletions

View File

@@ -95,9 +95,10 @@ class PendingPage(Adw.NavigationPage):
package_requests = []
for key, group in self.groups.items():
item = {
'remote': group.remote.name,
'installation': group.installation,
'package_names': [],
"remote": group.remote.name,
"installation": group.installation,
"package_names": [],
"extra_flags": [],
}
for row in group.rows:
item['package_names'].append(row.package.app_id)

View File

@@ -252,7 +252,7 @@ class PackagesPage(Adw.BreakpointBin):
try:
subprocess.run(cmd, check=True, capture_output=True)
if should_trash:
if should_trash and len(to_trash) > 0:
subprocess.run(['gio', 'trash'] + to_trash, check=True, capture_output=True)
except subprocess.CalledProcessError as cpe:
error[0] = cpe