ALT Linux Bugzilla
– Attachment 1626 Details for
Bug 9993
Gnokii не распознаёт поля имени и фамилии
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Распознавание полей имени и фамилии при чтении из адресной книги
gnokii-0.6.14-nokia6280.patch (text/plain), 6.38 KB, created by
Michael A. Kangin
on 2006-09-13 00:59:37 MSD
(
hide
)
Description:
Распознавание полей имени и фамилии при чтении из адресной книги
Filename:
MIME Type:
Creator:
Michael A. Kangin
Created:
2006-09-13 00:59:37 MSD
Size:
6.38 KB
patch
obsolete
>diff -urN gnokii-0.6.14.orig/common/ldif.c gnokii-0.6.14/common/ldif.c >--- gnokii-0.6.14.orig/common/ldif.c 2006-08-28 02:36:54 +0400 >+++ gnokii-0.6.14/common/ldif.c 2006-09-12 22:41:51 +0400 >@@ -90,8 +90,10 @@ > > aux = strrchr(entry->name, ' '); > if (aux) *aux = 0; >- ldif_entry_write(f, "givenName", entry->name, 1); >- if (aux) ldif_entry_write(f, "sn", aux + 1, 1); >+ if (strlen(entry->firstname) > 0) ldif_entry_write(f, "givenName", entry->firstname, 1); >+ else if (strlen(entry->lastname) == 0) ldif_entry_write(f, "givenName", entry->name, 1); >+ if (strlen(entry->lastname) > 0) ldif_entry_write(f, "sn", entry->lastname, 1); >+ else if (aux) ldif_entry_write(f, "sn", aux + 1, 1); > if (aux) *aux = ' '; > ldif_entry_write(f, "cn", entry->name, 1); > if (entry->caller_group) { >@@ -189,6 +191,10 @@ > } > STORE("cn: ", entry->name); > STORE_BASE64("cn:: ", entry->name); >+ STORE("givenName: ", entry->firstname); >+ STORE_BASE64("givenName:: ", entry->firstname); >+ STORE("sn: ", entry->lastname); >+ STORE_BASE64("sn:: ", entry->lastname); > > STORESUB("homeurl: ", GN_PHONEBOOK_ENTRY_URL); > STORESUB_BASE64("homeurl:: ", GN_PHONEBOOK_ENTRY_URL); >diff -urN gnokii-0.6.14.orig/common/nokia-decoding.c gnokii-0.6.14/common/nokia-decoding.c >--- gnokii-0.6.14.orig/common/nokia-decoding.c 2006-08-28 02:36:54 +0400 >+++ gnokii-0.6.14/common/nokia-decoding.c 2006-09-12 13:15:57 +0400 >@@ -60,6 +60,8 @@ > blockstart[0] != GN_PHONEBOOK_ENTRY_Group && > blockstart[0] != GN_PHONEBOOK_ENTRY_Pointer && > blockstart[0] != GN_PHONEBOOK_ENTRY_RingtoneAdv && >+ blockstart[0] != GN_PHONEBOOK_ENTRY_Firstname && >+ blockstart[0] != GN_PHONEBOOK_ENTRY_Lastname && > /* the last one can be the case of the bitmap name -- we > * don't have phonebook entry allocated then, but a bitmap; > * we handle this later on >@@ -104,6 +106,14 @@ > break; > } > break; >+ case GN_PHONEBOOK_ENTRY_Firstname: /* Firstname */ >+ char_unicode_decode(data->phonebook_entry->firstname, (blockstart + 6), blockstart[5]); >+ dprintf(" Firstname: %s\n", data->phonebook_entry->firstname); >+ break; >+ case GN_PHONEBOOK_ENTRY_Lastname: /* Lastname */ >+ char_unicode_decode(data->phonebook_entry->lastname, (blockstart + 6), blockstart[5]); >+ dprintf(" Lastname: %s\n", data->phonebook_entry->lastname); >+ break; > case GN_PHONEBOOK_ENTRY_Name: /* Name */ > if (data->bitmap) { > char_unicode_decode(data->bitmap->text, (blockstart + 6), blockstart[5]); >diff -urN gnokii-0.6.14.orig/common/phones/nk6510.c gnokii-0.6.14/common/phones/nk6510.c >--- gnokii-0.6.14.orig/common/phones/nk6510.c 2006-08-28 02:36:54 +0400 >+++ gnokii-0.6.14/common/phones/nk6510.c 2006-09-12 22:41:16 +0400 >@@ -2055,6 +2055,8 @@ > data->phonebook_entry->empty = true; > data->phonebook_entry->caller_group = 5; /* no group */ > data->phonebook_entry->name[0] = '\0'; >+ data->phonebook_entry->firstname[0] = '\0'; >+ data->phonebook_entry->lastname[0] = '\0'; > data->phonebook_entry->number[0] = '\0'; > data->phonebook_entry->subentries_count = 0; > data->phonebook_entry->date.year = 0; >@@ -2348,6 +2350,19 @@ > j = char_unicode_encode((string + 1), entry->name, strlen(entry->name)); > string[0] = j; > count += PackBlock(0x07, j + 1, block++, string, req + count, GN_PHONEBOOK_ENTRY_MAX_LENGTH - count); >+ dprintf(" surename: %s...\n",entry->lastname); >+ if (strlen(entry->lastname) > 0) { >+ j = char_unicode_encode((string + 1), entry->lastname, strlen(entry->lastname)); >+ string[0] = j; >+ count += PackBlock(GN_PHONEBOOK_ENTRY_Lastname, j + 1, block++, string, req + count, GN_PHONEBOOK_ENTRY_MAX_LENGTH - count); >+ } >+ >+ dprintf(" givenname: %s...\n",entry->firstname); >+ if (strlen(entry->firstname) > 0) { >+ j = char_unicode_encode((string + 1), entry->firstname, strlen(entry->firstname)); >+ string[0] = j; >+ count += PackBlock(GN_PHONEBOOK_ENTRY_Firstname, j + 1, block++, string, req + count, GN_PHONEBOOK_ENTRY_MAX_LENGTH - count); >+ } > > /* Group */ > string[0] = entry->caller_group + 1; >diff -urN gnokii-0.6.14.orig/common/vcard.c gnokii-0.6.14/common/vcard.c >--- gnokii-0.6.14.orig/common/vcard.c 2006-08-28 02:36:54 +0400 >+++ gnokii-0.6.14/common/vcard.c 2006-09-12 19:11:26 +0400 >@@ -46,6 +46,12 @@ > fprintf(f, "VERSION:3.0\n"); > add_slashes(name, entry->name, sizeof(name), strlen(entry->name)); > fprintf(f, "FN:%s\n", name); >+ if (strlen(entry->lastname) > 0 || strlen(entry->firstname) > 0) { >+ add_slashes(name, entry->lastname, sizeof(name), strlen(entry->lastname)); >+ fprintf(f, "N:%s;", name); >+ add_slashes(name, entry->firstname, sizeof(name), strlen(entry->firstname)); >+ fprintf(f, "%s\n", name); >+ } > fprintf(f, "TEL;VOICE:%s\n", entry->number); > fprintf(f, "X_GSM_STORE_AT:%s\n", location); > fprintf(f, "X_GSM_CALLERGROUP:%d\n", entry->caller_group); >diff -urN gnokii-0.6.14.orig/gnokii/gnokii-phonebook.c gnokii-0.6.14/gnokii/gnokii-phonebook.c >--- gnokii-0.6.14.orig/gnokii/gnokii-phonebook.c 2006-08-28 02:36:54 +0400 >+++ gnokii-0.6.14/gnokii/gnokii-phonebook.c 2006-09-12 21:24:16 +0400 >@@ -172,6 +172,8 @@ > break; > default: > fprintf(stdout, _("%d. Name: %s\n"), entry.location, entry.name); >+ if (strlen(entry.firstname) > 0) fprintf(stdout, _("Givenname: %s\n"), entry.firstname); >+ if (strlen(entry.lastname) > 0) fprintf(stdout, _("Surename: %s\n"), entry.lastname); > fprintf(stdout, _("Group: ")); > switch (entry.caller_group) { > case GN_PHONEBOOK_GROUP_Family: >diff -urN gnokii-0.6.14.orig/include/gnokii/common.h gnokii-0.6.14/include/gnokii/common.h >--- gnokii-0.6.14.orig/include/gnokii/common.h 2006-08-28 02:36:54 +0400 >+++ gnokii-0.6.14/include/gnokii/common.h 2006-09-12 13:15:57 +0400 >@@ -210,6 +210,8 @@ > GN_PHONEBOOK_ENTRY_Group = 0x1e, > GN_PHONEBOOK_ENTRY_URL = 0x2c, > GN_PHONEBOOK_ENTRY_RingtoneAdv= 0x37, >+ GN_PHONEBOOK_ENTRY_Firstname = 0x46, >+ GN_PHONEBOOK_ENTRY_Lastname = 0x47, > } gn_phonebook_entry_type; > > typedef enum { >@@ -237,6 +239,8 @@ > int empty; /* Is this entry empty? */ > char name[GN_PHONEBOOK_NAME_MAX_LENGTH + 1]; /* Plus 1 for > nullterminator. */ >+ char firstname[GN_PHONEBOOK_NAME_MAX_LENGTH + 1]; >+ char lastname[GN_PHONEBOOK_NAME_MAX_LENGTH + 1]; > char number[GN_PHONEBOOK_NUMBER_MAX_LENGTH + 1]; /* Number */ > gn_memory_type memory_type; /* Type of memory */ > int caller_group; /* Caller group - gn_phonebook_group_type */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 9993
: 1626