Commit b5cf568e authored by Volker Krause's avatar Volker Krause

Add method to check if a reservation exists

Needed for consistency maintenance of trip groups.
parent ad60e19d
......@@ -54,6 +54,15 @@ void ReservationManager::setPkPassManager(PkPassManager* mgr)
connect(mgr, &PkPassManager::passRemoved, this, &ReservationManager::passRemoved);
}
bool ReservationManager::hasReservation(const QString &id) const
{
if (m_reservations.contains(id)) {
return true;
}
return QFile::exists(basePath() + id + QLatin1String(".jsonld"));
}
QVector<QString> ReservationManager::reservations() const
{
const auto base = basePath();
......
......@@ -36,6 +36,7 @@ public:
void setPkPassManager(PkPassManager *mgr);
bool hasReservation(const QString &id) const;
QVector<QString> reservations() const;
Q_INVOKABLE QVariant reservation(const QString &id) const;
......
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