[gnome-builder/wip/chergert/flatpak-repo] give ui process access to FLATPAK_CONFIG_DIR



commit 686125b90f062f53a754d32012e2fccd7c4a8a1f
Author: Christian Hergert <chergert redhat com>
Date:   Mon Aug 23 20:17:27 2021 -0700

    give ui process access to FLATPAK_CONFIG_DIR

 src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c          | 10 ++++++++--
 .../flatpak/daemon/org.gnome.Builder.Flatpak.Service.xml       |  4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c 
b/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
index 39ff1b86e..f6db2f5b5 100644
--- a/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
+++ b/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
@@ -1322,6 +1322,7 @@ static void
 ipc_flatpak_service_impl_constructed (GObject *object)
 {
   IpcFlatpakServiceImpl *self = (IpcFlatpakServiceImpl *)object;
+  IpcFlatpakRepo *repo = ipc_flatpak_repo_get_default ();
   g_autoptr(GPtrArray) installations = NULL;
   g_autoptr(FlatpakInstallation) user = NULL;
   g_autoptr(GFile) user_file = NULL;
@@ -1342,8 +1343,13 @@ ipc_flatpak_service_impl_constructed (GObject *object)
     }
 
   /* Fallback for SDKs not available elsewhere */
-  if ((priv_install = ipc_flatpak_repo_get_installation (ipc_flatpak_repo_get_default ())))
-    add_installation (self, priv_install, NULL);
+  if ((priv_install = ipc_flatpak_repo_get_installation (repo)))
+    {
+      g_autofree char *config_dir = ipc_flatpak_repo_get_config_dir (repo);
+
+      add_installation (self, priv_install, NULL);
+      ipc_flatpak_service_set_config_dir (IPC_FLATPAK_SERVICE (self), config_dir);
+    }
 }
 
 static void
diff --git a/src/plugins/flatpak/daemon/org.gnome.Builder.Flatpak.Service.xml 
b/src/plugins/flatpak/daemon/org.gnome.Builder.Flatpak.Service.xml
index df1b7d7bc..01e15c44c 100644
--- a/src/plugins/flatpak/daemon/org.gnome.Builder.Flatpak.Service.xml
+++ b/src/plugins/flatpak/daemon/org.gnome.Builder.Flatpak.Service.xml
@@ -21,6 +21,10 @@
     SPDX-License-Identifier: GPL-3.0-or-later
   -->
   <interface name="org.gnome.Builder.Flatpak.Service">
+    <!--
+      The directory to use for FLATPAK_CONFIG_DIR.
+    -->
+    <property name="ConfigDir" type="s" access="read"/>
     <!--
       The default architecture of the system, such as "x86_64".
     -->


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]