00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#include <kdebug.h>
00023
#include <kgenericfactory.h>
00024
#include <kconfig.h>
00025
#include <kapabilities.h>
00026
#include <konnectorinfo.h>
00027
00028
#include "clientmanager.h"
00029
00030
#include "threadedkonnector.h"
00031
#include "konnectorconfig.h"
00032
00033
using namespace KSync;
00034
using namespace Threaded;
00035
00036
extern "C"
00037 {
00038
void *init_libthreadedkonnector()
00039 {
00040
return new KRES::PluginFactory<ThreadedPlugin,ThreadedKonnectorConfig>();
00041 }
00042 }
00043
00044 ThreadedPlugin::ThreadedPlugin(
const KConfig *config )
00045 :
Konnector( config ) {
00046 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00047
00048
00049
00050 connect( &mClientManager, SIGNAL(signalProgress(
const KSync::Progress&)),
00051 SLOT(slotProgress(
const KSync::Progress&)) );
00052 connect( &mClientManager, SIGNAL(signalError(
const KSync::Error&)),
00053 SLOT(slotError(
const KSync::Error&)) );
00054 connect( &mClientManager, SIGNAL(signalFinished()),
00055 SLOT(slotFinished()) );
00056 }
00057
00058 SynceeList ThreadedPlugin::syncees()
00059 {
00060
00061
return SynceeList;
00062 }
00063
00064 ThreadedPlugin::~ThreadedPlugin() {
00065 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00066 mClientManager.terminate();
00067 mClientManager.wait();
00068 }
00069
00070 Kapabilities
ThreadedPlugin::capabilities() {
00071 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00072
return Kapabilities();
00073 }
00074
00075 void ThreadedPlugin::setCapabilities(
const KSync::Kapabilities& ) {
00076 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00077 }
00078
00079 bool ThreadedPlugin::readSyncees() {
00080 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00081
return mClientManager.
readSyncees();
00082 }
00083
00084 bool ThreadedPlugin::writeSyncees() {
00085 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00086
return mClientManager.
writeSyncees();
00087 }
00088
00089 bool ThreadedPlugin::connectDevice() {
00090 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00091
return mClientManager.
connectDevice();
00092 }
00093
00094 bool ThreadedPlugin::disconnectDevice() {
00095 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00096
return mClientManager.
disconnectDevice();
00097 }
00098
00099 KSync::KonnectorInfo ThreadedPlugin::info()
const {
00100 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00101
return KSync::KonnectorInfo();
00102 }
00103
00104 void ThreadedPlugin::download(
const QString& ) {
00105 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00106 }
00107
00108
void ThreadedPlugin::slotFinished() {
00109 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00110 progress( KSync::StdProgress::done() );
00111 }
00112
00113
void ThreadedPlugin::slotError(
const KSync::Error& e ) {
00114 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00115 error( e );
00116 }
00117
00118
void ThreadedPlugin::slotProgress(
const KSync::Progress& p ) {
00119 kdDebug() << __PRETTY_FUNCTION__ <<
" this = " <<
this << endl;
00120 progress( p );
00121 }
00122
00123
#include "threadedkonnector.moc"