2011-01-20  Nicolas Setton  <setton@adacore.com>

	* glade-catalog.c (glade_catalog_load_all): Disable message listing
	the missing icons.

2011-01-20  Nicolas Setton  <setton@adacore.com>

	* glade-utils.c (glade_util_get_file_mtime): Do not attempt to run g_stat
	under Windows, to prevent segvs.

2011-01-03  Nicolas Setton  <setton@adacore.com>

	* glade-app.c (build_package_paths): Improve relocatability, by allowing
	the user to set the prefix for icons through the GLADE_BASE_DIR environment
	variable.

--- gladeui/glade-app.c.orig	2012-03-06 17:48:58.000000000 +0100
+++ gladeui/glade-app.c	2012-03-06 17:49:04.000000000 +0100
@@ -41,6 +41,7 @@
 #include "glade-accumulators.h"
 
 #include <string.h>
+#include <stdlib.h>
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n-lib.h>
@@ -218,34 +219,51 @@ glade_app_get_bin_dir (void)
 static void
 build_package_paths (void)
 {
-#if defined (G_OS_WIN32) || (defined (MAC_INTEGRATION) && defined (MAC_BUNDLE))
   gchar *prefix;
+  gboolean must_free = TRUE;
+
+  /* On all platforms, look for GLADE_BASE_DIR overriding the prefix */
+
+  prefix = getenv("GLADE_BASE_DIR");
+  if (prefix)
+    must_free = FALSE;
+  else
+    {
+      /* Set the prefix by looking at integration parameters */
 
+#if defined (G_OS_WIN32) || (defined (MAC_INTEGRATION) && defined (MAC_BUNDLE))
 # ifdef G_OS_WIN32
-  prefix = g_win32_get_package_installation_directory_of_module (NULL);
+      prefix = g_win32_get_package_installation_directory_of_module (NULL);
 
 # else // defined (MAC_INTEGRATION) && defined (MAC_BUNDLE)
-  IgeMacBundle *bundle = ige_mac_bundle_get_default ();
+      IgeMacBundle *bundle = ige_mac_bundle_get_default ();
 
-  prefix =
-      g_build_filename (ige_mac_bundle_get_path (bundle), "Contents",
-                        "Resources", NULL);
+      prefix =
+          g_build_filename (ige_mac_bundle_get_path (bundle), "Contents",
+                            "Resources", NULL);
 # endif
+# endif
+    }
 
-  pixmaps_dir = g_build_filename (prefix, "share", PACKAGE, "pixmaps", NULL);
-  catalogs_dir = g_build_filename (prefix, "share", PACKAGE, "catalogs", NULL);
-  modules_dir = g_build_filename (prefix, "lib", PACKAGE, "modules", NULL);
-  locale_dir = g_build_filename (prefix, "share", "locale", NULL);
-  bin_dir = g_build_filename (prefix, "bin", NULL);
-
-  g_free (prefix);
-#else
-  catalogs_dir = g_strdup (GLADE_CATALOGSDIR);
-  modules_dir = g_strdup (GLADE_MODULESDIR);
-  pixmaps_dir = g_strdup (GLADE_PIXMAPSDIR);
-  locale_dir = g_strdup (GLADE_LOCALEDIR);
-  bin_dir = g_strdup (GLADE_BINDIR);
-#endif
+  if (prefix)
+    {
+      pixmaps_dir = g_build_filename (prefix, "share", PACKAGE, "pixmaps", NULL);
+      catalogs_dir = g_build_filename (prefix, "share", PACKAGE, "catalogs", NULL);
+      modules_dir = g_build_filename (prefix, "lib", PACKAGE, "modules", NULL);
+      locale_dir = g_build_filename (prefix, "share", "locale", NULL);
+      bin_dir = g_build_filename (prefix, "bin", NULL);
+
+      if (must_free)
+        g_free (prefix);
+    }
+  else
+    {
+      catalogs_dir = g_strdup (GLADE_CATALOGSDIR);
+      modules_dir = g_strdup (GLADE_MODULESDIR);
+      pixmaps_dir = g_strdup (GLADE_PIXMAPSDIR);
+      locale_dir = g_strdup (GLADE_LOCALEDIR);
+      bin_dir = g_strdup (GLADE_BINDIR);
+    }
 }
 
 /* initialization function for libgladeui (not GladeApp) */
--- gladeui/glade-utils.c.orig	2012-03-05 15:47:13.000000000 -0500
+++ gladeui/glade-utils.c	2012-03-05 15:47:41.000000000 -0500
@@ -1222,6 +1222,10 @@ glade_util_get_file_mtime (const gchar *
   struct stat info;
   gint retval;
 
+#ifdef G_OS_WIN32
+  return (time_t) 0;
+#endif
+
   retval = g_stat (filename, &info);
 
   if (retval != 0)
--- gladeui/glade-catalog.c.orig	2012-03-05 15:48:56.000000000 -0500
+++ gladeui/glade-catalog.c	2012-03-05 15:49:38.000000000 -0500
@@ -540,6 +540,7 @@ glade_catalog_load_all (void)
       catalog_load (catalog);
     }
 
+#if 0
   /* Print a summery of widget adaptors missing icons.
    */
   adaptors = glade_widget_adaptor_list_adaptors ();
@@ -562,6 +563,7 @@ glade_catalog_load_all (void)
 
     }
   g_list_free (adaptors);
+#endif
 
   if (icon_warning)
     {
*** configure.orig	Tue Jul 17 17:40:11 2012
--- configure	Tue Jul 17 17:40:58 2012
***************
*** 15113,15118 ****
--- 15113,15119 ----
    test $ac_status = 0; }; then
    pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "
    gtk+-3.0 >= $GTK_REQUIRED
+   gmodule-2.0 >= 2.32.0
    libxml-2.0 >= 2.4.0
  " 2>/dev/null`
  		      test "x$?" != "x0" && pkg_failed=yes
