Allow zone_nr > 999

This commit is contained in:
Siegfried Siegert 2025-02-04 14:47:07 +01:00
parent a3f4a742ce
commit 6a215d4cf9
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -399,11 +399,9 @@ int CALCULATE_LIBRARY_API get_zone_nr(int zone)
QFile zone("/mnt/system_data/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();
}
if (zone.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&zone);
return in.readLine(100).toInt();
}
}
return -1;