Commit 89f951db authored by Volker Krause's avatar Volker Krause

Decouple Rct2Ticket from Uic9183Parser

parent d7d881c7
......@@ -499,6 +499,11 @@ Rct2Ticket::Type Rct2Ticket::type() const
return Unknown;
}
QString Rct2Ticket::passengerName() const
{
return d->fieldText(0, 52, 19).trimmed();
}
QDateTime Rct2Ticket::outboundDepartureTime() const
{
return d->parseTime(d->fieldText(6, 1, 5), d->fieldText(6, 7, 5));
......@@ -678,7 +683,7 @@ Person Uic9183Parser::person() const
// RCT2 tickets
const auto rct2 = rct2Ticket();
if (rct2.isValid()) {
const auto name = rct2.d->fieldText(0, 52, 19);
const auto name = rct2.passengerName();
if (!name.isEmpty()) {
Person p;
p.setName(name);
......
......@@ -83,6 +83,9 @@ public:
/** Returns the ticket type. */
Type type() const;
/** Name of the passenger this ticket is for. */
QString passengerName() const;
/** Departure time of the outbound segment. */
QDateTime outboundDepartureTime() const;
/** Arrival time of the outbound segment. */
......@@ -102,7 +105,6 @@ public:
QString seatNumber() const;
private:
friend class Uic9183Parser; // FIXME - remove this
QExplicitlySharedDataPointer<Rct2TicketPrivate> d;
};
......
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