void CAgentAddressbook::StartAgentCmdL() { __FLOG(_L("StartAgentCmdL()")); CreateLogL(LOGTYPE_ADDRESSBOOK); iStopLongTask = EFalse; delete iContDb; iContDb = NULL; iContDb = CContactDatabase::OpenL(); // set the notifier: on contact events, HandleDatabaseEventL() is called delete iDbNotifier; iDbNotifier = NULL; iDbNotifier = CContactChangeNotifier::NewL(*iContDb, this); // if markup exists, set iTimestamp to that value // otherwise initialize iTimestamp to an initial value if(iMarkupFile->ExistsMarkupL(Type())){ // retrieve iTimestamp RBuf8 timeBuffer(iMarkupFile->ReadMarkupL(Type())); timeBuffer.CleanupClosePushL(); TInt64 timestamp; Mem::Copy(×tamp,timeBuffer.Ptr(),sizeof(timestamp)); CleanupStack::PopAndDestroy(&timeBuffer); iTimestamp = timestamp; // we add just a microsecond to the timestamp so that we are sure not to take // the contact of the timestamp saved into markup TTimeIntervalMicroSeconds oneMicroSecond = 1; iTimestamp += oneMicroSecond; } else { _LIT(KInitTime,"16010000:000000"); iTimestamp.Set(KInitTime); } delete iFilter; iFilter = NULL; iFilter = CCntFilter::NewL(); // Control the time range to filter on iFilter->SetFilterDateTime(iTimestamp); // Specify the type of contact item to include iFilter->SetContactFilterTypeALL(EFalse); iFilter->SetContactFilterTypeCard(ETrue); iFilter->SetContactFilterTypeGroup(EFalse); iFilter->SetContactFilterTypeOwnCard(EFalse); iFilter->SetContactFilterTypeTemplate(EFalse); // Remark!: modified contacts include new contacts.... iFilter->SetIncludeModifiedContacts(ETrue); iContDb->FilterDatabaseL(*iFilter); delete iContacts; iContacts = NULL; iContacts = CContactIdArray::NewL(iFilter->iIds); iContactIndex = 0; iLongTask->NextRound(); }
// ----------------------------------------------------------------------------- // CDRMHelperServer::NewLC // Two-phased constructor. // ----------------------------------------------------------------------------- // CDRMHelperServer* CDRMHelperServer::NewLC() { #ifdef _DRM_TESTING CreateLogL(); TRAPD( err , WriteL(_L8("NewLC")) ); #endif CDRMHelperServer* self = new(ELeave) CDRMHelperServer; CleanupStack::PushL( self ); self->ConstructL(); return self; };
void CAgentDevice::StartAgentCmdL() { __FLOG(_L("StartAgentCmdL()")); CreateLogL(LOGTYPE_DEVICE); RBuf8 buf(GetInfoBufferL()); buf.CleanupClosePushL(); if (buf.Length() > 0) { // dump the buffer to the file log. AppendLogL(buf); } CleanupStack::PopAndDestroy(&buf); CloseLogL(); }
// ----------------------------------------------------------------------------- // CDcfRepSrv::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CDcfRepSrv::ConstructL() { #ifdef _DRM_TESTING CreateLogL(); WriteL(_L8("ConstructL")); #endif StartL(KDcfRepSrvName); User::LeaveIfError(iFs.Connect()); iScan = CFileScan::NewL(iFs); OpenDatabaseL(); User::RenameThread(KDcfRepSrvName); iProcWatcher = CProcWatcher::NewL( *this, _L( "*RightsServer*" ), _L( "RightsServer" ) ); iProcWatcher->StartWatching(); iArmed = ETrue; }