Allow zone_nr > 999
This commit is contained in:
parent
a3f4a742ce
commit
6a215d4cf9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user