From: <svn...@op...> - 2009-04-14 17:36:43
|
Author: cdfrey Date: Tue Apr 14 19:36:30 2009 New Revision: 5608 URL: http://www.opensync.org/changeset/5608 Log: Updated for anchor/state_db and anchor key/value API changes Modified: plugins/kdepim/src/datasource.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Tue Apr 14 19:35:43 2009 (r5607) +++ plugins/kdepim/src/datasource.cpp Tue Apr 14 19:36:30 2009 (r5608) @@ -88,8 +88,8 @@ osync_objtype_sink_set_userdata(sink, this); - // Request an anchor from the framework. - osync_objtype_sink_enable_anchor(sink, TRUE); + // Request a state_db from the framework. + osync_objtype_sink_enable_state_db(sink, TRUE); const char *configdir = osync_plugin_info_get_configdir(info); QString tablepath = QString("%1/hashtable.db").arg(configdir); @@ -132,12 +132,12 @@ // Detection mechanismn if this is the first sync OSyncError *error = NULL; - osync_bool anchormatch = FALSE; + osync_bool statematch = FALSE; OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); - if ( !osync_anchor_compare(anchor, "true", &anchormatch, &error) ) + if ( !osync_sink_state_equal(state_db, "done", "true", &statematch, &error) ) { osync_context_report_osyncerror(ctx, error); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); @@ -145,7 +145,7 @@ return; } - if ( !anchormatch ) + if ( !statematch ) { osync_trace(TRACE_INTERNAL, "Setting slow-sync for %s", objtype); osync_objtype_sink_set_slowsync(sink, TRUE); @@ -165,9 +165,9 @@ OSyncError *error = NULL; OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); - if ( !osync_anchor_update(anchor, "true", &error) ) + if ( !osync_sink_state_set(state_db, "done", "true", &error) ) { osync_context_report_osyncerror(ctx, error); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); |