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