Commit 4f882d0d authored by Volker Krause's avatar Volker Krause
Browse files

Prepare for ISOtoCountry being deprecated

It's no longer needed for address formatting with 5.89 anyway, as the
formatting code expands country codes already.
parent 07bc6307
Pipeline #98552 passed with stage
in 52 minutes and 15 seconds
......@@ -8,6 +8,7 @@
#include <KContacts/Address>
#include <KItinerary/Place>
#include <kcontacts_version.h>
#include <grantlee/exception.h>
#include <grantlee/parser.h>
......@@ -30,7 +31,11 @@ QVariant AddressFormatter::doFilter(const QVariant &input, const QVariant &arg,
address.setPostalCode(a.postalCode());
address.setLocality(a.addressLocality());
address.setRegion(a.addressRegion());
#if KContacts_VERSION <= QT_VERSION_CHECK(5, 88, 0)
address.setCountry(KContacts::Address::ISOtoCountry(a.addressCountry()));
#else
address.setCountry(a.addressCountry());
#endif
auto s = escape(address.formattedAddress().trimmed().replace(QLatin1String("\n\n"), QLatin1String("\n")));
return s.get().replace(QLatin1Char('\n'), QLatin1String("<br/>"));
......
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