mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-10 03:01:44 +01:00
59 lines
2.9 KiB
Diff
59 lines
2.9 KiB
Diff
diff --git a/meson.build b/meson.build
|
|
index bd96b9b..49f7127 100644
|
|
--- a/meson.build
|
|
+++ b/meson.build
|
|
@@ -27,8 +27,8 @@ sqlite = dependency('sqlite3', version: '>= 3.8')
|
|
xml = dependency('libxml-2.0', version: '>= 2.9')
|
|
|
|
if get_option('webkit')
|
|
- soup = dependency('libsoup-2.4', version: '>= 2.62')
|
|
- webkit = dependency('webkit2gtk-4.0', version: '>= 2.24')
|
|
+ soup = dependency('libsoup-3.0', version: '>= 2.62')
|
|
+ webkit = dependency('webkit2gtk-4.1', version: '>= 2.24')
|
|
add_global_arguments('-D', 'HAVE_WEBKIT', language: 'vala')
|
|
endif
|
|
|
|
diff --git a/src/font-manager/web/google/GoogleFonts.vala b/src/font-manager/web/google/GoogleFonts.vala
|
|
index 6139e17..1430d99 100644
|
|
--- a/src/font-manager/web/google/GoogleFonts.vala
|
|
+++ b/src/font-manager/web/google/GoogleFonts.vala
|
|
@@ -156,10 +156,15 @@ namespace FontManager.GoogleFonts {
|
|
foreach (var entry in order) {
|
|
string filename = "gfc-%s.json".printf(entry);
|
|
var message = new Soup.Message(GET, WEBFONTS.printf(GFC_API_KEY, entry));
|
|
- if (session.send_message(message) == Soup.Status.OK) {
|
|
+ GLib.Bytes? bytes = null;
|
|
+ try {
|
|
+ bytes = session.send_and_read(message, null);
|
|
+ } catch (GLib.Error e) {
|
|
+ warning("Failed to fetch webfont %s", filename);
|
|
+ }
|
|
+ if (message.get_status() == Soup.Status.OK && bytes != null) {
|
|
string filepath = Path.build_filename(get_package_cache_directory(), filename);
|
|
try {
|
|
- Bytes bytes = message.response_body.flatten().get_as_bytes();
|
|
File cache_file = File.new_for_path(filepath);
|
|
if (cache_file.query_exists())
|
|
cache_file.delete();
|
|
diff --git a/src/font-manager/web/google/WebFont.vala b/src/font-manager/web/google/WebFont.vala
|
|
index d4f1494..d2bd446 100644
|
|
--- a/src/font-manager/web/google/WebFont.vala
|
|
+++ b/src/font-manager/web/google/WebFont.vala
|
|
@@ -42,9 +42,14 @@ namespace FontManager.GoogleFonts {
|
|
string filename = font.get_filename();
|
|
string filepath = Path.build_filename(font_dir, filename);
|
|
var message = new Soup.Message(GET, font.url);
|
|
- if (session.send_message(message) == Soup.Status.OK) {
|
|
+ GLib.Bytes? bytes = null;
|
|
+ try {
|
|
+ bytes = session.send_and_read(message, null);
|
|
+ } catch (GLib.Error e) {
|
|
+ warning("Failed to fetch webfont %s", filename);
|
|
+ }
|
|
+ if (message.get_status() == Soup.Status.OK && bytes != null) {
|
|
try {
|
|
- Bytes bytes = message.response_body.flatten().get_as_bytes();
|
|
File font_file = File.new_for_path(filepath);
|
|
if (font_file.query_exists())
|
|
font_file.delete();
|