mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-13 15:55:05 +09:00
Add support for flatpak+https:// uri
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
# Translators: Do not translate the application name
|
||||
Name=Warehouse
|
||||
Exec=warehouse %F
|
||||
Exec=warehouse %U
|
||||
Icon=io.github.flattool.Warehouse
|
||||
Terminal=false
|
||||
Type=Application
|
||||
@@ -10,4 +10,4 @@ StartupNotify=true
|
||||
Keywords=flatpak;packages;apps;remotes;snapshots;
|
||||
Comment=Manage all things Flatpak
|
||||
X-Purism-FormFactor=Workstation;Mobile;
|
||||
MimeType=application/vnd.flatpak.ref;application/vnd.flatpak;x-scheme-handler/flatpak;application/vnd.flatpak.repo
|
||||
MimeType=application/vnd.flatpak.ref;application/vnd.flatpak;x-scheme-handler/flatpak;x-scheme-handler/flatpak+https;x-scheme-handler/flatpak+http;application/vnd.flatpak.repo
|
||||
|
||||
@@ -45,11 +45,12 @@ class SelectPage(Adw.NavigationPage):
|
||||
requests = []
|
||||
for file in file_names:
|
||||
# sadly flatpak doesn't support multiple local installs in one command :(
|
||||
file_ref = file.get_path() or file.get_uri()
|
||||
requests.append(
|
||||
{
|
||||
"remote": "local_file",
|
||||
"installation": installation,
|
||||
"package_names": [file.get_path()],
|
||||
"package_names": [file_ref],
|
||||
"extra_flags": [],
|
||||
}
|
||||
)
|
||||
|
||||
11
src/main.py
11
src/main.py
@@ -206,10 +206,15 @@ class WarehouseApplication(Adw.Application):
|
||||
|
||||
if len(args) > 1: # First arg is program name
|
||||
files = []
|
||||
for path in args[1:]:
|
||||
gfile = Gio.File.new_for_path(path)
|
||||
if gfile.query_exists():
|
||||
for arg in args[1:]:
|
||||
if arg.startswith("flatpak+https://") or arg.startswith("flatpak+http://"):
|
||||
url = arg[len("flatpak+"):]
|
||||
gfile = Gio.File.new_for_uri(url)
|
||||
files.append(gfile)
|
||||
else:
|
||||
gfile = Gio.File.new_for_path(arg)
|
||||
if gfile.query_exists():
|
||||
files.append(gfile)
|
||||
|
||||
if files:
|
||||
self.open(files, "")
|
||||
|
||||
@@ -129,9 +129,9 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
paks = []
|
||||
remotes = []
|
||||
for file in value:
|
||||
path = file.get_path()
|
||||
path = file.get_path() or file.get_uri()
|
||||
if path.endswith(".flatpak") or path.endswith(".flatpakref"):
|
||||
paks.append(Gio.File.new_for_path(path))
|
||||
paks.append(file)
|
||||
elif path.endswith(".flatpakrepo"):
|
||||
remotes.append(path)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user