Provide useful warning when we can't find an XSLT file

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-03-14 18:07:20 -07:00
parent 9b2c1df8e6
commit c28acce938

View file

@ -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))
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();