Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
0f888bb1
Commit
0f888bb1
authored
Jul 31, 2021
by
Volker Krause
Browse files
Validate top-level program membership objects
parent
fcb17729
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/extractorvalidator.cpp
View file @
0f888bb1
...
...
@@ -11,6 +11,7 @@
#include
<KItinerary/Event>
#include
<KItinerary/Flight>
#include
<KItinerary/Place>
#include
<KItinerary/ProgramMembership>
#include
<KItinerary/RentalCar>
#include
<KItinerary/Reservation>
#include
<KItinerary/Taxi>
...
...
@@ -36,6 +37,7 @@ public:
bool
filterFoodReservation
(
const
FoodEstablishmentReservation
&
res
)
const
;
bool
filterLocalBusiness
(
const
LocalBusiness
&
business
)
const
;
bool
filterReservation
(
const
Reservation
&
res
)
const
;
bool
filterProgramMembership
(
const
ProgramMembership
&
program
)
const
;
std
::
vector
<
const
QMetaObject
*>
m_acceptedTypes
;
bool
m_onlyComplete
=
true
;
...
...
@@ -132,6 +134,11 @@ bool ExtractorValidatorPrivate::filterReservation(const Reservation &res) const
return
true
;
}
bool
ExtractorValidatorPrivate
::
filterProgramMembership
(
const
ProgramMembership
&
program
)
const
{
return
(
!
program
.
membershipNumber
().
isEmpty
()
||
!
program
.
token
().
isEmpty
())
&&
!
program
.
programName
().
isEmpty
();
}
template
<
typename
T
,
bool
(
ExtractorValidatorPrivate
::*
F
)(
const
T
&
)
const
>
static
inline
bool
callFilterWithType
(
const
ExtractorValidatorPrivate
*
d
,
const
QVariant
&
v
)
{
...
...
@@ -152,6 +159,7 @@ struct {
FILTER
(
FoodEstablishmentReservation
,
filterFoodReservation
),
FILTER
(
LodgingReservation
,
filterLodgingReservation
),
FILTER
(
Reservation
,
filterReservation
),
FILTER
(
ProgramMembership
,
filterProgramMembership
),
};
#undef FILTER
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment