Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #63 from matthewvogt/display-label-precedence
[libcontacts] Use backend display label in preference to address detail
  • Loading branch information
matthewvogt committed Dec 10, 2013
2 parents fe39841 + 708aa7a commit 6d62371
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/seasidecache.cpp
Expand Up @@ -1089,12 +1089,6 @@ QString SeasideCache::generateDisplayLabel(const QContact &contact, DisplayLabel
return displayLabel;
}

// If no label was determined from any of the available detail, fallback to the backend's label
displayLabel = contact.detail<QContactDisplayLabel>().label();
if (!displayLabel.isEmpty()) {
return displayLabel;
}

return "(Unnamed)"; // TODO: localisation
}

Expand All @@ -1119,6 +1113,13 @@ QString SeasideCache::generateDisplayLabelFromNonNameDetails(const QContact &con
}
}

// 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();
if (!displayLabel.isEmpty()) {
return displayLabel;
}

foreach (const QContactOnlineAccount& account, contact.details<QContactOnlineAccount>()) {
if (!account.accountUri().isEmpty()) {
return account.accountUri();
Expand Down

0 comments on commit 6d62371

Please sign in to comment.