From: Roger B. <ro...@ro...> - 2004-05-19 02:27:38
|
Stephen Wood wrote: > I wonder if the BitFling client should be unavailable for binary > builds. Developers will generally be running from the CVS source. But > I guess I can think of uses for BitFling other than developing, such as > friends or co-workers sharing phonebooks. Yes, I was hoping that people would think of new ways of using BitFling. It will certainly help when the code and UI are more complete. > I figured something had to be done! And it gave me an excuse to explore > other parts of the code. There is one part that is a blocker for 0.7 and needs to be completed. It is the code that deals with "importing" phonebook entries. The import process happens when you do a CSV/Outlook import, but also when a phonebook is read from a phone. Two pieces of code run. The first tries to match imported entries up against existing ones, in order to decide if the imported entry is a new entry or a variation of an existing entry. (Ideally it should also detect existing entries that should be deleted). I did write the code for this stuff, but it hasn't been thoroughly tested. The second piece of code merges two entries, and is incomplete. It has to deal with things like data being mangled where it came from (eg a phone with limited space for names, punctuation removed from phone numbers). This code really needs to be completed. Here is what I sent someone else about it: Look at phonebook.ImportDialog.MergeEntries() It is trying to merge two entries. One is what BitPim has already stored, and the other is from an import source such as Outlook, a CSV file or a phone. It needs to go through each type of data and do the right thing. That means deciding if the imported data is an update or augmentation and applying it if so. Things are made somewhat more complicated as the import source may be "crippled" like most phones. For example phones limit the length of names to 16 or 22 characters, and limit what characters are allowed in phone numbers (eg no parentheses, dashes, spaces etc). So, just because an imported value is different than the existing value, doesn't necessarily mean it is an updated value - it could be a truncation or simplification of the existing value and the existing value should be preserved. You can see that I have already written the code to deal with merging of phone numbers. Note how it reduces the imported and existing number to digits only before comparing, and figures out when to replace the existing value and when to add to the existing list. That sort of thing has to be done for all the different types of information and added to the loop in MergeEntries. You can work on one data type at a time in small discrete pieces so it doesn't interfere in your studies. It is also part art, part science and just good old fashioned heuristics. I would also welcome any test cases you write. I would expect there to be two csv files. The first one is imported overwriting everything, and then the second one has to be merged into the first. Roger |