Merge lp:~rodrigo-moya/ubuntuone-client/no-null-hash-lookup into lp:ubuntuone-client

Proposed by Rodrigo Moya
Status: Merged
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/ubuntuone-client/no-null-hash-lookup
Merge into: lp:ubuntuone-client
Diff against target: 53 lines (+21/-8)
1 file modified
nautilus/contacts-view.c (+21/-8)
To merge this branch: bzr merge lp:~rodrigo-moya/ubuntuone-client/no-null-hash-lookup
Reviewer Review Type Date Requested Status
Roman Yepishev (community) Needs Fixing
Review via email: mp+23681@code.launchpad.net

Commit message

Use email address as name if there is no name for the contact

Description of the change

Use email address as name if there is no name for the contact

To post a comment you must log in.
Revision history for this message
Roman Yepishev (rye) wrote :

Tested that with my Google Addressbook account and it works great.

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

Just noticed that the string reads
Contact without name nor email addresses

I believe it should be
Contact without name and email addresses

review: Needs Fixing
Revision history for this message
dobey (dobey) wrote :

> Just noticed that the string reads
> Contact without name nor email addresses
>
> I believe it should be
> Contact without name and email addresses

Actually it should just be "or" here. If either of them is in the contact, then this warning won't be printed.

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

As rodrigo was AFK and we needed / wanted this in today's packages, I fixed Roman's issue here: lp:~chipaca/ubuntuone-client/no-null-hash-lookup

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nautilus/contacts-view.c'
--- nautilus/contacts-view.c 2010-04-16 11:52:46 +0000
+++ nautilus/contacts-view.c 2010-04-19 16:21:20 +0000
@@ -315,10 +315,12 @@
315 EContact *contact = l->data;315 EContact *contact = l->data;
316 const gchar *email = NULL;316 const gchar *email = NULL;
317 GList *emails_list, *al;317 GList *emails_list, *al;
318 EContactName *contact_name;
319 gchar *full_name = NULL;
318320
319 /* We add the selected items when searching, so ignore them here */321 contact_name = (EContactName *) e_contact_get (contact, E_CONTACT_NAME);
320 if (g_hash_table_lookup (selection_hash, (gconstpointer) e_contact_get_const (contact, E_CONTACT_FULL_NAME)))322 if (contact_name != NULL)
321 continue;323 full_name = e_contact_name_to_string (contact_name);
322324
323 emails_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL);325 emails_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL);
324 for (al = emails_list; al != NULL; al = al->next) {326 for (al = emails_list; al != NULL; al = al->next) {
@@ -329,17 +331,28 @@
329 break;331 break;
330 }332 }
331333
334 if (full_name == NULL) {
335 if (email != NULL)
336 full_name = g_strdup (email);
337 else {
338 g_warning ("Contact without name nor email addresses");
339 continue;
340 }
341 }
342
343 /* We add the selected items when searching, so ignore them here */
344 if (g_hash_table_lookup (selection_hash, (gconstpointer) full_name))
345 continue;
346
332 if (email != NULL) {347 if (email != NULL) {
333 add_one_contact (cv,348 add_one_contact (cv, full_name, full_name, email, contact);
334 e_contact_get_const (contact, E_CONTACT_FULL_NAME),
335 e_contact_get_const (contact, E_CONTACT_FULL_NAME),
336 email,
337 contact);
338 cv->matched_contacts += 1;349 cv->matched_contacts += 1;
339 }350 }
340351
341 g_list_foreach (emails_list, (GFunc) e_vcard_attribute_free, NULL);352 g_list_foreach (emails_list, (GFunc) e_vcard_attribute_free, NULL);
342 g_list_free (emails_list);353 g_list_free (emails_list);
354 e_contact_name_free (contact_name);
355 g_free (full_name);
343 }356 }
344357
345 g_signal_emit_by_name (cv, "contacts-count-changed",358 g_signal_emit_by_name (cv, "contacts-count-changed",

Subscribers

People subscribed via source and target branches