[glom] Move the XSLT file into a GResource for libglom.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Move the XSLT file into a GResource for libglom.
- Date: Tue, 22 Oct 2013 12:49:28 +0000 (UTC)
commit 67805fc1ab32ece4a58b25ba05969350a14a27e7
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Oct 22 14:45:11 2013 +0200
Move the XSLT file into a GResource for libglom.
Because it is used in libglom, and this lets it work in libglom tests.
Makefile_glom.am | 2 +-
Makefile_libglom.am | 13 ++++++++++++-
data/glom.gresource.xml | 2 --
glom/libglom/data/libglom.gresource.xml | 13 +++++++++++++
.../libglom/data}/xslt/print_report_to_html.xsl | 0
glom/libglom/xsl_utils.cc | 2 +-
6 files changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/Makefile_glom.am b/Makefile_glom.am
index d78445c..2e3dcd5 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -31,7 +31,7 @@ glom_glom_CPPFLAGS = $(glom_includes) $(GLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_
# Generate the GResource source file for .glade and icons files:
# TODO: Do not use all .glade files in the client-only build.
glom_resource_file = data/glom.gresource.xml
-BUILT_SOURCES = data/glom-resources.c
+BUILT_SOURCES += data/glom-resources.c
data/glom-resources.c: $(glom_resource_file) $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies
$(glom_resource_file))
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source
$(glom_resource_file)
diff --git a/Makefile_libglom.am b/Makefile_libglom.am
index 39ccf40..ea00ea7 100644
--- a/Makefile_libglom.am
+++ b/Makefile_libglom.am
@@ -56,11 +56,22 @@ libglom_d_bakery_include_HEADERS = $(libglom_d_bakery_headers)
libglom_d_b_view_includedir = $(libglom_d_bakery_includedir)/view
libglom_d_b_view_include_HEADERS = $(libglom_d_b_view_headers)
-glom_libglom_libglom_ GLOM_ABI_VERSION@_la_SOURCES = $(libglom_sources)
+glom_libglom_libglom_ GLOM_ABI_VERSION@_la_SOURCES = \
+ $(libglom_sources) \
+ glom/libglom/data/libglom-resources.c
libglom_all_libs = $(LIBGLOM_LIBS) $(boost_python_libs) -lgettextpo $(GCOV_CFLAGS)
glom_libglom_libglom_ GLOM_ABI_VERSION@_la_LIBADD = $(libglom_all_libs)
+
+# Generate the GResource source file for the xslt files:
+libglom_resource_file = glom/libglom/data/libglom.gresource.xml
+BUILT_SOURCES = glom/libglom/data/libglom-resources.c
+glom/libglom/data/libglom-resources.c: $(libglom_resource_file) $(shell $(GLIB_COMPILE_RESOURCES)
--generate-dependencies $(libglom_resource_file))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source
$(libglom_resource_file)
+
+
+
if HOST_WIN32
glom_libglom_libglom_ GLOM_ABI_VERSION@_la_LIBADD += -lws2_32
endif
diff --git a/data/glom.gresource.xml b/data/glom.gresource.xml
index b201239..740421d 100644
--- a/data/glom.gresource.xml
+++ b/data/glom.gresource.xml
@@ -64,8 +64,6 @@
<file>data/icons/glom-related-records.png</file>
<file>data/icons/glom-text.png</file>
<file>data/icons/48x48/glom.png</file>
-
- <file preprocess="xml-stripblanks">data/xslt/print_report_to_html.xsl</file>
</gresource>
</gresources>
diff --git a/glom/libglom/data/libglom.gresource.xml b/glom/libglom/data/libglom.gresource.xml
new file mode 100644
index 0000000..d4d1f03
--- /dev/null
+++ b/glom/libglom/data/libglom.gresource.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/glom/libglom">
+ <file preprocess="xml-stripblanks"
alias="data/xslt/print_report_to_html.xsl">glom/libglom/data/xslt/print_report_to_html.xsl</file>
+ </gresource>
+</gresources>
+
+
+
+
+
+
+
diff --git a/data/xslt/print_report_to_html.xsl b/glom/libglom/data/xslt/print_report_to_html.xsl
similarity index 100%
rename from data/xslt/print_report_to_html.xsl
rename to glom/libglom/data/xslt/print_report_to_html.xsl
diff --git a/glom/libglom/xsl_utils.cc b/glom/libglom/xsl_utils.cc
index 34e3bbd..739974c 100644
--- a/glom/libglom/xsl_utils.cc
+++ b/glom/libglom/xsl_utils.cc
@@ -46,7 +46,7 @@ namespace
{
static std::string get_xslt_filepath(const std::string& xsl_file)
{
- const std::string resource_path = "/org/gnome/glom/data/xslt/" + xsl_file;
+ const std::string resource_path = "/org/gnome/glom/libglom/data/xslt/" + xsl_file;
if(!g_resources_get_info(resource_path.c_str(), G_RESOURCE_LOOKUP_FLAGS_NONE, 0, 0, 0))
{
std::cerr << G_STRFUNC << ": xslt resource not found: " << resource_path << std::endl;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]