Skip to content

Commit

Permalink
eos: Blacklist web link applications
Browse files Browse the repository at this point in the history
Web links are managed by a different application in EOS.

https://phabricator.endlessm.com/T11685
  • Loading branch information
joaquimrocha committed Mar 2, 2018
1 parent 035083c commit 97738d8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions plugins/eos/gs-plugin-eos.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ gs_plugin_destroy (GsPlugin *plugin)
g_hash_table_destroy (priv->desktop_apps);
}

static gboolean
gs_plugin_eos_blacklist_if_needed (GsApp *app)
{
if (g_str_has_prefix (gs_app_get_id (app), "eos-link-")) {
gs_app_add_category (app, "Blacklisted");
return TRUE;
}

return FALSE;
}

static void
gs_plugin_eos_update_app_shortcuts_info (GsPlugin *plugin,
GsApp *app)
Expand Down Expand Up @@ -222,6 +233,14 @@ gs_plugin_adopt_app (GsPlugin *plugin, GsApp *app)
gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
}

static void
gs_plugin_eos_refine_core_app (GsApp *app)
{
/* we only allow to remove flatpak apps */
if (!app_is_flatpak (app))
gs_app_add_quirk (app, AS_APP_QUIRK_COMPULSORY);
}

gboolean
gs_plugin_refine (GsPlugin *plugin,
GsAppList *list,
Expand All @@ -232,6 +251,11 @@ gs_plugin_refine (GsPlugin *plugin,
for (guint i = 0; i < gs_app_list_length (list); ++i) {
GsApp *app = gs_app_list_index (list, i);

gs_plugin_eos_refine_core_app (app);

if (gs_plugin_eos_blacklist_if_needed (app))
continue;

if (gs_app_get_kind (app) != AS_APP_KIND_DESKTOP)
continue;

Expand Down

0 comments on commit 97738d8

Please sign in to comment.