[gnome-software/wip/launcher: 4/7] Keep debug env vars working



commit 892fd61bba568b498649f161ae84097d460bc3de
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 15 20:28:32 2013 -0400

    Keep debug env vars working
    
    We need to pick the environment variables we care about out
    of the platform data, and set them in the environment of the
    service.

 src/gs-application.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index ae72acb..8d547c7 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -223,6 +223,24 @@ gs_application_activate (GApplication *application)
 }
 
 static void
+gs_application_before_emit (GApplication *application,
+                           GVariant     *platform_data)
+{
+       gchar **environ;
+       const gchar *s;
+
+       if (!g_variant_lookup (platform_data, "environ", "^a&ay", &environ))
+               return;
+
+       s = g_environ_getenv (environ, "GNOME_SOFTWARE_FEATURED");
+       if (s)
+               g_setenv ("GNOME_SOFTWARE_FEATURED", s, TRUE);
+       s = g_environ_getenv (environ, "GNOME_SOFTWARE_POPULAR");
+       if (s)
+               g_setenv ("GNOME_SOFTWARE_POPULAR", s, TRUE);
+}
+
+static void
 gs_application_finalize (GObject *object)
 {
        GsApplication *app = GS_APPLICATION (object);
@@ -241,6 +259,7 @@ gs_application_class_init (GsApplicationClass *class)
        G_OBJECT_CLASS (class)->finalize = gs_application_finalize;
        G_APPLICATION_CLASS (class)->startup = gs_application_startup;
        G_APPLICATION_CLASS (class)->activate = gs_application_activate;
+       G_APPLICATION_CLASS (class)->before_emit = gs_application_before_emit;
 }
 
 GsApplication *


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