Buteo Synchronization Framework: Buteo::SyncResults Class Reference

Buteo Synchronization Framework

Public Types | Public Member Functions | Properties | List of all members
Buteo::SyncResults Class Reference

Contains information about a completed synchronization session. More...

`#include <SyncResults.h>`

## Public Types
enum | MajorCode { SYNC_RESULT_INVALID = -1 , SYNC_RESULT_SUCCESS = 0 , SYNC_RESULT_FAILED , SYNC_RESULT_CANCELLED }
| enum value More...
enum | MinorCode { NO_ERROR = 0 , ITEM_FAILURES = 301 , INTERNAL_ERROR = 401 , AUTHENTICATION_FAILURE , DATABASE_FAILURE , PLUGIN_ERROR , PLUGIN_TIMEOUT , ABORTED = 501 , CONNECTION_ERROR , UNSUPPORTED_SYNC_TYPE , UNSUPPORTED_STORAGE_TYPE , LOW_BATTERY_POWER = 601 , POWER_SAVING_MODE , OFFLINE_MODE , BACKUP_IN_PROGRESS , LOW_MEMORY }
| enum value More...

## Public Member Functions
| SyncResults ()
| Constructs an empty sync results object. More...
| SyncResults (const SyncResults &aSource)
| Copy constructor. More...
| SyncResults (QDateTime aTime, MajorCode aMajorCode, MinorCode aMinorCode)
| Constructs sync results, sets sync time and result code. More...
| SyncResults (const QDomElement &aRoot)
| Constructs sync results from XML. More...
| ~SyncResults ()
| Destructor.
SyncResults & | operator= (const SyncResults &aRhs)
| Assignment operator. More...
QDomElement | toXml (QDomDocument &aDoc) const
| Exports the sync results to XML. More...
QString | toString () const
| Exports the sync results to QString. More...
QList< TargetResults > | targetResults () const
| Gets the results of all targets. More...
void | addTargetResults (const TargetResults &aResults)
| Adds target results to this object. More...
QDateTime | syncTime () const
| Gets the sync time. More...
MajorCode | majorCode () const
| Gets the result code. More...
void | setMajorCode (MajorCode aMajorCode)
| Sets the result code. More...
MinorCode | minorCode () const
| Gets the failed reason. More...
void | setMinorCode (MinorCode aMinorCode)
| Sets the failed Reason. More...
void | setTargetId (const QString &aTargetId)
| Sets the remote target Id. More...
QString | getTargetId () const
| Gets the remote target Id.
bool | operator< (const SyncResults &aOther) const
| Compares two results objects by sync time. More...
void | setScheduled (bool aScheduled)
| Sets if the results are from a scheduled sync. More...
bool | isScheduled () const
| Checks if the results are from a scheduled sync. More...

## Properties
Q_GADGETQDateTime | syncTime
MajorCode | majorCode
MinorCode | minorCode
bool | scheduled
QString | targetId
QVariantList | results

## Detailed Description

Contains information about a completed synchronization session.

SyncResults consists of the sync time/date, result code and one TargetResults object for each sync target/storage (calendar, bookmarks etc.).

## Member Enumeration Documentation

## ◆ MajorCode

enum Buteo::SyncResults::MajorCode

enum value

Used to set the major code in *.log.xml file for profile

## ◆ MinorCode

enum Buteo::SyncResults::MinorCode

enum value

Used to set the minor code in *.log.xml file for profile

## Constructor & Destructor Documentation

## ◆ SyncResults() [1/4]

SyncResults::SyncResults | ( |  | ) |

Constructs an empty sync results object.

Sync time is set to current time, result code should be set later by calling setMajorCode , setMinorCode.

## ◆ SyncResults() [2/4]

SyncResults::SyncResults | ( | const SyncResults & | aSource | ) |

Copy constructor.

Parameters

  aSource | Copy source.

## ◆ SyncResults() [3/4]

SyncResults::SyncResults | ( | QDateTime | aTime,
|  | SyncResults::MajorCode | aMajorCode,
|  | SyncResults::MinorCode | aMinorCode
| ) |  |

Constructs sync results, sets sync time and result code.

Parameters

  aTime | Sync time for the results.
  aMajorCode | Sync result code.
  aMinorCode | Sync Failed Reason.

## ◆ SyncResults() [4/4]

SyncResults::SyncResults | ( | const QDomElement & | aRoot | ) |
| explicit

Constructs sync results from XML.

Parameters

  aRoot | Root element of the XML representation.

## Member Function Documentation

## ◆ addTargetResults()

void SyncResults::addTargetResults | ( | const TargetResults & | aResults | ) |

Adds target results to this object.

Parameters

  aResults | The target results to add.

## ◆ isScheduled()

bool SyncResults::isScheduled | ( |  | ) | const

Checks if the results are from a scheduled sync.

Returns
  True if scheduled.

## ◆ majorCode()

SyncResults::MajorCode SyncResults::majorCode | ( |  | ) | const

Gets the result code.

Returns
  major code.

## ◆ minorCode()

SyncResults::MinorCode SyncResults::minorCode | ( |  | ) | const

Gets the failed reason.

Returns
  failed Reason.

## ◆ operator<()

bool SyncResults::operator< | ( | const SyncResults & | aOther | ) | const

Compares two results objects by sync time.

The object with earlier sync time is smaller.

Parameters

  aOther | Point of comparison.

## ◆ operator=()

SyncResults & SyncResults::operator= | ( | const SyncResults & | aRhs | ) |

Assignment operator.

Parameters

  aRhs | Source.

## ◆ setMajorCode()

void SyncResults::setMajorCode | ( | SyncResults::MajorCode | aMajorCode | ) |

Sets the result code.

Parameters

  aMajorCode | The result code.

## ◆ setMinorCode()

void SyncResults::setMinorCode | ( | SyncResults::MinorCode | aMinorCode | ) |

Sets the failed Reason.

Parameters

  aMinorCode | - minor code or the reason

## ◆ setScheduled()

void SyncResults::setScheduled | ( | bool | aScheduled | ) |

Sets if the results are from a scheduled sync.

Parameters

  aScheduled | True if this is a scheduled sync.

## ◆ setTargetId()

void SyncResults::setTargetId | ( | const QString & | aTargetId | ) |

Sets the remote target Id.

Parameters

  aTargetId | The remote device Id.

## ◆ syncTime()

QDateTime SyncResults::syncTime | ( |  | ) | const

Gets the sync time.

Returns
  Sync time.

## ◆ targetResults()

QList< TargetResults > SyncResults::targetResults | ( |  | ) | const

Gets the results of all targets.

Returns
  List of target results.

## ◆ toString()

QString SyncResults::toString | ( |  | ) | const

Exports the sync results to QString.

Returns
  return the Results as xml formatted string

## ◆ toXml()

QDomElement SyncResults::toXml | ( | QDomDocument & | aDoc | ) | const

Exports the sync results to XML.

Parameters

  aDoc | Parent document for the created XML elements. The created elements are not inserted to the document by this function, but the document is still required for creating the elements.

Returns
  Root element of the created XML.

The documentation for this class was generated from the following files:

- SyncResults.h
- SyncResults.cpp