Merge lp:~rodrigo-moya/ubuntuone-client/fix-614055 into lp:ubuntuone-client

Proposed by Rodrigo Moya
Status: Merged
Approved by: Rodrigo Moya
Approved revision: 670
Merged at revision: 679
Proposed branch: lp:~rodrigo-moya/ubuntuone-client/fix-614055
Merge into: lp:ubuntuone-client
Diff against target: 12 lines (+2/-0)
1 file modified
nautilus/contacts-view.c (+2/-0)
To merge this branch: bzr merge lp:~rodrigo-moya/ubuntuone-client/fix-614055
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
John Lenton (community) Approve
Roman Yepishev (community) Needs Fixing
Review via email: mp+34395@code.launchpad.net

Commit message

When the contact has no name, use whatever is available

Description of the change

When the contact has no name, use whatever is available

To post a comment you must log in.
Revision history for this message
Manuel de la Peña (mandel) wrote :

Is there a way to easily test this?

Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

> Is there a way to easily test this?

yes, add a contact without a name, but a company name, for instance. And check the company name shows in the contacts picker (./nautilus/test-contacts-picker)

Revision history for this message
Roman Yepishev (rye) wrote :

Hm, does not seem to be working:
   http://ubuntuone.com/p/F4L/

Here's the vcard imported to test this:

BEGIN:VCARD
VERSION:3.0
REV:2010-09-06T10:03:12Z
EMAIL;X-EVOLUTION-UI-SLOT=1;TYPE=WORK:<email address hidden>
FBURL:
CALURI:
NOTE:
NICKNAME:
ROLE:
ORG:Organization;;
TITLE:
URL:
END:VCARD

review: Needs Fixing
Revision history for this message
Roman Yepishev (rye) wrote :

Btw, here's what evolution shows for that vcard in the preview panel: http://ubuntuone.com/p/F4M/

Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

> Hm, does not seem to be working:
> http://ubuntuone.com/p/F4L/
>
> Here's the vcard imported to test this:
>
> BEGIN:VCARD
> VERSION:3.0
> REV:2010-09-06T10:03:12Z
> EMAIL;X-EVOLUTION-UI-SLOT=1;TYPE=WORK:<email address hidden>
> FBURL:
> CALURI:
> NOTE:
> NICKNAME:
> ROLE:
> ORG:Organization;;
> TITLE:
> URL:
> END:VCARD

weird, evolution does add a FN (full name) entry to the VCARD when it has no name, so if this was created in Evolution, not sure why it's not added

Revision history for this message
Roman Yepishev (rye) wrote :

> weird, evolution does add a FN (full name) entry to the VCARD when it has no
> name, so if this was created in Evolution, not sure why it's not added

This was not created in evolution but it was crafted separately to list only organization. Evolution handles that fine, though, displaying the organization as the entry title.

Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

> > weird, evolution does add a FN (full name) entry to the VCARD when it has no
> > name, so if this was created in Evolution, not sure why it's not added
>
> This was not created in evolution but it was crafted separately to list only
> organization. Evolution handles that fine, though, displaying the organization
> as the entry title.

Not sure what the problem is then. If Evolution can display it, this code should display it, since it uses E_CONTACT_NAME_OR_ORG, which does return either the name of the contact, the organization or the first email, whatever is available. So, unless contact_name is not NULL (can you check it under gdb please?) not sure why it is not working

Revision history for this message
John Lenton (chipaca) wrote :

I'm not sure this is perfect, but I'm certain it is better :)

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

I can not add a contact with no name (no evolution on my side), but the code looks correct.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus/contacts-view.c'
2--- nautilus/contacts-view.c 2010-07-20 15:10:34 +0000
3+++ nautilus/contacts-view.c 2010-09-02 10:26:38 +0000
4@@ -320,6 +320,8 @@
5 contact_name = (EContactName *) e_contact_get (contact, E_CONTACT_NAME);
6 if (contact_name != NULL)
7 full_name = e_contact_name_to_string (contact_name);
8+ else
9+ full_name = e_contact_get (contact, E_CONTACT_NAME_OR_ORG);
10
11 emails_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL);
12 for (al = emails_list; al != NULL; al = al->next) {

Subscribers

People subscribed via source and target branches