Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #82 from matthewvogt/organization-name
[libcontacts] Prefer organization name to contact details in display label
  • Loading branch information
matthewvogt committed Jun 13, 2014
2 parents e442c84 + ec3863f commit 972990d992b3a34d466c2886e7729ef18b463855
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/seasidecache.cpp
@@ -1138,6 +1138,12 @@ QString SeasideCache::generateDisplayLabelFromNonNameDetails(const QContact &con
}
}

// If this contact has organization details but no name, it probably represents that organization directly
QContactOrganization company = contact.detail<QContactOrganization>();
if (!company.name().isEmpty()) {
return company.name();
}

// If none of the detail fields provides a label, fallback to the backend's label string, in
// preference to using any of the addressing details directly
const QString displayLabel = contact.detail<QContactDisplayLabel>().label();
@@ -1157,11 +1163,6 @@ QString SeasideCache::generateDisplayLabelFromNonNameDetails(const QContact &con
}
}

QContactOrganization company = contact.detail<QContactOrganization>();
if (!company.name().isEmpty()) {
return company.name();
}

foreach (const QContactPhoneNumber& phone, contact.details<QContactPhoneNumber>()) {
if (!phone.number().isEmpty())
return phone.number();

0 comments on commit 972990d

Please sign in to comment.