Commit a3db60a2 authored by Robert Ancell's avatar Robert Ancell Committed by Georges Basile Stavracas Neto

applications: Rename functions as portal permssions are not Flatpak specific

parent a856740d
Pipeline #69582 passed with stages
in 4 minutes and 10 seconds
......@@ -156,13 +156,13 @@ open_software_cb (GtkButton *button,
g_spawn_async (NULL, (char **)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
}
/* --- flatpak permissions and utilities --- */
/* --- portal permissions and utilities --- */
static gchar **
get_flatpak_permissions (CcApplicationsPanel *self,
const gchar *table,
const gchar *id,
const gchar *app_id)
get_portal_permissions (CcApplicationsPanel *self,
const gchar *table,
const gchar *id,
const gchar *app_id)
{
g_autoptr(GVariant) ret = NULL;
g_autoptr(GVariantIter) iter = NULL;
......@@ -191,11 +191,11 @@ get_flatpak_permissions (CcApplicationsPanel *self,
}
static void
set_flatpak_permissions (CcApplicationsPanel *self,
const gchar *table,
const gchar *id,
const gchar *app_id,
const gchar * const *permissions)
set_portal_permissions (CcApplicationsPanel *self,
const gchar *table,
const gchar *id,
const gchar *app_id,
const gchar * const *permissions)
{
g_autoptr(GError) error = NULL;
......@@ -207,7 +207,7 @@ set_flatpak_permissions (CcApplicationsPanel *self,
NULL,
&error);
if (error)
g_warning ("Error setting Flatpak permissions: %s", error->message);
g_warning ("Error setting portal permissions: %s", error->message);
}
static char *
......@@ -359,7 +359,7 @@ get_notification_allowed (CcApplicationsPanel *self,
}
else
{
g_auto(GStrv) perms = get_flatpak_permissions (self, "notifications", "notification", app_id);
g_auto(GStrv) perms = get_portal_permissions (self, "notifications", "notification", app_id);
*set = perms != NULL;
/* FIXME: needs unreleased xdg-desktop-portals to write permissions on use */
*set = TRUE;
......@@ -380,7 +380,7 @@ set_notification_allowed (CcApplicationsPanel *self,
const gchar *perms[2] = { NULL, NULL };
perms[0] = allowed ? "yes" : "no";
set_flatpak_permissions (self, "notifications", "notification", self->current_flatpak_id, perms);
set_portal_permissions (self, "notifications", "notification", self->current_flatpak_id, perms);
}
}
......@@ -428,7 +428,7 @@ get_device_allowed (CcApplicationsPanel *self,
{
g_auto(GStrv) perms = NULL;
perms = get_flatpak_permissions (self, "devices", device, app_id);
perms = get_portal_permissions (self, "devices", device, app_id);
*set = perms != NULL;
*allowed = perms == NULL || strcmp (perms[0], "no") != 0;
......@@ -444,7 +444,7 @@ set_device_allowed (CcApplicationsPanel *self,
perms[0] = allowed ? "yes" : "no";
perms[1] = NULL;
set_flatpak_permissions (self, "devices", device, self->current_flatpak_id, perms);
set_portal_permissions (self, "devices", device, self->current_flatpak_id, perms);
}
static void
......@@ -478,7 +478,7 @@ get_location_allowed (CcApplicationsPanel *self,
{
g_auto(GStrv) perms = NULL;
perms = get_flatpak_permissions (self, "location", "location", app_id);
perms = get_portal_permissions (self, "location", "location", app_id);
*set = perms != NULL;
*allowed = perms == NULL || strcmp (perms[0], "NONE") != 0;
......@@ -495,7 +495,7 @@ set_location_allowed (CcApplicationsPanel *self,
perms[1] = "0";
perms[2] = NULL;
set_flatpak_permissions (self, "location", "location", self->current_flatpak_id, perms);
set_portal_permissions (self, "location", "location", self->current_flatpak_id, perms);
}
static void
......@@ -1442,7 +1442,7 @@ on_perm_store_ready (GObject *source_object,
if (proxy == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to connect to flatpak permission store: %s",
g_warning ("Failed to connect to portal permission store: %s",
error->message);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment