Le mercredi 18 février 2009 à 01:11 -0500, Chris Frey a écrit : > > Moreover, I have splitted the C functions connect, disconnect, > > get_changes... to get a source code cleaner. > > This appears at first glance to cause a lot of unneeded code duplication. > Some of these are small functions, such as sync_done(), which don't > benefit from the split, as far as I can tell. > > Did you have a runtime or debugging reason for this change? > > I understand using code duplication if we're in a hurry, but it is always > something that someone has to go back and fix later. I did it in the > record classes, and then went back to fix it. But here, we're going in > the opposite direction... adding more duplication when it should work > as-is, in theory.
For connect / disconnect, we can use only one function. For get_changes, sync_done, change, I have to split these functions. Except, if from the variables : (OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) I can know if we sync contact or event. > > I have moved the connect/disconnect (of device) in the function > > initialize / finalize functions to be able to make calendar and contact > > sync in the same session. > > I seem to recall that there was a reason I didn't put a device connect > in the initialize() function. > > If you just do a plugin list from the command line, without doing a sync, > does this now require that you have a device plugged in? If I sync both event and calendar, barry plugin tries to connect two times. So it's fail. But indeed, if you just a plugin list (by sample osynctool --discover), it now requires that you have a device plugged in ! osynctool --discover displays well the discover result ; but says also that the device has to be connected :( I think that I'm going to update my patch. I put connect device process in connect functions and add a test to check if the connect is already processed to be able to make 2 sync in the same session. For disconnect, I can keep the function in the function finalize > How about from a GUI like KitchenSync? I don't use this tool. Regards, Nicolas -- Nicolas VIVIEN ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Barry-devel mailing list Barry-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/barry-devel