[glade] Added GLADE_BUNDLED environment variable.



commit 7668ca51130043dc05369c4175c2764c8ecdc861
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Tue Dec 10 17:34:48 2013 +0900

    Added GLADE_BUNDLED environment variable.
    
    This environment variable is used to detect a bundled environment
    for which Glade will run on various 64bit linux systems.
    
    Currently we just avoid loading any catalogs except for the gtk+.xml
    catalog in the case of a bundled environment (but there may be
    some extra special cases to add, in order to ensure we don't integrate
    with the unknown running system).

 gladeui/glade-app.h     |    1 +
 gladeui/glade-catalog.c |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gladeui/glade-app.h b/gladeui/glade-app.h
index 29a8c57..5b5a81b 100644
--- a/gladeui/glade-app.h
+++ b/gladeui/glade-app.h
@@ -40,6 +40,7 @@ G_BEGIN_DECLS
 #define GLADE_ENV_MODULE_PATH      "GLADE_MODULE_SEARCH_PATH"
 #define GLADE_ENV_TESTING          "GLADE_TESTING"
 #define GLADE_ENV_PIXMAP_DIR       "GLADE_PIXMAP_DIR"
+#define GLADE_ENV_BUNDLED          "GLADE_BUNDLED"
 
 typedef struct _GladeApp         GladeApp;
 typedef struct _GladeAppPrivate  GladeAppPrivate;
diff --git a/gladeui/glade-catalog.c b/gladeui/glade-catalog.c
index e7147a8..0be542e 100644
--- a/gladeui/glade-catalog.c
+++ b/gladeui/glade-catalog.c
@@ -500,6 +500,13 @@ catalogs_from_path (GList *catalogs, const gchar *path)
          if (g_str_has_suffix (filename, ".gresource.xml"))
            continue;
 
+         /* If we're running in the bundle, don't ever try to load
+          * anything except the GTK+ catalog
+          */
+         if (g_getenv (GLADE_ENV_BUNDLED) != NULL &&
+             strcmp (filename, "gtk+.xml") != 0)
+           continue;
+
           catalog_filename = g_build_filename (path, filename, NULL);
           catalog = catalog_open (catalog_filename);
           g_free (catalog_filename);


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