Commit 6ba69baf authored by Volker Krause's avatar Volker Krause
Browse files

Remove the leftovers of the old coverage area handling

parent 9e1fc016
......@@ -32,22 +32,6 @@ void AbstractBackend::setBackendId(const QString& id)
m_backendId = id;
}
bool AbstractBackend::isLocationExcluded(const Location &loc) const
{
if (loc.hasCoordinate() && !m_geoFilter.isEmpty()) {
return !m_geoFilter.containsPoint({loc.longitude(), loc.latitude()}, Qt::WindingFill);
}
if (loc.country().size() == 2 && backendId().size() > 3 && backendId().at(2) == QLatin1Char('_')) {
return loc.country().compare(backendId().leftRef(2), Qt::CaseInsensitive) != 0;
}
return false;
}
void AbstractBackend::setGeoFilter(const QPolygonF &poly)
{
m_geoFilter = poly;
}
QTimeZone AbstractBackend::timeZone() const
{
return m_timeZone;
......
......@@ -50,10 +50,6 @@ public:
QString backendId() const;
void setBackendId(const QString &id);
/** Checks if this location has been filtered by the network configuration. */
bool isLocationExcluded(const Location &loc) const;
void setGeoFilter(const QPolygonF &poly);
/** Static timezone for all times used by and provided by the backend.
* Set to invalid if the backend supports multiple timezones.
*/
......@@ -197,7 +193,6 @@ private:
void setCustomCaCertificate(const QString &caCert);
QString m_backendId;
QPolygonF m_geoFilter;
Attribution m_attribution;
QTimeZone m_timeZone;
QStringList m_supportedLanguages;
......
......@@ -221,16 +221,6 @@ static void applyBackendOptions(AbstractBackend *backend, const QMetaObject *mo,
}
}
const auto coverageData = obj.value(QLatin1String("coverage")).toObject();
for (const auto &coverageType : { "anyCoverage", "regularCoverage", "realtimeCoverage" }) {
const auto coverage = coverageData.value(QLatin1String(coverageType)).toObject();
if (coverage.empty()) {
continue;
}
const auto poly = GeoJson::readOuterPolygon(coverage.value(QLatin1String("area")).toObject());
backend->setGeoFilter(poly);
}
const auto attrObj = obj.value(QLatin1String("attribution")).toObject();
const auto attr = Attribution::fromJson(attrObj);
backend->setAttribution(attr);
......@@ -731,8 +721,8 @@ VehicleLayoutReply* Manager::queryVehicleLayout(const VehicleLayoutRequest &req)
if (d->shouldSkipBackend(backend, req)) {
continue;
}
if (req.stopover().stopPoint().hasCoordinate() && backend->isLocationExcluded(req.stopover().stopPoint())) {
qCDebug(Log) << "Skipping backend based on location filter:" << backend->backendId();
const auto coverage = b.coverageArea(CoverageArea::Realtime);
if (coverage.isEmpty() || !coverage.coversLocation(req.stopover().stopPoint())) {
continue;
}
reply->addAttribution(backend->attribution());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment