KPkPass

boardingpass.cpp
1/*
2 SPDX-FileCopyrightText: 2017-2018 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "boardingpass.h"
8#include "pass_p.h"
9
10using namespace KPkPass;
11
12BoardingPass::BoardingPass(QObject *parent)
13 : Pass(Pass::BoardingPass, parent)
14{
15}
16
17BoardingPass::~BoardingPass() = default;
18
19BoardingPass::TransitType BoardingPass::transitType() const
20{
21 const auto t = d->passData().value(QLatin1StringView("transitType")).toString();
22 if (t == QLatin1StringView("PKTransitTypeAir")) {
23 return Air;
24 } else if (t == QLatin1StringView("PKTransitTypeBoat")) {
25 return Boat;
26 } else if (t == QLatin1StringView("PKTransitTypeBus")) {
27 return Bus;
28 } else if (t == QLatin1StringView("PKTransitTypeTrain")) {
29 return Train;
30 }
31 return Generic;
32}
33
34#include "moc_boardingpass.cpp"
Base class for a pkpass file.
Definition pass.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:53:41 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.