On Wed, Feb 06, 2008 at 03:48:29PM -0500, Frank S. Bernhardt wrote:
> Finally, success.

Excellent. :-)


> I can now backup my BB using barrybackup (using su -c barrybackup)! Only 
>  thing is, where is the backup file and what is it's name? I searched 
> the source (I didn't install from source but from rpm's but have it 
> anyway) but couldn't see what name it uses. I did see a reference to a 
> variable 'filename' but it almost looks like it gets that via user 
> input. I'm not a cc programmer and can barely understand c so I'm lost 
> on this one.

The backup files are stored in the user's home directory under:
/home/<user>/.barry/backup/<BBpin>/

Each backup is a dated tar file containing the raw database records
retrieved from the device.

When you hit the Restore button, barrybackup opens a file browser dialog
in this directory.

If you run as root, these files may exist in root's home directory.
You'll probably want to change that, by updating your udev rules, or
installing the barry-util package.


> A compiled the addcontact example program and when I ran it the contact 
> showed up in my BB address book! I guess I shouldn't be surprised. I 
> looked at the code and at the barry source to see what other options 
> there are other than add a new record cause it would be nice to come up 
> with some kind of sync feature but this cc stuff is just plain weird.
> 
> So, I guess I'll have to be satisfied to doing address book csv exports 
> and then writing a perl sync csv program and then importing it all back 
> in my BB.

It gets a little complex sometimes.  Here's the high level logic of
a sync (off the top of my head).  If you're looking at writing sync
code, look at the opensync module source, especially barry_sync.cc.

        Connect to the device (Probe and Controller classes)

        Open the Desktop (in the new API, the Mode::Desktop class)

        Retrieve the list of databases in the device (the Desktop::GetDBDB()
                function, which returns the DatabaseDatabase class)

        For each database you're interested in:

                Get a list of records, and determine which is has been
                recently updated on the device. (Desktop::GetRecordStateTable()
                function, which fills in a RecordStateTable class,
                and that class contains a list of records, their record ID's,
                and their dirty flags.)

                If you're syncing to something else, you'll want to find out
                what has changed on that side too.

                For each dirty BB record, get the new data (the
                Desktop::GetRecord() function, which uses a Parser class
                to fill in a Record class... this part of the API could
                likely be improved... basically the idea is to fill,
                for example, a Contact class with a record from the
                "Address Book" database.)

                For each new record from the other source, add it to the BB.
                (use Desktop::AddRecord() or Desktop::AddRecordByType()
                for a simpler way... this requires that you generate a
                new Record ID for this record, which means you need to
                call the MakeNewRecordId() function from the RecordStateTable
                class you got previously)

                For each record that needs to be deleted, call
                Desktop::DeleteRecord().

This may still be too complicated, but I figured it's useful to have
an overview documented somewhere, so thanks for asking. :-)

- Chris


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Barry-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to