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 16:15:25 +0500
commit957c90d496377e8bd1c194aa8ae3147313747bce (patch)
treee2f9f9c2e4a51431f22fb8eb47f63f2b441f506d
parent218190749390dc1851861e0d3839a9cc681e6a14 (diff)
downloadepiphany-wip/exalm/webapps.tar.gz
Skip system web apps for about:applicationswip/exalm/webapps
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.c18
-rw-r--r--lib/ephy-web-app-utils.h2
3 files changed, 23 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..979856f21 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -963,3 +963,21 @@ ephy_web_application_save (EphyWebApplication *app)
return saved;
}
+
+gboolean
+ephy_web_application_is_system (EphyWebApplication *app)
+{
+ GSettings *settings;
+ 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