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

Re: [coldsync-hackers] syncing newly created addres.pdb with addressbook



On Thu, Jun 28, 2001 at 12:28:37PM +0200, Ralf F . Salzgeber wrote:
> I create an addressbook from scratch with, say two new categories a and b
> with ID 1 and 2. Now I want to sync this myadr.pdb file with my existing
> AddressDB.pdb in a hotsync (coldsync, or pilot-link). So far I succeeded
> only in adding it into my existing other categories (I also tried
> 'copy-appinfo' conduit, which apparently does the same then on my desktop
> file...)

	Short answer: if you want to add a category, you'll need to do
it manually.

	Long answer:

	The categories are stored in a part of the database called the
AppInfo block. Because of the format of the database and the AppInfo
block, it is not possible to synchronize the AppInfo block the same
way as records.
	In addition, although there is a standard format for the part
of the AppInfo block that stores categories, the database does not
indicate whether the database uses standard categories or not.
	So because of this, ColdSync is incapable of doing the right
thing in every case, so it doesn't touch the AppInfo block at all when
syncing (of course, when you upload or download a database with "-mb"
or "-mr", everything gets copied, including the AppInfo block).

	This means that if you want to add a category to the Palm, you
need to do it yourself. You'll probably want to do this with a Sync
conduit.
	The category list in the AppInfo block looks more or less like
this:

	struct {
		char name[16];
		unsigned char id;
		bool renamed;
	} category_list[16];

Each record in the database has a 4-bit category identifier. This is
not the category ID, unfortunately: it is an index into category_list.
	So to add a new category, you need to download the AppInfo
block from the Palm, find an unused category (one where name == ""),
add your new category, and upload the modified AppInfo block.
	(Just in passing: by convention, categories created on the
Palm have IDs in the range 1-127; categories created on the desktop
have IDs in the range 128-255. 0 is reserved for the "Unfiled"
category.)
	Of course, if you have a database on the desktop that already
uses the new categories, but put them in category_list[1] and
category_list[2], but when you added the categories as described
above, you had to put them in category_list[7] and category_list[9],
you'll need to fix the database on the desktop so that the category
index for each record is correct.

	As you can see, categories are a mess (and I haven't even
talked about deleting or renaming categories). I don't see a good way
of dealing with them in the general case, but if you just want to add
one, the above should help you get started.

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com                      views of ooblick.com
      Attention: Baby seal clubbing at 8:00 P.M. on Holodeck 4!
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.