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

Fix compile without depercated method

parent 438c5676
Pipeline #146696 passed with stage
in 2 minutes and 37 seconds
...@@ -85,7 +85,7 @@ endif() ...@@ -85,7 +85,7 @@ endif()
########### Targets ########### ########### Targets ###########
ecm_set_disabled_deprecation_versions(QT 5.14.0 KF 5.91.0) ecm_set_disabled_deprecation_versions(QT 5.14.0 KF 5.92.0)
if(BUILD_TESTING) if(BUILD_TESTING)
......
...@@ -99,14 +99,14 @@ QVariant ContactsTreeModel::entityData(const Item &item, int column, int role) c ...@@ -99,14 +99,14 @@ QVariant ContactsTreeModel::entityData(const Item &item, int column, int role) c
case HomeAddress: { case HomeAddress: {
const KContacts::Address address = contact.address(KContacts::Address::Home); const KContacts::Address address = contact.address(KContacts::Address::Home);
if (!address.isEmpty()) { if (!address.isEmpty()) {
return address.formattedAddress(); return address.formatted(KContacts::AddressFormatStyle::Postal);
} }
break; break;
} }
case BusinessAddress: { case BusinessAddress: {
const KContacts::Address address = contact.address(KContacts::Address::Work); const KContacts::Address address = contact.address(KContacts::Address::Work);
if (!address.isEmpty()) { if (!address.isEmpty()) {
return address.formattedAddress(); return address.formatted(KContacts::AddressFormatStyle::Postal);
} }
break; break;
} }
......
...@@ -146,7 +146,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const ...@@ -146,7 +146,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
QString formattedAddress; QString formattedAddress;
if (address.label().isEmpty()) { if (address.label().isEmpty()) {
formattedAddress = address.formattedAddress().trimmed().toHtmlEscaped(); formattedAddress = address.formatted(KContacts::AddressFormatStyle::Postal).trimmed().toHtmlEscaped();
} else { } else {
formattedAddress = address.label().toHtmlEscaped(); formattedAddress = address.label().toHtmlEscaped();
} }
......
...@@ -80,7 +80,7 @@ QVariant AddressModel::data(const QModelIndex &index, int role) const ...@@ -80,7 +80,7 @@ QVariant AddressModel::data(const QModelIndex &index, int role) const
if (!addr.label().isEmpty()) { if (!addr.label().isEmpty()) {
str += addr.label().toHtmlEscaped().replace(QLatin1Char('\n'), QLatin1String("<br/>")); str += addr.label().toHtmlEscaped().replace(QLatin1Char('\n'), QLatin1String("<br/>"));
} else { } else {
str += addr.formattedAddress().trimmed().toHtmlEscaped().replace(QLatin1Char('\n'), QLatin1String("<br/>")); str += addr.formatted(KContacts::AddressFormatStyle::Postal).trimmed().toHtmlEscaped().replace(QLatin1Char('\n'), QLatin1String("<br/>"));
} }
return str; return str;
} }
......
Supports Markdown
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