Esempio n. 1
0
void NotifyProvider::ValueChanged(TUid uid, TUint32 key, TInt aValue, TInt aErr)
{
    qDebug()<<"NotifyProvider::ValueChanged"<<aValue<<aErr;
    if (uid==KSMSNotifUid)
    {
        //new sms
        // prepare here and send signal from iNotifiers if current count is bigger than old
        iSMSCount=aValue;
        emit updateSMSCount(aValue);
        if (aValue==0)
        {
            clearNotifiers(ESMS);
        }
        qDebug()<<"sms count changed:"<<aValue;
    }
    if (uid==KCallsNotifUid)
    {
        //new call
        iCallsCount=aValue;
        emit updateCallCount(aValue);
        if (aValue==0)
        {
            clearNotifiers(EMissedCall);
        }
        qDebug()<<"calls count changed:"<<aValue;
    }
}
Esempio n. 2
0
static void UnregisterBlock(MEMINFO *block)
{
	if (!MonitoringEnabled)
		return;

	EnterCriticalSection(&CS);

	if (block->prev)
		block->prev->next = block->next;
	if (block->next)
		block->next->prev = block->prev;
	if(block == LastMemBlock)
		LastMemBlock = LastMemBlock->prev;

	CheckChain();

	updateCallCount(block->AllocationType, false);
	--AllocatedMemoryBlocks;
	AllocatedMemorySize-=block->Size;

	LeaveCriticalSection(&CS);

	if (!AllocatedMemoryBlocks)
		DeleteCriticalSection(&CS);
}
Esempio n. 3
0
static void RegisterBlock(MEMINFO *block)
{
	if (!MonitoringEnabled)
		return;

	if (!AllocatedMemoryBlocks)
		InitializeCriticalSection(&CS);
	EnterCriticalSection(&CS);

	block->prev = LastMemBlock;
	block->next = nullptr;

	LastMemBlock->next = block;
	LastMemBlock = block;

	CheckChain();

	updateCallCount(block->AllocationType, true);
	++AllocatedMemoryBlocks;
	++TotalAllocationCalls;
	AllocatedMemorySize+=block->Size;

	LeaveCriticalSection(&CS);
}