diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-08 01:37:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-08 01:37:34 +0000 |
commit | d4f48636cc2631625434326e146d04f503d0247a (patch) | |
tree | a371a2337bddce3de3fa3fcac52275a8204570d9 /kitchensync/src/syncprocess.cpp | |
parent | d8b40941f9d1a221add0b9094eb09405a91a8aab (diff) | |
download | tdepim-d4f48636cc2631625434326e146d04f503d0247a.tar.gz tdepim-d4f48636cc2631625434326e146d04f503d0247a.zip |
Reverse OpenSync patch as it causes a build failure on Debian
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1172771 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kitchensync/src/syncprocess.cpp')
-rw-r--r-- | kitchensync/src/syncprocess.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/kitchensync/src/syncprocess.cpp b/kitchensync/src/syncprocess.cpp index 2ff93bcd4..60310b803 100644 --- a/kitchensync/src/syncprocess.cpp +++ b/kitchensync/src/syncprocess.cpp @@ -19,12 +19,10 @@ */ #include <libqopensync/engine.h> -#include <libqopensync/member.h> -#include <libqopensync/result.h> +#include <libqopensync/environment.h> #include <kdebug.h> #include <klocale.h> -#include <kmessagebox.h> #include "syncprocess.h" #include "syncprocessmanager.h" @@ -62,8 +60,8 @@ TQString SyncProcess::memberStatus( const QSync::Member& ) const QSync::Result SyncProcess::addMember( const QSync::Plugin &plugin ) { - QSync::Member member = mGroup.addMember( plugin ); - QSync::Result result = member.instance(); + QSync::Member member = mGroup.addMember(); + QSync::Result result = member.instance( plugin ); if ( !result.isError() ) mGroup.save(); @@ -71,27 +69,40 @@ 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" |