KDE PIM / Developers / API Docs / kpilot / lib

SyncAction::SyncMode Class Reference

This class encapsulates the different sync modes that can be used, and enforces a little discipline in changing the mode and messing around in general. More...

#include <syncAction.h>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions


Detailed Description

This class encapsulates the different sync modes that can be used, and enforces a little discipline in changing the mode and messing around in general.

It replaces a simple enum by not much more, but it makes things like local test backups less likely to happen.

Note that this could all be packed into a bitfield (5 bits needed) but that makes for messy code in the end.


Member Enumeration Documentation

enum SyncAction::SyncMode::Mode
 

Available modes for the sync.


Constructor & Destructor Documentation

SyncAction::SyncMode::SyncMode Mode  m,
bool  test = false,
bool  local = false
 

Create a mode with the given Mode.

Parameters:
m and the mix-ins
test and
local,which determine whether the sync should actually change anything at all (test mode) and whether the HH is to be simulated by local databases.

SyncAction::SyncMode::SyncMode const QStringList &  l  ) 
 

Create a mode by parsing the string list.

This is used mostly by the conduit proxies, which use a string list to pass aparameters to the shared library loader.


Member Function Documentation

Mode SyncAction::SyncMode::mode  )  const [inline]
 

Returns the kind of sync; this is just incomplete information, since a test hot sync is very different from a non-test one.

bool SyncAction::SyncMode::setMode int   ) 
 

Sets a mode from an integer.

Parameters:
mode,if possible. If the
mode is illegal, return false and set the mode to Fast Sync. As a side effect, options test and local are reset to false.

bool SyncAction::SyncMode::setMode Mode  m  ) 
 

Sets a mode from a.

Parameters:
mode,if possible. This leaves the options unchanged, so as to reward properly-typed programming.

bool SyncAction::SyncMode::setOptions bool  test,
bool  local
[inline]
 

Sets options.

Returns false if the combination of mode and the options is impossible.

bool SyncAction::SyncMode::operator== const Mode m  )  const [inline]
 

Shorthand to test for a specific mode enum.

This disregards the mixings local and test.

bool SyncAction::SyncMode::isTest  )  const [inline]
 

Accessor for the test part of the mode.

Test syncs should never actually modify data anywhere.

bool SyncAction::SyncMode::isLocal  )  const [inline]
 

Accessor for the local part of the mode.

Local syncs use a local database instead of one on the device link.

bool SyncAction::SyncMode::isSync  )  const [inline]
 

Classify every mode as either a sync (two-way) or copy (one-way) mode.

bool SyncAction::SyncMode::isCopy  )  const [inline]
 

Classify every mode as either a sync (two-way) or copy (one-way) mode.

QString SyncAction::SyncMode::name Mode   )  [static]
 

Returns a standard name for each of the sync modes.

QString SyncAction::SyncMode::name  )  const
 

Returns a (human readable) name for this particular mode, including extra information about test and local mode.

QStringList SyncAction::SyncMode::list  )  const
 

Returns a QStringList that, when passed to the constructor of SyncMode, will re-create it.

Used to pass modes into shared library factories.


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