Some error reporting on divelogs.de export

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2015-10-25 17:10:53 +02:00 committed by Dirk Hohndel
parent 8c706357f4
commit 1d10a56bdf

View file

@ -170,6 +170,7 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
xslt = get_stylesheet("divelogs-export.xslt");
if (!xslt) {
qDebug() << errPrefix << "missing stylesheet";
report_error(tr("stylesheet to export to divelogs.de is not found").toUtf8());
return false;
}
@ -238,6 +239,11 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
free((void *)membuf);
transformed = xsltApplyStylesheet(xslt, doc, NULL);
if (!transformed) {
qWarning() << errPrefix << "XSLT transform failed for dive: " << i;
report_error(tr("Conversion of dive %1 to divelogs.de format failed").arg(i).toUtf8());
continue;
}
xmlDocDumpMemory(transformed, (xmlChar **)&membuf, &streamsize);
xmlFreeDoc(doc);
xmlFreeDoc(transformed);