kitchensync
syncentry.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "syncentry.h"
00024
00025 #include "merger.h"
00026 #include "syncee.h"
00027
00028 #include <kdebug.h>
00029
00030
00031 using namespace KSync;
00032
00033 SyncEntry::SyncEntry( Syncee *sync )
00034 : mSyncee( sync ), mDontSync( false )
00035 {
00036 mState = Undefined;
00037 }
00038
00039 SyncEntry::SyncEntry( const SyncEntry &ent )
00040 {
00041 mState = ent.mState;
00042 mSyncee = ent.mSyncee;
00043 mDontSync = ent.mDontSync;
00044 mType = ent.mType;
00045 }
00046
00047 SyncEntry::~SyncEntry()
00048 {
00049 }
00050
00051 void SyncEntry::setSyncee( Syncee *syncee )
00052 {
00053 mSyncee = syncee;
00054 }
00055
00056 int SyncEntry::match( SyncEntry* )
00057 {
00058 return -2;
00059 }
00060
00061 int SyncEntry::compareTo(SyncEntry* )
00062 {
00063 return -2;
00064 }
00065
00066 int SyncEntry::state() const
00067 {
00068 return mState;
00069 }
00070
00071 bool SyncEntry::wasAdded() const
00072 {
00073 return ( mState == Added );
00074 }
00075
00076 bool SyncEntry::wasModified() const
00077 {
00078 return ( mState == Modified );
00079 }
00080
00081 bool SyncEntry::wasRemoved() const
00082 {
00083 return ( mState == Removed );
00084 }
00085
00086 void SyncEntry::setState( int state )
00087 {
00088 mState = state;
00089 }
00090
00091 void SyncEntry::setSyncState( int state )
00092 {
00093 mSyncState = state;
00094 }
00095
00096 int SyncEntry::syncState() const
00097 {
00098 return mSyncState;
00099 }
00100
00101 Syncee *SyncEntry::syncee()const
00102 {
00103 return mSyncee;
00104 }
00105
00106 void SyncEntry::setDontSync( bool dontSync )
00107 {
00108 mDontSync = dontSync;
00109 }
00110
00111 bool SyncEntry::dontSync() const
00112 {
00113 return mDontSync;
00114 }
00115
00116 KSync::Merger* SyncEntry::merger()const {
00117 if ( !syncee() )
00118 return 0l;
00119
00120 return syncee()->merger();
00121 }
00122
00123 bool SyncEntry::mergeWith( SyncEntry* other ) {
00124 if ( !merger() && !other->merger() )
00125 return false;
00126
00127
00128 Merger *mer = merger() ? merger() : other->merger();
00129
00130 return mer ->merge( this, other );
00131 }
00132
00133 KPIM::DiffAlgo* SyncEntry::diffAlgo( SyncEntry*, SyncEntry* )
00134 {
00135 return 0;
00136 }
00137
00138
00139 void SyncEntry::setId( const QString& )
00140 {
00141 }
00142
00143 QString SyncEntry::type()const
00144 {
00145 return mType;
00146 }
00147
00148 void SyncEntry::setType( const QString& str )
00149 {
00150 mType = str;
00151 }
|