diff -r 139d4b7b2938 -r 99bcbff212ad emailuis/nmailuiengine/src/nmoperation.cpp --- a/emailuis/nmailuiengine/src/nmoperation.cpp Mon May 24 21:02:02 2010 +0300 +++ b/emailuis/nmailuiengine/src/nmoperation.cpp Fri May 28 13:56:43 2010 +0300 @@ -25,6 +25,8 @@ : mProgress(0), mIsRunning(true) { + NM_FUNCTION; + QMetaObject::invokeMethod(this, "runAsyncOperation", Qt::QueuedConnection); } @@ -33,6 +35,8 @@ */ NmOperation::~NmOperation() { + NM_FUNCTION; + while (!mPreliminaryOperations.isEmpty()) { QPointer operation = mPreliminaryOperations.takeLast(); if (operation && operation->isRunning()) { @@ -46,6 +50,8 @@ */ bool NmOperation::isRunning() const { + NM_FUNCTION; + return mIsRunning; } @@ -54,6 +60,8 @@ */ void NmOperation::addPreliminaryOperation(NmOperation *operation) { + NM_FUNCTION; + // if the preliminary operation is already completed // the input parameter can be null if (operation && operation->isRunning()) { @@ -75,6 +83,8 @@ */ void NmOperation::completeOperation(int result) { + NM_FUNCTION; + mIsRunning = false; // Operation is completed, emit the signal doCompleteOperation(); @@ -89,6 +99,8 @@ */ void NmOperation::cancelOperation() { + NM_FUNCTION; + mIsRunning = false; // Operation is canceled, emit the signal this->doCancelOperation(); @@ -102,6 +114,8 @@ */ void NmOperation::updateOperationProgress(int progress) { + NM_FUNCTION; + mProgress = progress; this->doUpdateOperationProgress(); emit this->operationProgressChanged(mProgress); @@ -115,6 +129,8 @@ */ void NmOperation::runAsyncOperation() { + NM_FUNCTION; + int count = mPreliminaryOperations.count(); int ready = 0; // go through preliminary operations @@ -137,6 +153,8 @@ */ void NmOperation::handlePreliminaryOperationFinished() { + NM_FUNCTION; + QMetaObject::invokeMethod(this, "runAsyncOperation", Qt::QueuedConnection); } @@ -148,7 +166,7 @@ */ void NmOperation::doCompleteOperation() { - + NM_FUNCTION; } /*! @@ -159,6 +177,7 @@ */ void NmOperation::doCancelOperation() { + NM_FUNCTION; } /*! @@ -169,6 +188,7 @@ */ void NmOperation::doUpdateOperationProgress() { + NM_FUNCTION; } /*! @@ -178,6 +198,8 @@ */ void NmOperation::deleteOperation() { + NM_FUNCTION; + this->deleteLater(); }