Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kcontacts for openSUSE:Factory checked in at 2021-12-13 20:40:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kcontacts (Old) and /work/SRC/openSUSE:Factory/.kcontacts.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kcontacts" Mon Dec 13 20:40:35 2021 rev:75 rq:939198 version:5.89.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kcontacts/kcontacts.changes 2021-11-15 15:26:08.665819197 +0100 +++ /work/SRC/openSUSE:Factory/.kcontacts.new.2520/kcontacts.changes 2021-12-13 20:43:50.680481024 +0100 @@ -1,0 +2,14 @@ +Sat Dec 4 22:56:26 UTC 2021 - Christophe Giboudeaux <[email protected]> + +- Update to 5.89.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.89.0 +- Changes since 5.88.0: + * Fix address formatting for country-only addresses + * Deprecate countryToISO/ISOToCountry in favor of KCountry + * Use local country names when formatting addresses + * Add KF6 TODO for turning AddresseeHelper into an implementation detail + * Port away from countryToISO/ISOtoCountry + +------------------------------------------------------------------- Old: ---- kcontacts-5.88.0.tar.xz kcontacts-5.88.0.tar.xz.sig New: ---- kcontacts-5.89.0.tar.xz kcontacts-5.89.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kcontacts.spec ++++++ --- /var/tmp/diff_new_pack.kuiMbi/_old 2021-12-13 20:43:51.248481093 +0100 +++ /var/tmp/diff_new_pack.kuiMbi/_new 2021-12-13 20:43:51.252481094 +0100 @@ -16,14 +16,14 @@ # -%define _tar_path 5.88 +%define _tar_path 5.89 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: kcontacts -Version: 5.88.0 +Version: 5.89.0 Release: 0 Summary: KDE Frameworks based address book API License: LGPL-2.1-or-later ++++++ kcontacts-5.88.0.tar.xz -> kcontacts-5.89.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/CMakeLists.txt new/kcontacts-5.89.0/CMakeLists.txt --- old/kcontacts-5.88.0/CMakeLists.txt 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/CMakeLists.txt 2021-12-04 19:33:12.000000000 +0100 @@ -1,13 +1,13 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.88.0") # handled by release scripts -set(KF_DEP_VERSION "5.87.0") # handled by release scripts +set(KF_VERSION "5.89.0") # handled by release scripts +set(KF_DEP_VERSION "5.89.0") # handled by release scripts project(KContacts VERSION ${KF_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.87.0 NO_MODULE) +find_package(ECM 5.89.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/LICENSES/CC0-1.0.txt new/kcontacts-5.89.0/LICENSES/CC0-1.0.txt --- old/kcontacts-5.88.0/LICENSES/CC0-1.0.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/kcontacts-5.89.0/LICENSES/CC0-1.0.txt 2021-12-04 19:33:12.000000000 +0100 @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/autotests/addresstest.cpp new/kcontacts-5.89.0/autotests/addresstest.cpp --- old/kcontacts-5.88.0/autotests/addresstest.cpp 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/autotests/addresstest.cpp 2021-12-04 19:33:12.000000000 +0100 @@ -157,7 +157,7 @@ const QString result( QStringLiteral("Jim Knopf\nLummerlandstr. 1\n" - "12345 Lummerstadt\n\nGERMANY")); + "12345 Lummerstadt\n\nGERMANIA")); QCOMPARE(address.formattedAddress(QStringLiteral("Jim Knopf")), result); } @@ -172,7 +172,7 @@ const QString result( QStringLiteral("Huck Finn\n457 Foobar Ave\nNervousbreaktown," - " DC 1A2B3C\n\nUNITED STATES OF AMERICA")); + " DC 1A2B3C\n\nSTATI UNITI")); QCOMPARE(address.formattedAddress(QStringLiteral("Huck Finn")), result); } @@ -185,7 +185,7 @@ const QString result( QStringLiteral("Jim Knopf\nLummerlandstr. 1\n" - "12345 Lummerstadt\n\nDEUTSCHLAND")); + "12345 Lummerstadt\n\nGERMANIA")); QCOMPARE(address.formattedAddress(QStringLiteral("Jim Knopf")), result); } @@ -211,10 +211,29 @@ address.setCountry(QStringLiteral("Schweiz")); // we want the Italian variant of the Swiss format for it_CH - const QString result(QStringLiteral("Dr. Konqui\nCasella postale 5678\nHaus Randa\n1234 Randa\n\nSCHWEIZ")); + const QString result(QStringLiteral("Dr. Konqui\nCasella postale 5678\nHaus Randa\n1234 Randa\n\nSVIZZERA")); QCOMPARE(address.formattedAddress(QStringLiteral("Dr. Konqui")), result); } + + { + KContacts::Address address; + address.setStreet(QStringLiteral("Haus Randa")); + address.setPostalCode(QStringLiteral("1234")); + address.setLocality(QStringLiteral("Randa")); + address.setPostOfficeBox(QStringLiteral("5678")); + address.setCountry(QStringLiteral("CH")); + + // we want the Italian variant of the Swiss format for it_CH + const QString result(QStringLiteral("Dr. Konqui\nCasella postale 5678\nHaus Randa\n1234 Randa\n\nSVIZZERA")); + QCOMPARE(address.formattedAddress(QStringLiteral("Dr. Konqui")), result); + } + + { + KContacts::Address address; + address.setCountry(QStringLiteral("CH")); + QCOMPARE(address.formattedAddress(QString()), QLatin1String("Svizzera")); + } } void AddressTest::shouldExportVcard3() @@ -418,6 +437,7 @@ void AddressTest::countryToISOTest() { using namespace KContacts; +#if KCONTACTS_BUILD_DEPRECATED_SINCE(5, 89) QCOMPARE(Address::countryToISO(QStringLiteral("France")), QLatin1String("fr")); QCOMPARE(Address::countryToISO(QStringLiteral("Frankreich")), QLatin1String("fr")); QCOMPARE(Address::countryToISO(QStringLiteral("Germany")), QLatin1String("de")); @@ -433,6 +453,7 @@ QCOMPARE(Address::countryToISO(QStringLiteral("Osterreich")), QLatin1String("at")); QCOMPARE(Address::countryToISO(QStringLiteral("??nited States\nOf America")), QLatin1String("us")); +#endif } void AddressTest::isoToCountryTest() @@ -441,6 +462,7 @@ qputenv("LANGUAGE", "en"); using namespace KContacts; +#if KCONTACTS_BUILD_DEPRECATED_SINCE(5, 89) QCOMPARE(Address::ISOtoCountry(QStringLiteral("FR")), QLatin1String("France")); QCOMPARE(Address::ISOtoCountry(QStringLiteral("de")), QLatin1String("Germany")); @@ -448,4 +470,5 @@ QCOMPARE(Address::ISOtoCountry(QStringLiteral("EU")), QLatin1String("EU")); QCOMPARE(Address::ISOtoCountry(QStringLiteral("zz")), QLatin1String("zz")); QCOMPARE(Address::ISOtoCountry(QStringLiteral("0")), QLatin1String("0")); +#endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/po/zh_CN/kcontacts5.po new/kcontacts-5.89.0/po/zh_CN/kcontacts5.po --- old/kcontacts-5.88.0/po/zh_CN/kcontacts5.po 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/po/zh_CN/kcontacts5.po 2021-12-04 19:33:12.000000000 +0100 @@ -8,7 +8,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2021-10-24 00:14+0000\n" -"PO-Revision-Date: 2021-10-29 13:24\n" +"PO-Revision-Date: 2021-11-30 15:20\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/src/CMakeLists.txt new/kcontacts-5.89.0/src/CMakeLists.txt --- old/kcontacts-5.88.0/src/CMakeLists.txt 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/src/CMakeLists.txt 2021-12-04 19:33:12.000000000 +0100 @@ -2,46 +2,82 @@ add_library(KF5::Contacts ALIAS KF5Contacts) target_sources(KF5Contacts PRIVATE - vcardparser/vcard.cpp - vcardparser/vcardline.cpp - vcardparser/vcardparser.cpp - - address.cpp - addressee.cpp - addresseehelper.cpp - calendarurl.cpp - contactgroup.cpp - contactgrouptool.cpp - email.cpp - field.cpp - geo.cpp - gender.cpp - impp.cpp - key.cpp - lang.cpp - ldif.cpp - phonenumber.cpp - picture.cpp - related.cpp - resourcelocatorurl.cpp - secrecy.cpp - sound.cpp - timezone.cpp - vcarddrag.cpp - vcardtool.cpp - fieldgroup.cpp - title.cpp - nickname.cpp - role.cpp - note.cpp - org.cpp - clientpidmap.cpp + address.cpp + addressee.cpp + addressee.h + addresseehelper.cpp + addresseehelper.h + addresseelist.h + address.h + calendarurl.cpp + calendarurl.h + clientpidmap.cpp + clientpidmap.h + contactgroup.cpp + contactgroup.h + contactgrouptool.cpp + contactgrouptool.h + converter/ldifconverter.cpp + converter/ldifconverter.h + converter/vcardconverter.cpp + converter/vcardconverter.h + email.cpp + email.h + field.cpp + fieldgroup.cpp + fieldgroup.h + field.h + gender.cpp + gender.h + geo.cpp + geo.h + impp.cpp + impp.h + key.cpp + key.h + lang.cpp + lang.h + ldif.cpp + ldif_p.h + nickname.cpp + nickname.h + note.cpp + note.h + org.cpp + org.h + parametermap_p.h + phonenumber.cpp + phonenumber.h + picture.cpp + picture.h + related.cpp + related.h + resourcelocatorurl.cpp + resourcelocatorurl.h + role.cpp + role.h + secrecy.cpp + secrecy.h + sound.cpp + sound.h + timezone.cpp + timezone.h + title.cpp + title.h + vcarddrag.cpp + vcarddrag.h + vcardparser/vcard.cpp + vcardparser/vcardline.cpp + vcardparser/vcardline_p.h + vcardparser/vcardparser.cpp + vcardparser/vcardparser_p.h + vcardparser/vcard_p.h + vcardtool.cpp + vcardtool_p.h + kcontacts.qrc improtocols/improtocols.qrc - - converter/vcardconverter.cpp - converter/ldifconverter.cpp ) ecm_qt_declare_logging_category(KF5Contacts @@ -53,14 +89,13 @@ EXPORT KCONTACTS ) -#generate_export_header(KF5Contacts BASE_NAME kcontacts) ecm_generate_export_header(KF5Contacts EXPORT_FILE_NAME kcontacts_export.h BASE_NAME kcontacts GROUP_BASE_NAME KF VERSION ${KF_VERSION} DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 5.88 + DEPRECATION_VERSIONS 5.88 5.89 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} ) @@ -147,15 +182,6 @@ DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}" ) -ecm_generate_export_header(KF5Contacts - BASE_NAME KContacts - GROUP_BASE_NAME KF - VERSION ${KF_VERSION} - DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 5.88 - EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} -) - ecm_generate_pri_file(BASE_NAME KContacts LIB_NAME KF5Contacts DEPS "KCoreAddons" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KContacts) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/src/address.cpp new/kcontacts-5.89.0/src/address.cpp --- old/kcontacts-5.88.0/src/address.cpp 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/src/address.cpp 2021-12-04 19:33:12.000000000 +0100 @@ -552,16 +552,6 @@ return str; } -static QString countryCodeFromLocale() -{ - const auto n = QLocale().name(); // this is in the form <lang>_<COUNTRY>, with the exception of 'C' - const auto idx = n.indexOf(QLatin1Char('_')); - if (idx > 0) { - return n.mid(idx + 1).toLower(); - } - return {}; -} - static QString addressFormatRc() { Q_INIT_RESOURCE(kcontacts); // must be called outside of a namespace @@ -570,20 +560,23 @@ QString Address::formattedAddress(const QString &realName, const QString &orgaName) const { - QString ciso; + KCountry countryCode; QString addrTemplate; QString ret; - // FIXME: first check for iso-country-field and prefer that one - if (!country().isEmpty()) { - ciso = countryToISO(country()); - } else { - // fall back to our own country - ciso = countryCodeFromLocale(); + if (country().size() == 2) { + countryCode = KCountry::fromAlpha2(country()); + } + if (!countryCode.isValid()) { + countryCode = KCountry::fromName(country()); + } + // fall back to our own country + if (!countryCode.isValid()) { + countryCode = KCountry::fromQLocale(QLocale().country()); } static const KConfig entry(addressFormatRc()); - KConfigGroup group = entry.group(ciso); + KConfigGroup group = entry.group(countryCode.alpha2()); // decide whether this needs special business address formatting if (orgaName.isEmpty()) { addrTemplate = group.readEntry("AddressFormat"); @@ -598,7 +591,7 @@ // used: if (addrTemplate.isEmpty()) { qCWarning(KCONTACTS_LOG) << "address format database incomplete" - << "(no format for locale" << ciso << "found). Using default address formatting."; + << "(no format for locale" << countryCode.alpha2() << "found). Using default address formatting."; addrTemplate = QStringLiteral("%0(%n\\n)%0(%cm\\n)%0(%s\\n)%0(PO BOX %p\\n)%0(%l%w%r)%,%z"); } @@ -608,37 +601,43 @@ // now add the country line if needed (formatting this time according to // the rules of our own system country ) if (!country().isEmpty()) { + const QString countryName = countryCode.isValid() ? countryCode.name() : country(); + // Don't include line breaks if country is the only text if (ret.isEmpty()) { - return country().toUpper(); + return countryName; } - KConfigGroup group = entry.group(countryCodeFromLocale()); + KConfigGroup group = entry.group(KCountry::fromQLocale(QLocale().country()).alpha2()); QString cpos = group.readEntry("AddressCountryPosition"); if (QLatin1String("BELOW") == cpos || cpos.isEmpty()) { - ret = ret + QLatin1String("\n\n") + country().toUpper(); + ret = ret + QLatin1String("\n\n") + countryName.toUpper(); } else if (QLatin1String("below") == cpos) { - ret = ret + QLatin1String("\n\n") + country(); + ret = ret + QLatin1String("\n\n") + countryName; } else if (QLatin1String("ABOVE") == cpos) { - ret = country().toUpper() + QLatin1String("\n\n") + ret; + ret = countryName.toUpper() + QLatin1String("\n\n") + ret; } else if (QLatin1String("above") == cpos) { - ret = country() + QLatin1String("\n\n") + ret; + ret = countryName + QLatin1String("\n\n") + ret; } } return ret; } +#if KCONTACTS_BUILD_DEPRECATED_SINCE(5, 89) QString Address::countryToISO(const QString &cname) { return KCountry::fromName(cname).alpha2().toLower(); } +#endif +#if KCONTACTS_BUILD_DEPRECATED_SINCE(5, 89) QString Address::ISOtoCountry(const QString &ISOname) { const auto c = KCountry::fromAlpha2(ISOname); return c.isValid() ? c.name() : ISOname; } +#endif // clang-format off QDataStream &KContacts::operator<<(QDataStream &s, const Address &addr) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/src/address.h new/kcontacts-5.89.0/src/address.h --- old/kcontacts-5.88.0/src/address.h 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/src/address.h 2021-12-04 19:33:12.000000000 +0100 @@ -318,22 +318,34 @@ */ Q_REQUIRED_RESULT QString formattedAddress(const QString &realName = QString(), const QString &orgaName = QString()) const; +#if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 89) /** Returns ISO code for a localized country name. Only localized country names will be understood. @param cname name of the country @return two digit ISO code, empty string if the country was not recognized + @deprecated since 5.88, use KCountry::fromName() instead. + Note that this function returned the ISO code incorrectly in lower case, + while KCountry does not do that. */ + KCONTACTS_DEPRECATED_VERSION(5, 89, "Use KCountry::fromName()") static QString countryToISO(const QString &cname); +#endif +#if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 89) /** Returns a localized country name for a ISO code. This might be replaced by a KLocale method in the future. @param ISOname two digit ISO code @return localized name of the country + @deprecated since 5.88, use KCountry::fromAlpha2() instead. + Note that this function returns @p ISOname if that is not a valid country code, + while KCountry will need an explicit check for that case. */ + KCONTACTS_DEPRECATED_VERSION(5, 89, "Use KCountry::fromAlpha2()") static QString ISOtoCountry(const QString &ISOname); +#endif static QString typeFlagLabel(TypeFlag type); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/src/addresseehelper.h new/kcontacts-5.89.0/src/addresseehelper.h --- old/kcontacts-5.88.0/src/addresseehelper.h 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/src/addresseehelper.h 2021-12-04 19:33:12.000000000 +0100 @@ -16,6 +16,11 @@ { class AddresseeHelperPrivate; +// TODO KF6: unexport and turn into an implementation detail +// this is unused externally, both as code as well as via the config file +// so we only need this internally and can probably also drop the config +// file access + /** * This singleton class stores static data, which is shared * by all Addressee objects. It maintains three lists of @@ -38,8 +43,10 @@ * should be interpreted as a family name (see * treatAsFamilyName()). The corresponding configuration * field is @c TreatAsFamilyName. + * + * @warning Do not use, to be removed from the public interface in KF6. */ -class KCONTACTS_EXPORT AddresseeHelper : public QObject +class KCONTACTS_EXPORT KCONTACTS_DEPRECATED_VERSION(5, 89, "unused externally") AddresseeHelper : public QObject { Q_OBJECT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/src/addressformatrc new/kcontacts-5.89.0/src/addressformatrc --- old/kcontacts-5.88.0/src/addressformatrc 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/src/addressformatrc 2021-12-04 19:33:12.000000000 +0100 @@ -1,149 +1,149 @@ -[ar] +[AR] AddressFormat=%0(%cm\n)%0(%n\n)%0(Casilla de Correo %p\n)%0(%s\n)%z%w%l AddressCountryPosition=below -[at] +[AT] AddressFormat=%0(%n\n)%0(%cm\n)%0(Postfach %p\n)%0(%s\n)%0(%z)%w%l BusinessAddressFormat=%0(%cm\n)%0(z.Hd. %n\n)%0(Postfach %p\n)%0(%s\n)%0(%z)%w%l AddressCountryPosition=below -[au] +[AU] AddressFormat=%0(%n\n)%0(%cm\n)%0(%s\n)%0(PO BOX %p\n)%0(%L%w%w%R%w%w)%z AddressCountryPosition=BELOW -[ax] +[AX] AddressFormat=%0(%cm\n)%0(%n\n)%0(PB %p\n)%0(%s\n)%z%w%L AddressCountryPosition=BELOW -[be] +[BE] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(PO Box %p\n)%z%w%L AddressFormat[fr]=%0(%cm\n)%0(%n\n)%0(%s\n)%0(BP %p\n)%z%w%L AddressFormat[de]=%0(%cm\n)%0(%n\n)%0(%s\n)%0(Postfach %p\n)%z%w%L AddressFormat[nl]=%0(%cm\n)%0(%n\n)%0(%s\n)%0(Postbus %p\n)%z%w%L AddressCountryPosition=BELOW -[bl] +[BL] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(BP %p\n)%z%w%L AddressCountryPosition=BELOW -[br] +[BR] AddressFormat=%0(%cm\n)%0(%n\n)%0(Caixa Postal %p\n)%0(%s\n)%l%0( - %r)%0(\n%z) -[ca] +[CA] AddressFormat=%0(%N\n)%0(%CM\n)%0(%S\n)%0(PO BOX %p\n)%0(%L%w%R)%,%z AddressCountryPosition=BELOW -[ch] +[CH] AddressFormat=%0(%cm\n)%0(%n\n)%0(P.O. Box %p\n)%0(%s\n)%z%w%l AddressFormat[de]=%0(%cm\n)%0(%n\n)%0(Postfach %p\n)%0(%s\n)%z%w%l AddressFormat[fr]=%0(%cm\n)%0(%n\n)%0(Case postale %p\n)%0(%s\n)%z%w%l AddressFormat[it]=%0(%cm\n)%0(%n\n)%0(Casella postale %p\n)%0(%s\n)%z%w%l AddressCountryPosition=BELOW -[cz] +[CZ] AddressFormat=%0(%cm\n)%0(%n\n)%0(p.???p. %p\n)%0(%s\n)%z%w%w%l AddressCountryPosition=BELOW -[de] +[DE] AddressFormat=%0(%cm\n)%0(%n\n)%0(Postfach %p\n)%0(%s\n)%z%w%l AddressFormat[nds]=%0(%n\n)%0(- %cm -\n)%0(Postfach %p\n)%0(%s\n)%z%w%l AddressCountryPosition=BELOW -[dk] +[DK] AddressFormat=%0(%n\n)%0(%cm\n)%0(%s\n)%0(Postboks %p\n)%z%w%l AddressCountryPosition=below -[es] +[ES] AddressFormat=%0(%cm\n)%0(%n\n)%0(Apartado Postal %p\n)%0(%s\n)%z%w%l%0(\n%r) -[fi] +[FI] AddressFormat=%0(%cm\n)%0(%n\n)%0(PB %p\n)%0(%s\n)%z%w%L AddressCountryPosition=BELOW -[fr] +[FR] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(BP %p\n)%z%w%L AddressCountryPosition=BELOW -[gb] +[GB] AddressFormat=%0(%n\n)%0(%cm\n)%0(PO Box %p\n)%0(%s\n)%0(%L\n)%0(%r\n)%0(%z\n) AddressCountryPosition=BELOW -[gl] +[GL] AddressFormat=%0(%n\n)%0(%cm\n)%0(%s\n)%0(Postboks %p\n)%z%w%l AddressCountryPosition=below -[gr] +[GR] AddressFormat=%0(%n\n)%0(%cm\n)%0(%S\n)%0(P.O. BOX %p\n)%z%w%L AddressCountryPosition=BELOW -[hu] +[HU] AddressFormat=%0(%n\n)%0(\n%l)%0(\n%s)%0(\nPF. %p)%0(\n%z)%0(\n%r) BusinessAddressFormat=%0(%n\n)%cm\n%z%w%l%0(\n%s)%0(\nPF. %p)%0(\n%r) AddressCountryPosition=below -[il] +[IL] AddressFormat=%0(%n\n)%0(%cm\n)%0(??.??. %p\n)%0(%s\n)%0(%l%w%z) AddressCountryPosition=BELOW -[it] +[IT] AddressFormat=%0(%cm\n)%0(%n\n)%0(%S\n)%0(CASELLA POSTALE %p\n)%0(%z%w%L)%w%R AddressCountryPosition=BELOW -[jp] +[JP] AddressFormat=%0(%z%w%r)%w%l%0(\n%s)%0(\n%cm)%0(\n%n) AddressCountryPosition=ABOVE -[kh] +[KH] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(P.O. Box %p\n)%z%w%L%0(\n%r) AddressCountryPosition=BELOW -[lu] +[LU] AddressFormat=%0(%n\n)%0(%cm\n)%0(PO Box %p\n)%0(%s\n)%z%w%L AddressFormat[fr]=%0(%n\n)%0(%cm\n)%0(BP %p\n)%0(%s\n)%z%w%L AddressFormat[de]=%0(%n\n)%0(%cm\n)%0(Postfach %p\n)%0(%s\n)%z%w%L AddressCountryPosition=BELOW -[me] +[ME] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(po??tanski fah %p\n)%z%w%l AddressFormat[sr]=%0(%cm\n)%0(%n\n)%0(%s\n)%0(?????????????????? ?????? %p\n)%z%w%l AddressCountryPosition=BELOW -[mf] +[MF] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(BP %p\n)%z%w%L AddressCountryPosition=BELOW -[mp] +[MP] AddressFormat=%0(%n\n)%0(%cm\n)%0(%s\n)%0(PO BOX %p\n)%0(%l%,%w%r)%w%z AddressCountryPosition=BELOW -[na] +[NA] AddressFormat=%0(%cm\n)%0(%n\n)%0(P.O. Box %p\n)%l AddressCountrzPosition=below -[nl] +[NL] AddressFormat=%n\n%0(%cm\n)%0(Postbus %p\n)%0(%s\n)%z%w%l AddressCountryPosition=below -[no] +[NO] AddressFormat=%0(%cm\n)%0(%n\n)%0(Postboks %p\n)%0(%s\n)%z%w%w%L AddressCountryPosition=BELOW -[nz] +[NZ] AddressFormat=%0(%n\n)%0(%cm\n)%0(PO Box %p\n)%0(%s\n)%L%w%z AddressCountryPosition=BELOW -[rs] +[RS] AddressFormat=%0(%cm\n)%0(%n\n)%0(%s\n)%0(?????????????????? ?????? %p\n)%z%w%l AddressFormat[sr@latin]=%0(%cm\n)%0(%n\n)%0(%s\n)%0(po??tanski fah %p\n)%z%w%l AddressCountryPosition=BELOW -[se] +[SE] AddressFormat=%n\n%0(%cm\n)%0(Box %p\n)%0(%s\n)%z%w%w%L AddressCountryPosition=below -[si] +[SI] AddressFormat=%n\n%s\n%0(p.p. %p\n)%z %l -[us] +[US] AddressFormat=%0(%n\n)%0(%cm\n)%0(%s\n)%0(PO BOX %p\n)%0(%l%,%w%r)%w%z AddressCountryPosition=BELOW diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcontacts-5.88.0/src/converter/ldifconverter.cpp new/kcontacts-5.89.0/src/converter/ldifconverter.cpp --- old/kcontacts-5.88.0/src/converter/ldifconverter.cpp 2021-11-06 14:16:05.000000000 +0100 +++ new/kcontacts-5.89.0/src/converter/ldifconverter.cpp 2021-12-04 19:33:12.000000000 +0100 @@ -26,6 +26,7 @@ #include "ldif_p.h" +#include <KCountry> #include <KLocalizedString> #include <QStringList> @@ -130,6 +131,12 @@ return result; } +static QString countryName(const QString &isoCodeOrName) +{ + const auto c = KCountry::fromAlpha2(isoCodeOrName); + return c.isValid() ? c.name() : isoCodeOrName; +} + bool LDIFConverter::addresseeToLDIF(const Addressee &addr, QString &str) { if (addr.isEmpty()) { @@ -194,7 +201,7 @@ ldif_out(t, QStringLiteral("mozillahomelocalityname"), homeAddr.locality()); // Netscape 7 ldif_out(t, QStringLiteral("mozillahomestate"), homeAddr.region()); ldif_out(t, QStringLiteral("mozillahomepostalcode"), homeAddr.postalCode()); - ldif_out(t, QStringLiteral("mozillahomecountryname"), Address::ISOtoCountry(homeAddr.country())); + ldif_out(t, QStringLiteral("mozillahomecountryname"), countryName(homeAddr.country())); ldif_out(t, QStringLiteral("locality"), workAddr.locality()); ldif_out(t, QStringLiteral("streetaddress"), workAddr.street()); // Netscape 4.x @@ -206,9 +213,9 @@ if (streetsCount > 1) { ldif_out(t, QStringLiteral("mozillaworkstreet2"), streets.at(1)); } - ldif_out(t, QStringLiteral("countryname"), Address::ISOtoCountry(workAddr.country())); + ldif_out(t, QStringLiteral("countryname"), countryName(workAddr.country())); ldif_out(t, QStringLiteral("l"), workAddr.locality()); - ldif_out(t, QStringLiteral("c"), Address::ISOtoCountry(workAddr.country())); + ldif_out(t, QStringLiteral("c"), countryName(workAddr.country())); ldif_out(t, QStringLiteral("st"), workAddr.region()); ldif_out(t, QStringLiteral("title"), addr.title()); @@ -522,7 +529,7 @@ if (fieldname == QLatin1String("mozillahomecountryname")) { // mozilla if (value.length() <= 2) { - value = Address::ISOtoCountry(value); + value = countryName(value); } homeAddr.setCountry(value); return; @@ -541,7 +548,7 @@ if (fieldname == QLatin1String("countryname") // || fieldname == QLatin1Char('c')) { // mozilla if (value.length() <= 2) { - value = Address::ISOtoCountry(value); + value = countryName(value); } workAddr.setCountry(value); return;
