Add debug messages on tariff config initialisation
This commit is contained in:
parent
30af400779
commit
b422f82dea
@ -49,14 +49,27 @@ bool CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char const *co
|
|||||||
snprintf(buffer, sizeof(buffer)-1, "tariff%02d.json", zone);
|
snprintf(buffer, sizeof(buffer)-1, "tariff%02d.json", zone);
|
||||||
confFile += buffer;
|
confFile += buffer;
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
qCritical() << " ... confFile = " << confFile;
|
||||||
|
|
||||||
QFile fname(confFile);
|
QFile fname(confFile);
|
||||||
if (fname.exists()) {
|
if (fname.exists()) {
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
qCritical() << " ... confFile exists";
|
||||||
|
|
||||||
if (fname.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (fname.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
qCritical() << " ... confFile is open";
|
||||||
|
|
||||||
QString json = fname.readAll();
|
QString json = fname.readAll();
|
||||||
return (*tariff)->ParseJson(*tariff, json.toStdString().c_str());
|
return (*tariff)->ParseJson(*tariff, json.toStdString().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qCritical() << "init_tariff: Parsing tariff config (" << confFile << ") failed!";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user