kpilot

ActionQueue Class Reference

The ActionQueue is a meta-action, which handles running a bunch of SyncActions in sequence. More...

#include <actionQueue.h>

Inheritance diagram for ActionQueue:

List of all members.


Public Member Functions

 ActionQueue (KPilotLink *device)
void addAction (SyncAction *a)
bool isEmpty () const
void queueCleanup ()
void queueConduits (const QStringList &conduits, const SyncAction::SyncMode &mode)
void queueInit ()
virtual ~ActionQueue ()

Protected Slots

void actionCompleted (SyncAction *)

Protected Member Functions

void clear ()
virtual bool exec ()
SyncActionnextAction ()

Detailed Description

The ActionQueue is a meta-action, which handles running a bunch of SyncActions in sequence.

It is a SyncAction itself, so it can even be queued on another ActionQueue.

An ActionQueue is constructed with a device. As usual, you should connect the device's deviceReady() signal with the exec() slot -- or something to that effect. The ActionQueue will then run all the actions in the queue in sequence.

Definition at line 57 of file actionQueue.h.


Constructor & Destructor Documentation

ActionQueue::ActionQueue ( KPilotLink device  ) 

Constructor.

Pass in a KPilot device link for it to act on. It is legal to pass in 0 (NULL) as a device. Ownership of the device is unchanged.

Definition at line 42 of file actionQueue.cc.

ActionQueue::~ActionQueue (  )  [virtual]

Destructor.

Definition at line 49 of file actionQueue.cc.


Member Function Documentation

void ActionQueue::actionCompleted ( SyncAction b  )  [protected, slot]

When one action finishes, start the next one.

Definition at line 114 of file actionQueue.cc.

void ActionQueue::addAction ( SyncAction a  )  [inline]

You can push your own action a onto the queue.

Ownership of the action is given to the ActionQueue object.

Definition at line 81 of file actionQueue.h.

void ActionQueue::clear (  )  [protected]

Remove all the actions from the queue and delete them (the queue owns the actions, after all).

Definition at line 55 of file actionQueue.cc.

bool ActionQueue::exec (  )  [protected, virtual]

Reimplemented from SyncAction.

Implements SyncAction.

Definition at line 108 of file actionQueue.cc.

bool ActionQueue::isEmpty (  )  const [inline]

Is the queue empty? Returns true if it is.

Definition at line 72 of file actionQueue.h.

SyncAction* ActionQueue::nextAction (  )  [inline, protected]

Dequeue the next action in the queue, ready for processing.

This takes the action off the queue, so remember to delete it eventually.

Definition at line 142 of file actionQueue.h.

void ActionQueue::queueCleanup (  ) 

Convenience function for adding a cleanup action (see CleanupAction in actions.h) to the queue.

Should be the last action added to the queue because a HotSync can only have one cleanup.

Definition at line 103 of file actionQueue.cc.

void ActionQueue::queueConduits ( const QStringList conduits,
const SyncAction::SyncMode mode 
)

Queue a (series) of conduits conduits with a given sync mode mode.

Each of the conduits named is called through a ConduitProxy object which handles loading the conduit's shared library and creating the actual SyncAction for that conduit. Actions named "internal_*" are silently ignored since those names are used by KPilot internally for administrative purposes.

Definition at line 73 of file actionQueue.cc.

void ActionQueue::queueInit (  ) 

Initialize the queue.

This empties it out and adds a welcome action (see WelcomeAction in actions.h) so that the user knows what is happening when the ActionQueue begins to execute. Equivalent to

Definition at line 66 of file actionQueue.cc.


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