ksync Library API Documentation

KSyncer Class Reference

This class provides syncing of sets of data entries. More...

#include <ksyncer.h>

List of all members.

Public Methods

 KSyncer (KSyncUi *ui=0)
virtual ~KSyncer ()
void addSyncee (KSyncee *)
void sync ()
void syncAllToTarget (KSyncee *target, bool writeback=false)
void syncToTarget (KSyncee *syncee, KSyncee *target, bool override=false)


Detailed Description

This class provides syncing of sets of data entries.

Author:
Cornelius Schumacher
See also:
KSyncEntry, KSyncee, KSyncUi
The KSyncer class provides the top level framework for syncing. It implements the actual syncing algorithm, which operates on data objects implementing the KSyncee and KSyncEntry interfaces. By this mechanism the syncing algorith is decoupled from the concrete type of data and has to be implemented only once.

To perform a syncing process you have to create objects of the concrete subclasses of KSyncee, representing the type of the data to be synced. They are added to KSyncer with the function addSyncee(). When all data sets to be synced are added, call the sync() functions to perform the actual syncing.

For conflict resolution, a user interface is needed. This has to be a subclass of KSyncUi and is provided, when constructing a Ksyncer instance.

Definition at line 231 of file ksyncer.h.


Constructor & Destructor Documentation

KSyncer::KSyncer KSyncUi   ui = 0
 

Create a KSyncer instance.

You have to provide an instance of a conflict resolution user interface, which is used to resolve conflicts in the synced data, which cannot be resolved automatically. The UI does not necessarily have to be interactive.

Definition at line 144 of file ksyncer.cpp.

References QPtrList< KSyncee >::setAutoDelete().


Member Function Documentation

void KSyncer::addSyncee KSyncee  
 

Add a data set, which is to be synced.

Definition at line 158 of file ksyncer.cpp.

References QPtrList< KSyncee >::append().

void KSyncer::sync  
 

Sync all data sets.

After execution of this functions all data sets, which have been added to KSyncer contain the same set of data.

This function might call conflict resolution functions of the KSyncUi object.

Definition at line 163 of file ksyncer.cpp.

References QPtrList< KSyncee >::first(), QPtrList< KSyncee >::last(), QPtrList< KSyncee >::next(), KSyncee::save(), and syncToTarget().

void KSyncer::syncAllToTarget KSyncee   target,
bool    writeback = false
 

Sync all data sets with a target data sets.

After execution of this function the target KSyncee data set contains a combination of all data sets added to KSyncer. The added data sets are not changed.

This function might call conflict resolution functions of the KSyncUi object.

Definition at line 180 of file ksyncer.cpp.

References QPtrList< KSyncee >::first(), QPtrList< KSyncee >::next(), syncToTarget(), and KSyncee::writeLog().

void KSyncer::syncToTarget KSyncee   syncee,
KSyncee   target,
bool    override = false
 

Sync one specific data set to a target data set.

After execution of this function the target contains the combination of the two data sets. Only the target is changed.

This function might call conflict resolution functions of the KSyncUi object.

Definition at line 197 of file ksyncer.cpp.

References KSyncee::addEntry(), KSyncUi::deconflict(), KSyncEntry::equals(), KSyncee::filename(), KSyncee::findEntry(), KSyncee::firstEntry(), KSyncee::hasChanged(), KSyncEntry::id(), KSyncee::nextEntry(), KSyncee::replaceEntry(), and KSyncee::writeLog().

Referenced by sync(), and syncAllToTarget().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for ksync Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:37 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003