From f8708e2921d116890fa0bac1d46d3b464ca08218 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 4 Oct 2013 13:21:31 -0700 Subject: Use helper function to find xslt folder This seems much better than the different hard coded and semi-hard coded paths we had before. Signed-off-by: Dirk Hohndel --- dive.h | 2 ++ parse-xml.c | 4 +--- qt-gui.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dive.h b/dive.h index 9fb47f21a..3b0df197c 100644 --- a/dive.h +++ b/dive.h @@ -611,6 +611,8 @@ extern void save_dive(FILE *f, struct dive *dive); extern xsltStylesheetPtr get_stylesheet(const char *name); +extern char *xslt_path; + extern timestamp_t utc_mktime(struct tm *tm); extern void utc_mkdate(timestamp_t, struct tm *tm); diff --git a/parse-xml.c b/parse-xml.c index 195eafeb9..66246570f 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -20,6 +20,7 @@ int verbose; static xmlDoc *test_xslt_transforms(xmlDoc *doc, char **error); +char *xslt_path; /* the dive table holds the overall dive list; target table points at * the table we are currently filling */ @@ -1852,9 +1853,6 @@ void parse_xml_exit(void) xmlCleanupParser(); } -/* Maybe we'll want a environment variable that can override this.. */ -static const char *xslt_path = XSLT ":xslt:."; - static xsltStylesheetPtr try_get_stylesheet(const char *path, int len, const char *name) { xsltStylesheetPtr ret; diff --git a/qt-gui.cpp b/qt-gui.cpp index b302e341a..701a88b9e 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -103,6 +103,7 @@ void init_ui(int *argcp, char ***argvp) QCoreApplication::setOrganizationName("Subsurface"); QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); QCoreApplication::setApplicationName("Subsurface"); + xslt_path = strdup(getSubsurfaceDataPath("xslt").toAscii().data()); QSettings s; s.beginGroup("GeneralSettings"); -- cgit v1.2.3-70-g09d2