mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Fix calling gio trash with no paths, when batch uninstalling packages
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user