void CFavoriteSyncHandler::UpdateToServerL() { RArray<TWFFavSyncListIndex>& indexList = iSyncManager->GetUpdateList(); for (TInt i = 0; i < indexList.Count(); ++i) { TWFFavSyncListIndex listEntry = indexList[i]; if (listEntry.type == EWFServerList) { Favorite* fav = iFavoriteList->at(listEntry.index); fav->setSynced(EFalse); class isab::ChangeFavoriteMess cfm(fav); // Send a message with this as receiver to end up in // GuiProtReceiveMessage function below. Also add the message id // to our array to make sure that we can control that all messages // have returned to us. iServerMessageQueue.InsertInOrder(iSender.SendMessage(cfm, this)); } } iState |= EWFUpdateToServerDone; iState |= EWFWaitingForServerFavReplies; if ((iState & EWFAddToServerDone) && (iState & EWFDeleteFromServerDone) && (iState & EWFUpdateToServerDone) && (iServerMessageQueue.Count() == 0)) { iState &= ~EWFWaitingForServerFavReplies; iState |= EWFServerQueueDone; } ProcessNextState(); }