[gnome-software/wip/jrocha/install-updated-apps-runtimes: 1/2] flatpak: Setup scope when refining the origin
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/jrocha/install-updated-apps-runtimes: 1/2] flatpak: Setup scope when refining the origin
- Date: Thu, 25 Jan 2018 09:28:42 +0000 (UTC)
commit 1be12fd99f43b3f25bcf5b1edaa996b066de0b3c
Author: Joaquim Rocha <jrocha endlessm com>
Date: Thu Oct 26 22:44:02 2017 +0200
flatpak: Setup scope when refining the origin
This will set the scope of apps when refining their origin as it's a
good chance to do it (we already know which installation the app is
coming from). This way we prevent having to eventually set up the
scope later which would have to look for the ref again which has some
impact in the performance.
plugins/flatpak/gs-flatpak.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 1b46fd83..1675f850 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1429,6 +1429,11 @@ gs_flatpak_refine_origin_from_installation (GsFlatpak *self,
g_debug ("found remote %s", remote_name);
gs_app_set_origin (app, remote_name);
gs_flatpak_app_set_commit (app, flatpak_ref_get_commit (FLATPAK_REF (xref)));
+ if (gs_app_get_scope (app) == AS_APP_SCOPE_UNKNOWN) {
+ AsAppScope scope = flatpak_installation_get_is_user (installation)
+ ? AS_APP_SCOPE_USER : AS_APP_SCOPE_SYSTEM;
+ gs_app_set_scope (app, scope);
+ }
return TRUE;
}
g_debug ("failed to find remote %s: %s",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]