コード例 #1
0
void OrganizerTodoTimeTransform::transformToDetailL(const CCalInstance& instance, QOrganizerItem *itemOccurrence)
{
    if (itemOccurrence->type() == QOrganizerItemType::TypeTodo
        || itemOccurrence->type() == QOrganizerItemType::TypeTodoOccurrence)
    {
        TCalTime startTime = instance.StartTimeL();
        TCalTime endTime = instance.EndTimeL();

        QOrganizerTodoTime range;
        if (startTime.TimeUtcL() != Time::NullTTime())
            range.setStartDateTime(toQDateTimeL(startTime));
        if (endTime.TimeUtcL() != Time::NullTTime())
            range.setDueDateTime(toQDateTimeL(endTime));
        
        if (!range.isEmpty())
            itemOccurrence->saveDetail(&range);
    }
}
コード例 #2
0
/** Checks the start, end and time of an instance
@param	aFetchInstanceArray Array of instances 
@param	aIndex Used to retrieve the correct instance from array
@test
*/
void CTestCalInterimApiTZChange::CheckInstancesTimesL(RPointerArray<CCalInstance>& aFetchInstanceArray, TInt aIndex)
	{
	TDateTime startTime;
	TDateTime endTime;
	CCalInstance* instance = NULL;
	
	GetInstanceDataFromIniFileL(aIndex);
	
	if (iIsFloating)
		{
		instance = aFetchInstanceArray[aIndex];
		startTime = instance->StartTimeL().TimeLocalL().DateTime();
		INFO_PRINTF7(_L("Instance Start Date Year: %d, Month: %d, Day: %d, Instance Start Time Hr: %d, Min: %d, Sec: %d "), startTime.Year(), startTime.Month(), startTime.Day(), startTime.Hour(), startTime.Minute(), startTime.Second());
		TESTL(instance->StartTimeL().TimeLocalL() == instance->Time().TimeLocalL());
		INFO_PRINTF1(_L("Start and Time of instance match"));
		TESTL(FormatDateTime(iPtrExpectedInstanceStart) == instance->StartTimeL().TimeLocalL());
		endTime = instance->EndTimeL().TimeLocalL().DateTime();
		INFO_PRINTF7(_L("Instance End Date Year: %d, Month: %d, Day: %d, Instance Start Time Hr: %d, Min: %d, Sec: %d "), endTime.Year(), endTime.Month(), endTime.Day(), endTime.Hour(), endTime.Minute(), endTime.Second());
		TESTL(FormatDateTime(iPtrExpectedInstanceEnd) == instance->EndTimeL().TimeLocalL());
		TESTL(instance->StartTimeL().TimeMode() == TCalTime::EFloating); // defect stored as fixedutc
		TESTL(instance->Time().TimeMode() == TCalTime::EFloating);
		TESTL(instance->EndTimeL().TimeMode() == TCalTime::EFloating);
		}
	else
		{
		instance = aFetchInstanceArray[aIndex];
		startTime = instance->StartTimeL().TimeUtcL().DateTime();
		INFO_PRINTF7(_L("Instance Start Date Year: %d, Month: %d, Day: %d, Instance Start Time Hr: %d, Min: %d, Sec: %d "), startTime.Year(), startTime.Month(), startTime.Day(), startTime.Hour(), startTime.Minute(), startTime.Second());
		TESTL(instance->StartTimeL().TimeUtcL() == instance->Time().TimeUtcL());
		INFO_PRINTF1(_L("Start and Time of instance match"));
		TESTL(FormatDateTime(iPtrExpectedInstanceStart) == instance->StartTimeL().TimeUtcL());
		endTime = instance->EndTimeL().TimeUtcL().DateTime();
		INFO_PRINTF7(_L("Instance End Date Year: %d, Month: %d, Day: %d, Instance Start Time Hr: %d, Min: %d, Sec: %d "), endTime.Year(), endTime.Month(), endTime.Day(), endTime.Hour(), endTime.Minute(), endTime.Second());
		TESTL(FormatDateTime(iPtrExpectedInstanceEnd) == instance->EndTimeL().TimeUtcL());
		TESTL(instance->StartTimeL().TimeMode() == TCalTime::EFixedUtc);
		TESTL(instance->Time().TimeMode() == TCalTime::EFixedUtc);
		TESTL(instance->EndTimeL().TimeMode() == TCalTime::EFixedUtc);
		}	
	}