summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <exalm7659@gmail.com>2020-09-25 16:14:18 +0500
committerAlexander Mikhaylenko <alexm@gnome.org>2020-09-25 18:00:02 +0500
commitc299c9b97415663475b181455db6fae57f7f1664 (patch)
treea74ddf1f353876ec221f4d82a9e20308127a44c5
parente6b7c0cc8410068ea9542f7ad6ea1f4ac608a9d3 (diff)
downloadepiphany-c299c9b97415663475b181455db6fae57f7f1664.tar.gz
Skip system web apps for about:applications
They cannot be deleted as we don't control their desktop file. Don't show them at all.
-rw-r--r--embed/ephy-about-handler.c3
-rw-r--r--lib/ephy-web-app-utils.c17
-rw-r--r--lib/ephy-web-app-utils.h2
3 files changed, 22 insertions, 0 deletions
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index 029aa64c6..597a1654e 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -264,6 +264,9 @@ handle_applications_finished_cb (EphyAboutHandler *handler,
for (p = applications; p; p = p->next) {
EphyWebApplication *app = (EphyWebApplication *)p->data;
+ if (ephy_web_application_is_system (app))
+ continue;
+
g_string_append_printf (data_str,
"<tbody><tr id =\"%s\">"
"<td class=\"icon\"><img width=64 height=64 src=\"file://%s\"></img></td>"
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 086d794b7..d89bdca58 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -963,3 +963,20 @@ ephy_web_application_save (EphyWebApplication *app)
return saved;
}
+
+gboolean
+ephy_web_application_is_system (EphyWebApplication *app)
+{
+ GSettings *web_app_settings;
+ g_autofree char *profile_directory = NULL;
+ g_autofree char *name = NULL;
+ g_autofree char *path = NULL;
+
+ profile_directory = ephy_web_application_get_profile_directory (app->id);
+ name = g_path_get_basename (profile_directory);
+
+ path = g_build_path ("/", "/org/gnome/epiphany/web-apps/", name, "webapp/", NULL);
+ web_app_settings = g_settings_new_with_path (EPHY_PREFS_WEB_APP_SCHEMA, path);
+
+ return g_settings_get_boolean (web_app_settings, EPHY_PREFS_WEB_APP_SYSTEM);
+}
diff --git a/lib/ephy-web-app-utils.h b/lib/ephy-web-app-utils.h
index 0044abf94..3d68263e6 100644
--- a/lib/ephy-web-app-utils.h
+++ b/lib/ephy-web-app-utils.h
@@ -77,4 +77,6 @@ gboolean ephy_web_application_is_uri_allowed (const char *uri);
gboolean ephy_web_application_save (EphyWebApplication *app);
+gboolean ephy_web_application_is_system (EphyWebApplication *app);
+
G_END_DECLS