[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stupid bug in xgnokii phonebook editor

From: Pawel Kot
Subject: Re: stupid bug in xgnokii phonebook editor
Date: Mon, 27 Feb 2012 19:39:38 +0100


On Sun, Feb 26, 2012 at 17:55, chr[] <address@hidden> wrote:
> I've got a Nokia C1 phone, which does support multiple phone numbers per name
> entry, that is the PM_EXTPBK flag, isn't it? xgnokii phone book editor shows 
> up
> correct but editing truncates the list.

I think it is a feature of current xgnokii: it does not support
subentries. Patches to change it are welcome.

> Steps to reproduce: launch xgnokii, read phone book. Now create a new phone
> book entry and add >1 numbers to it. Click ok, close the two dialogs. Reopen
> the entry from the list, open the numbers list: it's truncated to one entry:

I think it is some old code that was introduced in order to support
correctly EXTPBK when one number was stored only. At least some models
required to replicate the main number as the subentry. I do not think
we have cared about multiple subentries at that time.

> xgnokii/xgnokii_contacts.c line 395 in EditPhonebookEntry()
> if (phoneMonitor.supported & PM_EXTPBK) {
>    number = g_malloc(sizeof(char) * max_number_length);
>    gtk_label_get(GTK_LABEL(data->number), number);
>    snprintf(current_entry->entry.number, max_number_length, "%s", number[0]);
>    snprintf(current_entry->entry.subentries[0].data.number, max_number_length,
> "%s", number[0]);
>    current_entry->entry.subentries[0].entry_type = GN_PHONEBOOK_ENTRY_Number;
>    current_entry->entry.subentries[0].number_type =
>    // ??WTF::

That's plain simple. We're creating a subentry which is equal to the
main number.

>    current_entry->entry.subentries_count = 1;
>    g_free(number);
> } else {
>    snprintf(current_entry->entry.number, max_number_length, "%s",
>         gtk_entry_get_text(GTK_ENTRY(data->number)));
> }
> This block doesn't make sense.

See above. Do not be easy on judgements.

> Delete this block and the phone book works.

What do you mean by "works" here? How would it keep other subentries?

> current_entry->entry.number is already set.

That's not enough as explained above.

take care,
Pawel Kot

reply via email to

[Prev in Thread] Current Thread [Next in Thread]