diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-07 22:30:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-07 22:30:29 +0000 |
commit | d8b40941f9d1a221add0b9094eb09405a91a8aab (patch) | |
tree | 0b8e9b6347f6e75925bb3c386a47c5300b1a4775 /kitchensync/libqopensync/engine.cpp | |
parent | 009631d0fc83f471d6c515e2a5001337a5a2ea21 (diff) | |
download | tdepim-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/engine.cpp')
-rw-r--r-- | kitchensync/libqopensync/engine.cpp | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/kitchensync/libqopensync/engine.cpp b/kitchensync/libqopensync/engine.cpp index 6d48c72ff..64a11f0ed 100644 --- a/kitchensync/libqopensync/engine.cpp +++ b/kitchensync/libqopensync/engine.cpp @@ -20,7 +20,11 @@ */ #include <opensync/opensync.h> -#include <osengine/engine.h> +#include <opensync/opensync-engine.h> + +#include "group.h" +#include "member.h" +#include "result.h" #include "engine.h" @@ -29,19 +33,21 @@ using namespace QSync; Engine::Engine( const Group &group ) { OSyncError *error = 0; - mEngine = osengine_new( group.mGroup, &error ); + mEngine = osync_engine_new( group.mGroup, &error ); } Engine::~Engine() { - osengine_free( mEngine ); + osync_engine_unref( mEngine ); mEngine = 0; } Result Engine::initialize() { + Q_ASSERT( mEngine ); + OSyncError *error = 0; - if ( !osengine_init( mEngine, &error ) ) + if ( !osync_engine_initialize ( mEngine, &error ) ) return Result( &error ); else return Result(); @@ -49,13 +55,29 @@ Result Engine::initialize() void Engine::finalize() { - osengine_finalize( mEngine ); + Q_ASSERT( mEngine ); + + OSyncError *error = 0; + osync_engine_finalize( mEngine , &error ); } Result Engine::synchronize() { + Q_ASSERT( mEngine ); + OSyncError *error = 0; - if ( !osengine_synchronize( mEngine, &error ) ) + if ( !osync_engine_synchronize( mEngine, &error ) ) + return Result( &error ); + else + return Result(); +} + +Result Engine::discover( const Member &member ) +{ + Q_ASSERT( mEngine ); + + OSyncError *error = 0; + if ( !osync_engine_discover_and_block( mEngine, member.mMember, &error ) ) return Result( &error ); else return Result(); @@ -63,5 +85,9 @@ Result Engine::synchronize() void Engine::abort() { - osengine_abort( mEngine ); + Q_ASSERT( mEngine ); + +// TODO +// osync_engine_abort( mEngine ); } + |