From d8b40941f9d1a221add0b9094eb09405a91a8aab Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 7 Sep 2010 22:30:29 +0000 Subject: Part 2/2 of Chakra patch commit git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1172727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kitchensync/libqopensync/syncmapping.cpp | 43 +++++++++++++++++++------------- 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'kitchensync/libqopensync/syncmapping.cpp') diff --git a/kitchensync/libqopensync/syncmapping.cpp b/kitchensync/libqopensync/syncmapping.cpp index 95939ab85..d716af17a 100644 --- a/kitchensync/libqopensync/syncmapping.cpp +++ b/kitchensync/libqopensync/syncmapping.cpp @@ -20,19 +20,20 @@ */ #include -#include +#include +#include #include "syncmapping.h" using namespace QSync; SyncMapping::SyncMapping() - : mEngine( 0 ), mMapping( 0 ) + : mEngine( 0 ), mMappingEngine( 0 ) { } -SyncMapping::SyncMapping( OSyncMapping *mapping, OSyncEngine *engine ) - : mEngine( engine ), mMapping( mapping ) +SyncMapping::SyncMapping( OSyncMappingEngine *mapping, OSyncEngine *engine ) + : mEngine( engine ), mMappingEngine( mapping ) { } @@ -42,58 +43,64 @@ SyncMapping::~SyncMapping() bool SyncMapping::isValid() const { - return ( mEngine != 0 && mMapping != 0 ); + return ( mEngine != 0 && mMappingEngine != 0 ); } +/* long long SyncMapping::id() const { - Q_ASSERT( mMapping ); + Q_ASSERT( mMappingEngine ); - return osengine_mapping_get_id( mMapping ); + return osync_mapping_engine_get_id( mMappingEngine ); } +*/ void SyncMapping::duplicate() { Q_ASSERT( mEngine ); - Q_ASSERT( mMapping ); + Q_ASSERT( mMappingEngine ); + + OSyncError *error = 0; - osengine_mapping_duplicate( mEngine, mMapping ); + osync_mapping_engine_duplicate( mMappingEngine, &error ); } void SyncMapping::solve( const SyncChange &change ) { Q_ASSERT( mEngine ); - Q_ASSERT( mMapping ); + Q_ASSERT( mMappingEngine ); Q_ASSERT( change.isValid() ); - osengine_mapping_solve( mEngine, mMapping, change.mSyncChange ); + OSyncError *error = 0; + + osync_mapping_engine_solve( mMappingEngine, change.mSyncChange, &error ); } void SyncMapping::ignore() { Q_ASSERT( mEngine ); - Q_ASSERT( mMapping ); + Q_ASSERT( mMappingEngine ); //TODO: error should be returned as Result OSyncError *error = 0; - osengine_mapping_ignore_conflict( mEngine, mMapping, &error ); + osync_mapping_engine_ignore( mMappingEngine, &error ); } int SyncMapping::changesCount() const { - Q_ASSERT( mMapping ); + Q_ASSERT( mMappingEngine ); - return osengine_mapping_num_changes( mMapping ); + return osync_mapping_engine_num_changes( mMappingEngine ); } SyncChange SyncMapping::changeAt( int pos ) { - Q_ASSERT( mMapping ); + Q_ASSERT( mMappingEngine ); - if ( pos < 0 || pos >= osengine_mapping_num_changes( mMapping ) ) + if ( pos < 0 || pos >= osync_mapping_engine_num_changes( mMappingEngine ) ) return SyncChange(); - OSyncChange *ochange = osengine_mapping_nth_change( mMapping, pos ); + OSyncChange *ochange = osync_mapping_engine_nth_change( mMappingEngine, pos ); return SyncChange( ochange ); } -- cgit v1.2.1