[pim/pimcommon] src/pimcommonakonadi/ldap: Assign missing argument in workAddr before checking is valid
Laurent Montel <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 9fa92da3f5a8407f60132d04ad73bad1e33d95b9 by Laurent Montel.
Committed on 28/07/2026 at 20:38.
Pushed by mlaurent into branch 'master'.
Assign missing argument in workAddr before checking is valid
M +19 -0 src/pimcommonakonadi/ldap/ldapsearchdialog.cpp
https://invent.kde.org/pim/pimcommon/-/commit/9fa92da3f5a8407f60132d04ad73bad1e33d95b9
diff --git a/src/pimcommonakonadi/ldap/ldapsearchdialog.cpp b/src/pimcommonakonadi/ldap/ldapsearchdialog.cpp
index a1a67ab4..8ca91916 100644
--- a/src/pimcommonakonadi/ldap/ldapsearchdialog.cpp
+++ b/src/pimcommonakonadi/ldap/ldapsearchdialog.cpp
@@ -177,6 +177,25 @@ static KContacts::Addressee convertLdapAttributesToAddressee(const KLDAPCore::Ld
// Address
KContacts::Address workAddr(KContacts::Address::Work);
+ if (!attrs.value(QStringLiteral("street")).isEmpty()) {
+ workAddr.setStreet(asUtf8(attrs[QStringLiteral("street")].constFirst()));
+ }
+ if (!attrs.value(QStringLiteral("st")).isEmpty()) {
+ workAddr.setRegion(asUtf8(attrs[QStringLiteral("st")].constFirst()));
+ }
+ if (!attrs.value(QStringLiteral("co")).isEmpty()) {
+ workAddr.setCountry(asUtf8(attrs[QStringLiteral("co")].constFirst()));
+ }
+ if (!attrs.value(QStringLiteral("postalCode")).isEmpty()) {
+ workAddr.setPostalCode(asUtf8(attrs[QStringLiteral("postalCode")].constFirst()));
+ }
+ if (!attrs.value(QStringLiteral("postalAddress")).isEmpty()) {
+ workAddr.setExtended(asUtf8(attrs[QStringLiteral("postalAddress")].constFirst()));
+ }
+ if (!attrs.value(QStringLiteral("l")).isEmpty()) {
+ workAddr.setLocality(asUtf8(attrs[QStringLiteral("l")].constFirst()));
+ }
+
if (!attrs.value(QStringLiteral("department")).isEmpty()) {
addr.setDepartment(asUtf8(attrs[QStringLiteral("department")].constFirst()));
}