Commit 71adbd6f authored by Volker Krause's avatar Volker Krause

Don't access the reservation object via the timeline model anymore

This doesn't work anymore if there can be more than one for multi-traveler
elements.
parent ed04a48c
......@@ -25,7 +25,7 @@ import "." as App
Kirigami.AbstractCard {
id: root
property string resId
property var reservation
readonly property var reservation: _reservationManager.reservation(root.resId);
/** Reservation::reservationFor, unique for all travelers on a multi-traveler reservation set */
readonly property var reservationFor: reservation.reservationFor
property var rangeType
......
......@@ -42,7 +42,6 @@ Kirigami.ScrollablePage {
id: flightDelegate
App.FlightDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
rangeType: modelData.rangeType
}
}
......@@ -50,7 +49,6 @@ Kirigami.ScrollablePage {
id: hotelDelegate
App.HotelDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
rangeType: modelData.rangeType
}
}
......@@ -58,7 +56,6 @@ Kirigami.ScrollablePage {
id: trainDelegate
App.TrainDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
rangeType: modelData.rangeType
}
}
......@@ -66,7 +63,6 @@ Kirigami.ScrollablePage {
id: busDelegate
App.BusDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
rangeType: modelData.rangeType
}
}
......@@ -74,7 +70,6 @@ Kirigami.ScrollablePage {
id: restaurantDelegate
App.RestaurantDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
rangeType: modelData.rangeType
}
}
......@@ -82,7 +77,6 @@ Kirigami.ScrollablePage {
id: touristAttractionDelegate
App.TouristAttractionDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
rangeType: modelData.rangeType
}
}
......
......@@ -39,7 +39,7 @@ public:
void setPkPassManager(PkPassManager *mgr);
QVector<QString> reservations() const;
QVariant reservation(const QString &id) const;
Q_INVOKABLE QVariant reservation(const QString &id) const;
Q_INVOKABLE void importReservation(const QUrl &filename);
Q_INVOKABLE void addReservation(const QVariant &res);
......
......@@ -263,8 +263,6 @@ QVariant TimelineModel::data(const QModelIndex& index, int role) const
}
return i18nc("weekday, date", "%1, %2", QLocale().dayName(elem.dt.date().dayOfWeek(), QLocale::LongFormat), QLocale().toString(elem.dt.date(), QLocale::ShortFormat));
}
case ReservationRole:
return res;
case ReservationIdRole:
return elem.ids.value(0);
case ElementTypeRole:
......@@ -289,7 +287,6 @@ QHash<int, QByteArray> TimelineModel::roleNames() const
{
auto names = QAbstractListModel::roleNames();
names.insert(SectionHeader, "sectionHeader");
names.insert(ReservationRole, "reservation");
names.insert(ReservationIdRole, "reservationId");
names.insert(ElementTypeRole, "type");
names.insert(TodayEmptyRole, "isTodayEmpty");
......
......@@ -36,7 +36,6 @@ class TimelineModel : public QAbstractListModel
public:
enum Role {
SectionHeader = Qt::UserRole + 1,
ReservationRole,
ReservationIdRole,
ElementTypeRole,
TodayEmptyRole,
......
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