OpenSync  0.22
Functions
OpenSync Mapping

The commands to manipulate mappings. More...

Functions

void osengine_mapping_duplicate (OSyncEngine *engine, OSyncMapping *dupe_mapping)
 Solves the conflict by duplicating the conflicting entries. More...
 
void osengine_mapping_solve (OSyncEngine *engine, OSyncMapping *mapping, OSyncChange *change)
 Solves the mapping by choosing a winner. More...
 
osync_bool osengine_mapping_ignore_conflict (OSyncEngine *engine, OSyncMapping *mapping, OSyncError **error)
 Ignores a conflict. More...
 
osync_bool osengine_mapping_ignore_supported (OSyncEngine *engine, OSyncMapping *mapping)
 Checks if a conflict can be ignore. More...
 
osync_bool osengine_mapping_solve_latest (OSyncEngine *engine, OSyncMapping *mapping, OSyncError **error)
 Solves a mapping by choosing the entry that was last modified. More...
 
osync_bool osengine_mapping_check_timestamps (OSyncEngine *engine, OSyncMapping *mapping, OSyncError **error)
 Checks if the mapping could be solved with solve_latest. More...
 
void osengine_mapping_solve_updated (OSyncEngine *engine, OSyncMapping *mapping, OSyncChange *change)
 Solves a mapping by setting an updated change. More...
 

Detailed Description

The commands to manipulate mappings.

Function Documentation

void osengine_mapping_duplicate ( OSyncEngine *  engine,
OSyncMapping *  dupe_mapping 
)

Solves the conflict by duplicating the conflicting entries.

Parameters
engineThe engine
dupe_mappingThe conflicting mapping to duplicate

Definition at line 296 of file osengine_mapcmds.c.

void osengine_mapping_solve ( OSyncEngine *  engine,
OSyncMapping *  mapping,
OSyncChange change 
)

Solves the mapping by choosing a winner.

The winner will overwrite all other entries of this mapping

Parameters
engineThe engine
mappingThe conflicting mapping
changeThe winning change

Definition at line 401 of file osengine_mapcmds.c.

osync_bool osengine_mapping_ignore_conflict ( OSyncEngine *  engine,
OSyncMapping *  mapping,
OSyncError **  error 
)

Ignores a conflict.

This ignores the conflict until the next sync. When the group is synchronized again the conflict is brought up again (unless the user solved it already outside of the engine)

Parameters
engineThe engine
mappingThe mapping to ignore

Definition at line 420 of file osengine_mapcmds.c.

osync_bool osengine_mapping_ignore_supported ( OSyncEngine *  engine,
OSyncMapping *  mapping 
)

Checks if a conflict can be ignore.

To be able to ignore a conflict, you opensync must be able to read the changes of the conflict again during the next synchronization. This must be done even if they are not reported by the plugin. Therefore, all plugins should provide a "read" method. If there is a member in the engine's group that does not have this method (either since it is not possible to implement one or since it has not been done yet), this function will return FALSE.

Parameters
engineThe engine
mappingThe mapping to check
Returns
TRUE if conflicts can be ignored, FALSE otherwise

Definition at line 461 of file osengine_mapcmds.c.

Referenced by osengine_mapping_ignore_conflict().

osync_bool osengine_mapping_solve_latest ( OSyncEngine *  engine,
OSyncMapping *  mapping,
OSyncError **  error 
)

Solves a mapping by choosing the entry that was last modified.

Solves the mapping by choosing the last modified entry. Note that this can fail if one of the entries does not have a timestamp set or of the 2 latest timestamps were exactly equal. If it could not be solved you have to solve it with another function!

Parameters
engineThe engine
mappingThe conflicting mapping
errorA pointer to an error
Returns
TRUE if the mapping was solved, FALSE otherwise

Definition at line 499 of file osengine_mapcmds.c.

osync_bool osengine_mapping_check_timestamps ( OSyncEngine *  engine,
OSyncMapping *  mapping,
OSyncError **  error 
)

Checks if the mapping could be solved with solve_latest.

This functions checks all changes to see if they contain valid timestamp information and if they could be used to solve but does not actually solve the mapping

Parameters
engineThe engine
mappingThe conflicting mapping
errorA pointer to an error
Returns
TRUE if the mapping could be solved, FALSE otherwise

Definition at line 554 of file osengine_mapcmds.c.

void osengine_mapping_solve_updated ( OSyncEngine *  engine,
OSyncMapping *  mapping,
OSyncChange change 
)

Solves a mapping by setting an updated change.

Solves the mapping by setting an updated change. The change should have been edited by the user. This change will then be declared winner.

Parameters
engineThe engine
mappingThe conflicting mapping
changeThe updated change

Definition at line 601 of file osengine_mapcmds.c.