Commit f0560a2c authored by Volker Krause's avatar Volker Krause
Browse files

Complete support for top-level pass properties

parent 659931f7
...@@ -84,6 +84,7 @@ private slots: ...@@ -84,6 +84,7 @@ private slots:
QCOMPARE((int)loc.latitude(), 47); QCOMPARE((int)loc.latitude(), 47);
QCOMPARE((int)loc.longitude(), 8); QCOMPARE((int)loc.longitude(), 8);
QCOMPARE(loc.relevantText(), QLatin1String("LX962 Boarding 20:25")); QCOMPARE(loc.relevantText(), QLatin1String("LX962 Boarding 20:25"));
QCOMPARE(pass->maximumDistance(), 500);
} }
}; };
......
...@@ -290,6 +290,11 @@ QVector<Location> Pass::locations() const ...@@ -290,6 +290,11 @@ QVector<Location> Pass::locations() const
return locs; return locs;
} }
int Pass::maximumDistance() const
{
return d->passObj.value(QLatin1String("maxDistance")).toInt(500);
}
QDateTime Pass::relevantDate() const QDateTime Pass::relevantDate() const
{ {
return QDateTime::fromString(d->passObj.value(QLatin1String("relevantDate")).toString(), Qt::ISODate); return QDateTime::fromString(d->passObj.value(QLatin1String("relevantDate")).toString(), Qt::ISODate);
......
...@@ -102,7 +102,8 @@ public: ...@@ -102,7 +102,8 @@ public:
// relevance keys // relevance keys
/** Locations associated with this pass. */ /** Locations associated with this pass. */
QVector<Location> locations() const; QVector<Location> locations() const;
// TODO maxDistance /** Distance in meters to any of the pass locations before this pass becomes relevant. */
int maximumDistance() const;
QDateTime relevantDate() const; QDateTime relevantDate() const;
// visual appearance keys // visual appearance keys
......
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