Try to load dtd and glade files from the srcdir first to aboid having to install...
authorXavier Claessens <xclaesse@src.gnome.org>
Wed, 23 Jan 2008 00:02:03 +0000 (00:02 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Wed, 23 Jan 2008 00:02:03 +0000 (00:02 +0000)
svn path=/trunk/; revision=596

configure.ac
libempathy-gtk/empathy-ui-utils.c
libempathy/empathy-utils.c

index 46effc72eaae860fd42da064574f2f69bde8f38f..1d0c5b13edf29891ee00f67d4792449eddfd757a 100644 (file)
@@ -286,6 +286,13 @@ fi
 
 AM_CONDITIONAL(HAVE_VOIP, test "x$enable_voip" = "xyes")
 
+
+# -----------------------------------------------------------
+# Misc
+# -----------------------------------------------------------
+AC_DEFINE_UNQUOTED([UNINSTALLED_GLADE_DIR], ["`pwd`/libempathy-gtk"], [path to glade files])
+AC_DEFINE_UNQUOTED([UNINSTALLED_DTD_DIR], ["`pwd`/libempathy"], [path to dtd files])
+
 # -----------------------------------------------------------
 
 AC_OUTPUT([
index 2989ce2ac497f81b8beae1d7c6f84b7df129af07..22a5fc2f739ac04eaef2abd8db6cf6f66bb66e2b 100644 (file)
@@ -28,6 +28,8 @@
  *          Jeroen Zwartepoorte
  */
 
+#include <config.h>
+
 #include <string.h>
 #include <X11/Xatom.h>
 #include <gdk/gdkx.h>
@@ -63,7 +65,13 @@ get_glade_file (const gchar *filename,
        const char *name;
        GtkWidget **widget_ptr;
 
-       path = g_build_filename (DATADIR, "empathy", filename, NULL);
+       path = g_build_filename (UNINSTALLED_GLADE_DIR, filename, NULL);
+       if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+               g_free (path);
+               path = g_build_filename (DATADIR, "empathy", filename, NULL);
+       }
+       empathy_debug (DEBUG_DOMAIN, "Loading glade file %s", path);
+
        gui = glade_xml_new (path, root, domain);
        g_free (path);
 
index 0e2c4b588d5a8f79913c7d38a8528526146b83d3..4050f46738924c0e6c782e1c379f5449626792ad 100644 (file)
@@ -208,11 +208,15 @@ empathy_xml_validate (xmlDoc      *doc,
        xmlDtd       *dtd;
        gboolean      ret;
 
-       path = g_build_filename (DATADIR, "empathy", dtd_filename, NULL);
+       path = g_build_filename (UNINSTALLED_DTD_DIR, dtd_filename, NULL);
+       if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+               g_free (path);
+               path = g_build_filename (DATADIR, "empathy", dtd_filename, NULL);
+       }
+       empathy_debug (DEBUG_DOMAIN, "Loading dtd file %s", path);
 
        /* The list of valid chars is taken from libxml. */
        escaped = xmlURIEscapeStr (path, ":@&=+$,/?;");
-
        g_free (path);
 
        memset (&cvp, 0, sizeof (cvp));