mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:23:24 +00:00
Correctly open the resource file
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a842e44b68
commit
27b4ef321a
3 changed files with 8 additions and 1 deletions
|
@ -320,7 +320,7 @@ static xmlDocPtr get_stylesheet_doc(const xmlChar *uri, xmlDictPtr, int, void *,
|
||||||
QFile f(QLatin1String(":/xslt/") + (const char *)uri);
|
QFile f(QLatin1String(":/xslt/") + (const char *)uri);
|
||||||
if (!f.open(QIODevice::ReadOnly)) {
|
if (!f.open(QIODevice::ReadOnly)) {
|
||||||
if (verbose > 0) {
|
if (verbose > 0) {
|
||||||
qDebug() << "cannot open stylesheet" << QLatin1String(":/xslt/") + (const char *)uri;
|
qDebug() << "cannot open stylesheet" << QLatin1String(":/xslt/") + (const char *)uri << f.errorString();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
#include "core/divelist.h"
|
#include "core/divelist.h"
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
void TestParse::initTestCase()
|
||||||
|
{
|
||||||
|
/* we need to manually tell that the resource exists, because we are using it as library. */
|
||||||
|
Q_INIT_RESOURCE(subsurface);
|
||||||
|
}
|
||||||
|
|
||||||
char *intdup(int index)
|
char *intdup(int index)
|
||||||
{
|
{
|
||||||
char tmpbuf[21];
|
char tmpbuf[21];
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
class TestParse : public QObject{
|
class TestParse : public QObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
void testParseCSV();
|
void testParseCSV();
|
||||||
void testParseDivingLog();
|
void testParseDivingLog();
|
||||||
void testParseV2NoQuestion();
|
void testParseV2NoQuestion();
|
||||||
|
|
Loading…
Add table
Reference in a new issue