2010-08-26 09:48:52

by Lukasz Pawlik

[permalink] [raw]
Subject: [PATCH] Fix handling empty fields in VCARDs



Attachments:
0001-Fix-handling-empty-fields-in-VCARDs.patch (4.93 kB)

2010-08-26 11:28:02

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Fix handling empty fields in VCARDs

Hi Lukasz,

On Thu, Aug 26, 2010, Lukasz Pawlik wrote:
> From c9a89b18acf88ac0546ba72d0a169d9c2f18656d Mon Sep 17 00:00:00 2001
> From: Lukasz Pawlik <[email protected]>
> Date: Thu, 26 Aug 2010 11:33:33 +0200
> Subject: [PATCH] Fix handling empty fields in VCARDs
>
> Previously even mandatory TEL field was not printed in VCARD if it was
> empty. This patch fix this. Now tag TEL will be printed if phone number
> is not set in phonebook. This patch also fix handling category string
> for VCARDs in version 2.1 for url field.
> ---
> plugins/vcard.c | 54 ++++++++++++++++++++++++++++++++++++------------------
> 1 files changed, 36 insertions(+), 18 deletions(-)

Thanks. The patch is now upstream. Btw, it's written vCard and not VCARD
(I fixed this for you manually).

Johan

2010-08-26 08:15:38

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Fix handling empty fields in VCARDs

Hi Lukasz,

> From 4bb29cdaf4a9923ab62973c38914ebb67f718d64 Mon Sep 17 00:00:00 2001
> From: Lukasz Pawlik <[email protected]>
> Date: Thu, 26 Aug 2010 09:10:26 +0200
> Subject: [PATCH] Fix handling empty fields in VCARDs
>
> Previously even mandatory TEL field was not printed in VCARD if it was
> empty. This patch fix this. Now tag TEL will be printed if phone number
> is not set in phonebook. This patch also fix handling category string
> for VCARDs in version 2.1 for url field.
> ---
> plugins/vcard.c | 51 ++++++++++++++++++++++++++++++++-------------------
> 1 files changed, 32 insertions(+), 19 deletions(-)

In general the patch seems fine, but you need to fix your editor
settings when dealing with BlueZ code. It seems like you're using spaces
for indentation when the coding style is tabs-only:

> - for (l = contact->numbers; l; l = l->next) {
> + if (g_slist_length(l) == 0)
> + vcard_printf_number(vcards, format, NULL, 1,
> + TEL_TYPE_OTHER);

All of the above three added lines are indented with spaces.

> + for (; l; l = l->next) {

This added line is indented with tabs. How did you manage to get your
editor to produce such mixed results?

> + if (g_slist_length(l) == 0)
> + vcard_printf_email(vcards, format, NULL,
> + EMAIL_TYPE_OTHER);

The first line is tabs but the two others use spaces!?

> - for (l = contact->emails; l; l = l->next){
> + for (; l; l = l->next){

Again spaces here.

Please enable whitespace visualization and use proper editor settings to
avoid these issues in the future. Thanks.

Johan