From c28acce93826c28f174accdbce325e21804016f8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Mar 2015 18:07:20 -0700 Subject: [PATCH] Provide useful warning when we can't find an XSLT file Signed-off-by: Dirk Hohndel --- qthelper.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qthelper.cpp b/qthelper.cpp index 189d47ed3..104ed00f1 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -304,9 +304,12 @@ int dive_getUniqID(struct dive *d) static xmlDocPtr get_stylesheet_doc(const xmlChar *uri, xmlDictPtr, int, void *, xsltLoadType) { QFile f(QLatin1String(":/xslt/") + (const char *)uri); - if (!f.open(QIODevice::ReadOnly)) - return NULL; - + if (!f.open(QIODevice::ReadOnly)) { + if (verbose > 0) { + qDebug() << "cannot open stylesheet" << QLatin1String(":/xslt/") + (const char *)uri; + return NULL; + } + } /* Load and parse the data */ QByteArray source = f.readAll();