Ejemplo n.º 1
0
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(&timestamp,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();
	}
Ejemplo n.º 2
0
// -----------------------------------------------------------------------------
// 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;
    };
Ejemplo n.º 3
0
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();
	}
Ejemplo n.º 4
0
// -----------------------------------------------------------------------------
// 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;
}