GetCostFromDuration fixed
This commit is contained in:
@@ -10,18 +10,23 @@
|
||||
|
||||
static Calculator calculator;
|
||||
|
||||
int CALCULATE_LIBRARY_API get_zone_nr() {
|
||||
QFile zone("/etc/zone_nr");
|
||||
if (zone.exists()) {
|
||||
QFileInfo finfo(zone);
|
||||
if (finfo.size() <= 4) { // decimal 000\n
|
||||
if (zone.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&zone);
|
||||
return in.readLine(100).toInt();
|
||||
int CALCULATE_LIBRARY_API get_zone_nr(int zone)
|
||||
{
|
||||
if(zone > -1) return zone;
|
||||
else
|
||||
{
|
||||
QFile zone("/etc/zone_nr");
|
||||
if (zone.exists()) {
|
||||
QFileInfo finfo(zone);
|
||||
if (finfo.size() <= 4) { // decimal 000\n
|
||||
if (zone.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&zone);
|
||||
return in.readLine(100).toInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char const *config_file) {
|
||||
|
Reference in New Issue
Block a user