summaryrefslogtreecommitdiffstats
path: root/kitchensync/libqopensync/syncmapping.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-07 22:30:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-07 22:30:29 +0000
commitd8b40941f9d1a221add0b9094eb09405a91a8aab (patch)
tree0b8e9b6347f6e75925bb3c386a47c5300b1a4775 /kitchensync/libqopensync/syncmapping.cpp
parent009631d0fc83f471d6c515e2a5001337a5a2ea21 (diff)
downloadtdepim-d8b40941f9d1a221add0b9094eb09405a91a8aab.tar.gz
tdepim-d8b40941f9d1a221add0b9094eb09405a91a8aab.zip
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
Diffstat (limited to 'kitchensync/libqopensync/syncmapping.cpp')
-rw-r--r--kitchensync/libqopensync/syncmapping.cpp43
1 files changed, 25 insertions, 18 deletions
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 <tqstring.h>
-#include <osengine/engine.h>
+#include <opensync/opensync.h>
+#include <opensync/opensync-engine.h>
#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 );
}