Commit c5e0d2c7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix unity build support

parent ff135ed5
Pipeline #119112 passed with stage
in 2 minutes and 39 seconds
......@@ -131,6 +131,10 @@ target_sources(KPimItinerary PRIVATE
sortutil.cpp
stringutil.cpp
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KPimItinerary PROPERTIES UNITY_BUILD ON)
endif()
kde_source_files_enable_exceptions(barcodedecoder.cpp qimagepurebinarizer.cpp)
ecm_qt_declare_logging_category(KPimItinerary
HEADER logging.h
......
......@@ -11,9 +11,9 @@
using namespace KItinerary;
enum {
SSB_DATA_SIZE_MIN = 67,
SSB_DATA_SIZE_MAX = 114,
SSB_VERSION = 2,
SSBV2_DATA_SIZE_MIN = 67,
SSBV2_DATA_SIZE_MAX = 114,
SSBV2_VERSION = 2,
};
SSBv2Ticket::SSBv2Ticket() = default;
......@@ -36,10 +36,10 @@ bool SSBv2Ticket::isValid() const
bool SSBv2Ticket::maybeSSB(const QByteArray& data)
{
if (data.size() < SSB_DATA_SIZE_MIN || data.size() > SSB_DATA_SIZE_MAX) {
if (data.size() < SSBV2_DATA_SIZE_MIN || data.size() > SSBV2_DATA_SIZE_MAX) {
return false;
}
return (data.at(0) >> 4) == SSB_VERSION;
return (data.at(0) >> 4) == SSBV2_VERSION;
}
QByteArray SSBv2Ticket::rawData() const
......
......@@ -13,9 +13,9 @@
using namespace KItinerary;
enum {
SSB_DATA_SIZE = 114,
SSB_CHAR_WIDTH = 6,
SSB_VERSION = 3,
SSBV3_DATA_SIZE = 114,
SSBV3_CHAR_WIDTH = 6,
SSBV3_VERSION = 3,
};
SSBv3Ticket::SSBv3Ticket() = default;
......@@ -41,17 +41,17 @@ QString SSBv3Ticket::readString(int start, int length) const
QString res;
res.resize(length);
for (int i = 0; i < length; ++i) {
res[i] = QLatin1Char((uint8_t)readNumber(start + SSB_CHAR_WIDTH * i, SSB_CHAR_WIDTH) + 32);
res[i] = QLatin1Char((uint8_t)readNumber(start + SSBV3_CHAR_WIDTH * i, SSBV3_CHAR_WIDTH) + 32);
}
return res;
}
bool SSBv3Ticket::maybeSSB(const QByteArray& data)
{
if (data.size() != SSB_DATA_SIZE) {
if (data.size() != SSBV3_DATA_SIZE) {
return false;
}
return (data.at(0) >> 4) == SSB_VERSION;
return (data.at(0) >> 4) == SSBV3_VERSION;
}
QDate SSBv3Ticket::issueDate(const QDateTime &contextDate) const
......
......@@ -375,7 +375,7 @@ EventReservation ExtractorPostprocessorPrivate::processEventReservation(EventRes
return processReservation(res);
}
Event ExtractorPostprocessorPrivate::processEvent(Event event) const
KItinerary::Event ExtractorPostprocessorPrivate::processEvent(KItinerary::Event event) const
{
event.setName(event.name().trimmed());
......@@ -420,7 +420,7 @@ T ExtractorPostprocessorPrivate::processReservation(T res) const
}
Person ExtractorPostprocessorPrivate::processPerson(Person person) const
KItinerary::Person ExtractorPostprocessorPrivate::processPerson(KItinerary::Person person) const
{
person.setName(person.name().simplified());
person.setFamilyName(person.familyName().simplified());
......
......@@ -154,7 +154,7 @@ struct {
FILTER(Flight, filterFlight),
FILTER(TrainTrip, filterTrainTrip),
FILTER(BusTrip, filterBusTrip),
FILTER(Event, filterEvent),
FILTER(KItinerary::Event, filterEvent),
FILTER(LocalBusiness, filterLocalBusiness),
FILTER(FoodEstablishmentReservation, filterFoodReservation),
FILTER(LodgingReservation, filterLodgingReservation),
......
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