[gnome-software] Split up permissions and update_permissions
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Split up permissions and update_permissions
- Date: Wed, 16 Jan 2019 20:35:54 +0000 (UTC)
commit 85b97d03663f297865f7dc688df9ef6473da26b4
Author: Kalev Lember <klember redhat com>
Date: Wed Jan 16 21:32:38 2019 +0100
Split up permissions and update_permissions
Since we use the same GsApp for the currently installed app and the
update, we need separate fields for distinguishing between installed and
update permissions.
This fixes installed permissions to correctly show up for apps that are
also updatable.
lib/gs-app.c | 17 +++++++++++++++++
lib/gs-app.h | 3 +++
plugins/flatpak/gs-flatpak.c | 2 +-
src/gs-update-dialog.c | 2 +-
4 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index bcac2d0c..e9d5c063 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -96,6 +96,7 @@ typedef struct
gchar *update_version_ui;
gchar *update_details;
AsUrgencyKind update_urgency;
+ GsAppPermissions update_permissions;
gchar *management_plugin;
guint match_value;
guint priority;
@@ -4574,4 +4575,20 @@ gs_app_set_permissions (GsApp *app, GsAppPermissions permissions)
priv->permissions = permissions;
}
+GsAppPermissions
+gs_app_get_update_permissions (GsApp *app)
+{
+ GsAppPrivate *priv = gs_app_get_instance_private (app);
+
+ return priv->update_permissions;
+}
+
+void
+gs_app_set_update_permissions (GsApp *app, GsAppPermissions update_permissions)
+{
+ GsAppPrivate *priv = gs_app_get_instance_private (app);
+
+ priv->update_permissions = update_permissions;
+}
+
/* vim: set noexpandtab: */
diff --git a/lib/gs-app.h b/lib/gs-app.h
index 2fbce37f..a66c595b 100644
--- a/lib/gs-app.h
+++ b/lib/gs-app.h
@@ -391,6 +391,9 @@ void gs_app_subsume_metadata (GsApp *app,
GsAppPermissions gs_app_get_permissions (GsApp *app);
void gs_app_set_permissions (GsApp *app,
GsAppPermissions permissions);
+GsAppPermissions gs_app_get_update_permissions (GsApp *app);
+void gs_app_set_update_permissions (GsApp *app,
+ GsAppPermissions update_permissions);
G_END_DECLS
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 7428e229..0b1901fb 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -218,7 +218,7 @@ gs_flatpak_set_update_permissions (GsFlatpak *self, GsApp *app, FlatpakInstalled
permissions = perms_from_metadata (keyfile) & ~perms_from_metadata (old_keyfile);
- gs_app_set_permissions (app, permissions);
+ gs_app_set_update_permissions (app, permissions);
if (permissions != GS_APP_PERMISSIONS_NONE)
gs_app_add_quirk (app, GS_APP_QUIRK_NEW_PERMISSIONS);
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 8d348e3c..553cea3b 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -212,7 +212,7 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
if (gs_app_has_quirk (app, GS_APP_QUIRK_NEW_PERMISSIONS)) {
gtk_widget_show (dialog->permissions_section_box);
- populate_permissions_section (dialog, gs_app_get_permissions (app));
+ populate_permissions_section (dialog, gs_app_get_update_permissions (app));
} else {
gtk_widget_hide (dialog->permissions_section_box);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]