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

Normalize street name and address locality

parent 792f8eed
......@@ -126,7 +126,7 @@ private Q_SLOTS:
Place placeDropLocation;
placeDropLocation.setName(QStringLiteral("droplocation"));
KItinerary::PostalAddress placeDropPostalAddress;
placeDropPostalAddress.setStreeAddress(QStringLiteral("8 foo bla bla"));
placeDropPostalAddress.setStreetAddress(QStringLiteral("8 foo bla bla"));
placeDropPostalAddress.setAddressLocality(QStringLiteral("bli"));
placeDropLocation.setAddress(placeDropPostalAddress);
......@@ -135,7 +135,7 @@ private Q_SLOTS:
Place placePickupLocation;
placePickupLocation.setName(QStringLiteral("pickuplocation"));
KItinerary::PostalAddress placePickupPostalAddress;
placePickupPostalAddress.setStreeAddress(QStringLiteral("5 kde foo bla bla"));
placePickupPostalAddress.setStreetAddress(QStringLiteral("5 kde foo bla bla"));
placePickupPostalAddress.setAddressLocality(QStringLiteral("bli2"));
placePickupLocation.setAddress(placePickupPostalAddress);
......
......@@ -68,7 +68,7 @@ public:
};
KITINERARY_MAKE_SIMPLE_CLASS(PostalAddress)
KITINERARY_MAKE_PROPERTY(PostalAddress, QString, streetAddress, setStreeAddress)
KITINERARY_MAKE_PROPERTY(PostalAddress, QString, streetAddress, setStreetAddress)
KITINERARY_MAKE_PROPERTY(PostalAddress, QString, addressLocality, setAddressLocality)
KITINERARY_MAKE_PROPERTY(PostalAddress, QString, postalCode, setPostalCode)
KITINERARY_MAKE_PROPERTY(PostalAddress, QString, addressRegion, setAddressRegion)
......
......@@ -57,7 +57,7 @@ class PostalAddressPrivate;
class KITINERARY_EXPORT PostalAddress
{
KITINERARY_GADGET(PostalAddress)
KITINERARY_PROPERTY(QString, streetAddress, setStreeAddress)
KITINERARY_PROPERTY(QString, streetAddress, setStreetAddress)
KITINERARY_PROPERTY(QString, addressLocality, setAddressLocality)
KITINERARY_PROPERTY(QString, postalCode, setPostalCode)
KITINERARY_PROPERTY(QString, addressRegion, setAddressRegion)
......
......@@ -519,6 +519,10 @@ template<typename T> T ExtractorPostprocessorPrivate::processPlace(T place) cons
addr.setAddressCountry(addr.addressCountry().toUpper());
}
// normalize strings
addr.setStreetAddress(addr.streetAddress().simplified());
addr.setAddressLocality(addr.addressLocality().simplified());
place.setAddress(addr);
return place;
}
......
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