Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
ActionList Class Reference
Collaboration diagram for ActionList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ActionList ()
 ~ActionList ()
void Append (Action *action)
int Prepare ()
int Execute ()
void Finish (int status)

Private Attributes

ActionmFirst
ActionmLast
int mCount

Detailed Description

Definition at line 1203 of file updater.cpp.


Constructor & Destructor Documentation

ActionList::ActionList ( ) [inline]

Definition at line 1206 of file updater.cpp.

: mFirst(NULL), mLast(NULL), mCount(0) { }

Definition at line 1220 of file updater.cpp.

{
  Action* a = mFirst;
  while (a) {
    Action *b = a;
    a = a->mNext;
    delete b;
  }
}

Member Function Documentation

Definition at line 1231 of file updater.cpp.

{
  if (mLast)
    mLast->mNext = action;
  else
    mFirst = action;

  mLast = action;
  mCount++;
}

Here is the caller graph for this function:

Definition at line 1268 of file updater.cpp.

{
  int i = 0;
  float divisor = mCount / 98.0f;

  Action *a = mFirst;
  while (a) {
    UpdateProgressUI(1.0f + float(i++) / divisor);

    int rv = a->Execute();
    if (rv)
    {
      LOG(("### execution failed\n"));
      return rv;
    }

    a = a->mNext;
  }

  return OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1291 of file updater.cpp.

{
  Action *a = mFirst;
  while (a) {
    a->Finish(status);
    a = a->mNext;
  }

#ifdef XP_WIN
  if (status == OK)
    gSucceeded = TRUE;
#endif

  UpdateProgressUI(100.0f);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1243 of file updater.cpp.

{
  // If the action list is empty then we should fail in order to signal that
  // something has gone wrong. Otherwise we report success when nothing is
  // actually done. See bug 327140.
  if (mCount == 0) {
    LOG(("empty action list\n"));
    return UNEXPECTED_ERROR;
  }

  Action *a = mFirst;
  while (a) {
    int rv = a->Prepare();
    if (rv)
      return rv;

    a = a->mNext;
  }

  UpdateProgressUI(1.0f);

  return OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1217 of file updater.cpp.

Definition at line 1215 of file updater.cpp.

Definition at line 1216 of file updater.cpp.


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