std::string GetOptionalDecodedDatum(const TestData &data, const char *name) { std::string s; if (DataExists(data, name)) PutDecodedDatumInto(data, name, StringSink(s).Ref()); return s; }
TBool CIAUpdateSelfUpdaterCtrl::StartL( TInt aIndex, TInt aTotalCount, const RPointerArray< MIAUpdateNode >& aPendingNodes, TBool aSilent ) { IAUPDATE_TRACE("[IAUPDATE] CIAUpdateSelfUpdaterCtrl::StartL begin"); if ( !DataExists() ) { // Nothing to do. return EFalse; } // Set the information if the dialogs should be shown or // if the operation should be silent. Also,set the index // and total count info. // Rest has been set before. File().SetSilent( aSilent ); File().SetPckgStartIndex( aIndex ); File().SetTotalPckgCount( aTotalCount ); // Write data into the file for the self updater to use. IAUPDATE_TRACE("[IAUPDATE] CIAUpdateSelfUpdaterCtrl::StartL write file"); File().WriteDataL(); // Now, that the data is written, reset filelist IAUPDATE_TRACE("[IAUPDATE] CIAUpdateSelfUpdaterCtrl::StartL reset file"); File().Reset(); // Save the pending node infromation CIAUpdatePendingNodesFile* pendingNodesFile( CIAUpdatePendingNodesFile::NewLC() ); pendingNodesFile->SetIndex( aIndex ); for ( TInt i = 0; i < aPendingNodes.Count(); ++i ) { MIAUpdateNode* node( aPendingNodes[ i ] ); MIAUpdateBaseNode& baseNode( node->Base() ); CIAUpdaterIdentifier* identifier( CIAUpdaterIdentifier::NewLC() ); identifier->SetUid( baseNode.Uid() ); identifier->SetIdL( baseNode.MetaId() ); identifier->SetNamespaceL( baseNode.MetaNamespace() ); pendingNodesFile->PendingNodes().AppendL( identifier ); CleanupStack::Pop( identifier ); } IAUPDATE_TRACE("[IAUPDATE] CIAUpdateSelfUpdaterCtrl::StartL write pending nodes file"); pendingNodesFile->WriteDataL(); CleanupStack::PopAndDestroy( pendingNodesFile ); StartUpdaterProcessL(); IAUPDATE_TRACE("[IAUPDATE] CIAUpdateSelfUpdaterCtrl::StartL end"); return ETrue; }