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/src/syncprocess.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/src/syncprocess.cpp')
-rw-r--r-- | kitchensync/src/syncprocess.cpp | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/kitchensync/src/syncprocess.cpp b/kitchensync/src/syncprocess.cpp index 60310b803..2ff93bcd4 100644 --- a/kitchensync/src/syncprocess.cpp +++ b/kitchensync/src/syncprocess.cpp @@ -19,10 +19,12 @@ */ #include <libqopensync/engine.h> -#include <libqopensync/environment.h> +#include <libqopensync/member.h> +#include <libqopensync/result.h> #include <kdebug.h> #include <klocale.h> +#include <kmessagebox.h> #include "syncprocess.h" #include "syncprocessmanager.h" @@ -60,8 +62,8 @@ TQString SyncProcess::memberStatus( const QSync::Member& ) const QSync::Result SyncProcess::addMember( const QSync::Plugin &plugin ) { - QSync::Member member = mGroup.addMember(); - QSync::Result result = member.instance( plugin ); + QSync::Member member = mGroup.addMember( plugin ); + QSync::Result result = member.instance(); if ( !result.isError() ) mGroup.save(); @@ -69,40 +71,27 @@ QSync::Result SyncProcess::addMember( const QSync::Plugin &plugin ) return result; } +void SyncProcess::removeMember( const QSync::Member &member ) +{ + member.cleanup(); + mGroup.removeMember( member ); + mGroup.save(); +} + void SyncProcess::reinitEngine() { mEngine->finalize(); delete mEngine; mEngine = new QSync::Engine( mGroup ); Result result = mEngine->initialize(); - if ( result.isError() ) + if ( result.isError() ) { kdDebug() << "SyncProcess::reinitEngine: " << result.message() << endl; + KMessageBox::error( 0, i18n("Error initializing Synchronization Engine for group \"%1\":\n %2") + .arg( mGroup.name() ).arg( result.message() ) ); - applyObjectTypeFilter(); + } emit engineChanged( mEngine ); } -void SyncProcess::applyObjectTypeFilter() -{ - const QSync::Conversion conversion = SyncProcessManager::self()->environment()->conversion(); - const TQStringList objectTypes = conversion.objectTypes(); - const TQStringList activeObjectTypes = mGroup.config().activeObjectTypes(); - - for ( uint i = 0; i < objectTypes.count(); ++i ) { - if ( activeObjectTypes.contains( objectTypes[ i ] ) ) { - kdDebug() << "Enabled object type: " << objectTypes[ i ] << endl; - /* - * This is not required. Also this lead to filtering problems when sync with "file-sync". - * Uncomment this line again when OpenSync is fixed! - * - * mGroup.setObjectTypeEnabled( objectTypes[ i ], true ); - */ - } else { - kdDebug() << "Disabled object type: " << objectTypes[ i ] << endl; - mGroup.setObjectTypeEnabled( objectTypes[ i ], false ); - } - } -} - #include "syncprocess.moc" |