[epiphany/gnome-41] Fix web app GApplication ID calculation
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-41] Fix web app GApplication ID calculation
- Date: Wed, 19 Jan 2022 22:57:10 +0000 (UTC)
commit e88a29c4be76da1c7ce5497e0e7bccd24de61879
Author: Phaedrus Leeds <mwleeds protonmail com>
Date: Wed Jan 19 14:47:09 2022 -0800
Fix web app GApplication ID calculation
In get_gapplication_id_from_id() we sometimes make the GApp ID
"org.gnome.Epiphany.WebApp-<checksum>". This is then used as the profile
directory name. The profile directory is then used to calculate the id
in ephy_web_application_setup_from_profile_directory(). But in
get_app_id_from_gapplication_id() we return whatever's after the
"WebApp-" prefix, since there's no way to recover the "normalized name"
part of the ID. So, the functions that handle the ID need to work when
it's just the checksum part without the normalized name.
This is all very confusing and we should probably find a way to make it
all simpler some day :/
Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1063>
lib/ephy-web-app-utils.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 833dcdd7a..b0d94401a 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -129,10 +129,11 @@ get_gapplication_id_from_id (const char *id)
/* Split ID into: <normalized-name>-<checksum> */
final_hyphen = strrchr (id, '-');
if (!final_hyphen) {
- g_warning ("Web app ID %s is broken: must contain a hyphen", id);
- return NULL;
+ /* The id was derived from the profile dir and it's only the checksum part */
+ checksum = id;
+ } else {
+ checksum = final_hyphen + 1;
}
- checksum = final_hyphen + 1;
if (*checksum == '\0') {
g_warning ("Web app ID %s is broken: should end with checksum, not hyphen", id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]