|
From: Quentin D. <que...@gm...> - 2010-08-19 21:42:33
|
Hi folks, I looked at the libqopensync code that is used by kitchensync to translate the library into Qt. It's a very basic and simple translation from C to Qt, but changes in the API broke this libqopensync. I am trying to fix the lines but since I have absolutely no idea of the API I would like to get my changes revised and to understand the implications and consequences of those changes (see below). These are only broken parts that are about 2 years old, what about new functions that I am not aware of and that I should integrate in kitchensync? Fixing and eliminating broken functions may make kitchensync compile but what if it lacks the new features of 0.4? Enlighten me, please! I think it would be better to maintain that library in opensync's svn and not outside at KDE's. Would you clone this repo (or give me the rights to commit to svn and do these changes by myself): http://websvn.kde.org/trunk/playground/pim/kitchensync/libqopensync/ The following files do not compile properly: (notice: I created a symlink from opensync/ to libopensync1/opensync/ to workaround the path change in the includes) callbackhandler.cpp: does not compile (invalid conversion and itializing argument error around the lines 136-139) pluginenv.cpp: osync_plugin_env_free( mPluginEnv ); osync_plugin_env_num_plugins( mPluginEnv ); -> what now? filter.cpp: I could make it compile by including <opensync/opensync_filter_internals.h> but I think it is not part of 0.4. What does it lead to? What are the consequences? group.cpp: osync_group_set_last_synchronization( mGroup, dateTime.toTime_t() ); -> completely removed? No alternative? It is used by kitchensync at the following place: case QSync::SyncEngineUpdate::Successful: mStatus->setText( i18n( "Successfully synchronized" ) ); mSyncProcess->group().setLastSynchronization( QDateTime::currentDateTime() ); mSyncProcess->group().save(); osync_group_num_members( mGroup ); osync_group_nth_member( mGroup, pos ); osync_group_num_filters( mGroup ); osync_group_nth_filter( mGroup, pos ); -> are they replaced by OSyncList *osync_group_get_members(OSyncGroup *group); ? So I now try to catch the nth OSyncList item, right? Quite an evidence, but it's just to make sure! ;) syncmapping.cpp osync_mapping_engine_nth_change, _num_, etc -> same logic as above I guess syncchange.cpp: opensync/file.h does not exist anymore and makes OSyncFileFormat undefined syncupdates.cpp: all the events (ex: OSYNC_MAPPING_EVENT_SOLVED) are broken, what have they been replaced by? So far so good! Thanks for your help! -Quentin |
|
From: Chris F. <cd...@fo...> - 2010-08-20 21:26:22
|
On Thu, Aug 19, 2010 at 11:29:18PM +0200, Quentin Denis wrote: > These are only broken parts that are about 2 years old, what about new > functions that I am not aware of and that I should integrate in kitchensync? > Fixing and eliminating broken functions may make kitchensync compile but what > if it lacks the new features of 0.4? Enlighten me, please! The main extra step in 0.4x is discovery. It must be done before the sync itself. You can find the code to do that in osynctool. > callbackhandler.cpp: does not compile (invalid conversion and itializing > argument error around the lines 136-139) > > pluginenv.cpp: > osync_plugin_env_free( mPluginEnv ); > osync_plugin_env_num_plugins( mPluginEnv ); > -> what now? "free" style calls are now "unref" calls, so osync_plugin_env_free() becomes osync_plugin_env_unref(), to emphasize that these are shared pointers. > filter.cpp: > I could make it compile by including > <opensync/opensync_filter_internals.h> but I think it is not part of 0.4. What > does it lead to? What are the consequences? The headers called "internal" or "private" will not be found in the library itself. It may get past the compile stage, but you'll have trouble during linking. > group.cpp: > osync_group_set_last_synchronization( mGroup, dateTime.toTime_t() ); > -> completely removed? No alternative? It is used by kitchensync at the > following place: > case QSync::SyncEngineUpdate::Successful: > mStatus->setText( i18n( "Successfully synchronized" ) ); > mSyncProcess->group().setLastSynchronization( > QDateTime::currentDateTime() ); > mSyncProcess->group().save(); > > osync_group_num_members( mGroup ); osync_group_nth_member( mGroup, pos ); > osync_group_num_filters( mGroup ); osync_group_nth_filter( mGroup, pos ); > -> are they replaced by OSyncList *osync_group_get_members(OSyncGroup *group); > ? So I now try to catch the nth OSyncList item, right? Quite an evidence, but > it's just to make sure! ;) You don't have to set the last sync time anymore. Opensync records the timestamp automatically when you do sync, and you can grab it with osync_group_get_last_synchronization(group); > syncmapping.cpp > osync_mapping_engine_nth_change, _num_, etc > -> same logic as above I guess I believe most of the "nth" style functions have been removed in favour of giving you an OSyncList and letting you find it yourself in the form of a for loop. :-) See the plugin porting email I sent earlier. > syncchange.cpp: > opensync/file.h does not exist anymore and makes OSyncFileFormat > undefined Not sure about this. > syncupdates.cpp: > all the events (ex: OSYNC_MAPPING_EVENT_SOLVED) are broken, what have > they been replaced by? They have been renamed and possibly recategorized. See the osynctool source code and search for "EVENT_SOLVED". You'll see callback functions listed there with switch statements with the new names. - Chris |