void AppendTimeDifference(TDes8& aInto, TTime from, TTime now) { CALLSTACKITEM_N(_CL("CLocaLogicImpl"), _CL("~CLocaLogicImpl")); if (from > now) { TTime s=from; from=now; now=s; } for(;;) { TTimeIntervalMinutes mins; if (now.MinutesFrom(from, mins)!=KErrNone) { mins=61; } TTimeIntervalHours hours; if (now.HoursFrom(from, hours)!=KErrNone) { hours=25; } TTimeIntervalDays days; days=now.DaysFrom(from); if (mins < TTimeIntervalMinutes(60)) { aInto.AppendNum(mins.Int()); aInto.Append(_L8(" minutes ")); break; } else if ( hours < TTimeIntervalDays(24)) { aInto.AppendNum(hours.Int()); aInto.Append(_L8(" hours ")); from+=TTimeIntervalHours(hours); } else { aInto.AppendNum(days.Int()); aInto.Append(_L8(" days ")); from+=TTimeIntervalDays(days); } } }
void FillAndPostL( CBBFeedItem* aItem ) { CALLSTACKITEM_N(_CL("CPosterImpl"), _CL("FillAndPostL")); TGlobalId guid; iUuidGenerator->MakeUuidL( guid ); aItem->iUuid.iValue = guid; aItem->iAuthorNick = iUserNick; TTime now = GetTime(); aItem->iCreated = now; // Put comment to local database iStorage.AddLocalL( aItem ); // Put comment to blackboard TTime expires = now; expires+=TTimeIntervalDays(7); BBSession()->PutRequestL( KOutgoingFeedItem, KNullDesC, aItem, expires, KOutgoingTuples ); }
// ----------------------------------------------------------------------------- // CTestSDKQueries::TestQVDASetArrayL // ----------------------------------------------------------------------------- // TInt CTestSDKQueries::TestQVDASetArrayL( CStifItemParser& /*aItem*/ ) { CAknQueryValueDateArray* dateArray = CAknQueryValueDateArray::NewL( R_TESTQUERY_DATE_FORMAT ); CleanupStack::PushL( dateArray ); CArrayFix<TTime>* timeArray = new( ELeave ) CArrayFixFlat<TTime>( 4 ); CleanupStack::PushL( timeArray ); TTime time1; time1.HomeTime(); TTime time2; time2 = time1 + TTimeIntervalDays( 3 ); timeArray->AppendL( time1 ); timeArray->AppendL( time2 ); dateArray->SetArray( *timeArray ); CleanupStack::Pop( timeArray ); CleanupStack::PopAndDestroy( dateArray ); return KErrNone; }
void CLocaLogicImpl::Failed(const TBBBtDeviceInfo& aDevice, TInt aMessageCode, const TTime& aAtTime, TSendFailure aErrorCode, TBool aLocal) { CALLSTACKITEM_N(_CL("CLocaLogicImpl"), _CL("Failed")); TMessageStats s; iMessageStats->GetStatsL(aDevice, s); s.iFailureCount++; if (aLocal) { s.iPreviousLocalFailure=aAtTime; s.iLocalFailureCount++;; } else { s.iPreviousRemoteFailure=aAtTime; } iMessageStats->SetStatsL(aDevice, s); if (aLocal) { #ifdef __WINS__ msg=_L("localogic: failed to send message "); msg.AppendNum(aErrorCode); Reporting().DebugLog(msg); #endif iMsgStatus.iMessageId()=aMessageCode; iMsgStatus.iRecipientAddress()=aDevice.iMAC(); iMsgStatus.iSucceeded()=EFalse; iMsgStatus.iAtTime()=aAtTime; iEvent.iStamp()=aAtTime; TTime expires=GetTime(); expires+=TTimeIntervalDays(5); iBBSubSession->PutRequestL(KLocaMessageStatusTuple, KNullDesC, &iEvent, expires, KNoComponent); } }
static void as_ttime (const struct tm& p, TTime& res, TBool normalise=EFalse) { TDateTime dt; TInt err = dt.Set(p.tm_year+1900, (enum TMonth)p.tm_mon, p.tm_mday-1, p.tm_hour, p.tm_min, p.tm_sec, 0); if (err == KErrNone) { res = dt; return; } if (!normalise) { res = TInt64(-1); return; } // Try to normalise things (for mktime) dt.Set(p.tm_year+1900, EJanuary, 0, 0, 0, 0, 0); res = dt; res += TTimeIntervalMonths (p.tm_mon); res += TTimeIntervalDays (p.tm_mday-1); res += TTimeIntervalHours (p.tm_hour); res += TTimeIntervalMinutes(p.tm_min); res += TTimeIntervalSeconds(p.tm_sec); }
void CBadRRule::CreateToDoEntryL() { RPointerArray<CCalEntry> entryarr ; CleanupResetAndDestroyPushL(entryarr); TInt num ; HBufC8* guid = KGUID1().AllocLC(); // ownership of guid gets transferred CCalEntry *entry = CCalEntry::NewL(CCalEntry::ETodo, guid, CCalEntry::EMethodNone, 0) ; CleanupStack::Pop(guid); CleanupStack::PushL(entry) ; TCalTime startTime ; TCalTime endTime ; startTime.SetTimeUtcL(TTime(TDateTime(2006, EJanuary, 8, 10, 30, 0, 0))) ; endTime.SetTimeUtcL(startTime.TimeUtcL() + TTimeIntervalDays(1)) ; entry->SetStartAndEndTimeL(startTime, endTime) ; TCalTime endTime1 ; endTime1.SetTimeUtcL(TTime(TDateTime(2006, EJanuary, 23, 10, 5, 0, 0))) ; TCalRRule rrule(TCalRRule::EWeekly) ; rrule.SetDtStart(startTime); rrule.SetUntil(endTime1); rrule.SetInterval(1); RArray<TDay> days; CleanupClosePushL(days); days.AppendL(ETuesday); rrule.SetByDay(days); CleanupStack::PopAndDestroy(&days); entry->SetRRuleL(rrule) ; // both entry and rrule start time should be aligned to the first instance TCalRRule setRRule ; entry->GetRRuleL(setRRule) ; test(setRRule.DtStart().TimeUtcL() == rrule.DtStart().TimeUtcL()) ; entryarr.AppendL(entry) ; CleanupStack::Pop(entry); iCalEntryView->StoreL(entryarr, num) ; entryarr.ResetAndDestroy(); TCalTime recId; recId.SetTimeUtcL(TTime(TDateTime(2006, EJanuary, 9, 10, 30, 0, 0))); // creating recurrence id guid = KGUID1().AllocLC(); // ownership of guid gets transferred entry = CCalEntry::NewL(CCalEntry::ETodo, guid, CCalEntry::EMethodNone, 0, recId, CalCommon::EThisOnly); CleanupStack::Pop(guid); CleanupStack::PushL(entry) ; TCalTime startTime3 ; TCalTime endTime3 ; startTime3.SetTimeUtcL(TTime(TDateTime(2006, EJanuary, 7, 10, 2, 0, 0))) ; endTime3.SetTimeUtcL(startTime3.TimeUtcL() + TTimeIntervalHours(1)) ; entry->SetStartAndEndTimeL(startTime3, endTime3) ; entryarr.AppendL(entry) ; CleanupStack::Pop(entry) ; iCalEntryView->StoreL(entryarr, num) ; CleanupStack::PopAndDestroy(&entryarr); RArray<TTime> insTimes ; insTimes.Append(TTime(TDateTime(2006, EJanuary, 7, 11, 2, 0, 0))) ; insTimes.Append(TTime(TDateTime(2006, EJanuary, 16, 10, 30, 0, 0))) ; CleanupClosePushL(insTimes) ; CheckInstancesL(insTimes) ; CleanupStack::PopAndDestroy(&insTimes) ; // time portion of repeat's end eliminates the third instance }
void CDummyCalendarApp::AddEntryL(TInt aNumToAdd, TBool isParent, TBool isRepeat) { test.Next(_L("Adding entries")); TBuf<50> summary; TBuf<50> location; TBuf<50> description; iEntries.ResetAndDestroy(); for (TInt index=0; index<aNumToAdd; index++) { TBuf8<255> buf; buf.Append(_L("GuidId")); buf.AppendNum(index); HBufC8* guid = buf.AllocLC(); // need to be pushed to ... CCalEntry::TType entryType=(index%2==0)?CCalEntry::ETodo:CCalEntry::EAppt; CCalEntry* entry = NULL; if(isParent) { entry = CreateCalEntryL(entryType, guid); } else { TTime localTime(KRecurrIdLocalTime); TCalTime recurrenceId; recurrenceId.SetTimeLocalL(localTime); entry = CCalEntry::NewL(entryType, guid, CCalEntry::EMethodAdd, 1, recurrenceId, CalCommon::EThisAndFuture); } CleanupStack::Pop(guid); iEntries.AppendL(entry); TInt year = -1; TInt month = -1; TInt day = -1; if (isParent) { year = index % 5 + 2001; // Any year in the range: 2001 - 2005 month = index % 12; day = index % 28; } else { // if this is a child entry, use the recurrence local time as the entry start time // so it won't be out of range TCalTime recurrId = entry->RecurrenceIdL(); TDateTime localTime = recurrId.TimeLocalL().DateTime(); year = localTime.Year(); month = localTime.Month(); day = localTime.Day(); } TTime start(TDateTime(year, (TMonth)month, day, 0, 0, 0, 0)); TTime end(TDateTime(year, (TMonth)month, day, 0, 0, 0, 0)); end += TTimeIntervalDays(1); SetEntryStartAndEndTimeL(entry,start,end); RandomText(summary); entry->SetSummaryL(summary); RandomText(location); entry->SetLocationL(location); RandomText(description); entry->SetDescriptionL(description); if(isRepeat) { //create a daily repeat rule and make sure its repeat start\end date is within the deleting time range TCalRRule rpt(TCalRRule::EDaily); rpt.SetInterval(1); TCalTime repeatStart; TCalTime repeatend; if(isParent) { //make sure the repeat time is within the delete time range repeatStart.SetTimeLocalL(TDateTime(2000, EJune, 0, 0, 0, 0, 0)); repeatend.SetTimeLocalL(TDateTime(2006, EJune, 0, 0, 0, 0, 0)); } else if (index<aNumToAdd/2) { // if this is a child entry, use the entry's recurrance time as repeating rule // start time TCalTime recurrId = entry->RecurrenceIdL(); // make sure the repeat time is within the delete time range for the first half entries repeatStart.SetTimeLocalL(recurrId.TimeLocalL()); // June 1, 2003 00:00:00 repeatend.SetTimeLocalL(recurrId.TimeLocalL() + TTimeIntervalMonths(1)); // July 1, 2003 00:00:00 } else { //make sure the repeat time is out of the delete time range for the second half entries repeatStart.SetTimeLocalL(TDateTime(2003, EJune, 0, 0, 0, 0, 0)); repeatend.SetTimeLocalL(TDateTime(2007, EJune, 0, 0, 0, 0, 0)); } rpt.SetDtStart(repeatStart); rpt.SetUntil(repeatend); entry->SetRRuleL(rpt); } } TInt entriesStored(0); iLocalEntryView->StoreL(iEntries, entriesStored); //temp test(entriesStored == iEntries.Count()); }
/** @SYMTestCaseID SYSLIB-LOGENG-CT-0881 @SYMTestCaseDesc Tests for purge @SYMTestPriority High @SYMTestActions Get the event type data @SYMTestExpectedResults Test must not fail @SYMREQ REQ0000 */ LOCAL_C void TestNoPurgeWithGetL(CLogClient& aClient) { TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0881 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); TLogConfig config; // Get log configuration active->StartL(); aClient.GetConfig(config, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Set the maximum log age TInt oldAge = config.iMaxEventAge; config.iMaxEventAge = 24 * 60 * 60; // Change the log engine config active->StartL(); aClient.ChangeConfig(config, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Check that the event can be retrieved active->StartL(); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Wait for 15 seconds (just to be safe) User::After(15000000); // Check that the event can still be retrieved active->StartL(); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Perform a dummy change event->SetTime(event->Time() - TTimeIntervalDays(2)); active->StartL(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Check the event has been removed active->StartL(); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNotFound);; // Reset the config config.iMaxEventAge = oldAge; // Change the log engine config active->StartL(); aClient.ChangeConfig(config, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); CleanupStack::PopAndDestroy(2); // active, event }
/** @SYMTestCaseID SYSLIB-LOGENG-CT-0877 @SYMTestCaseDesc Tests for maximum time for which events can be retained in the log @SYMTestPriority High @SYMTestActions Get the event type configuration data.Set maximum log age. Change the log engine configuration data with the new one.Add events to the log Set the date and time of events clear the log and check for errors @SYMTestExpectedResults Test must not fail @SYMREQ REQ0000 */ LOCAL_C void TestMaxLogAgeL(CLogClient& aClient, TLogAge aMaxLogAge) { TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0877 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); CLogViewEvent* view = CLogViewEvent::NewL(aClient); CleanupStack::PushL(view); CLogFilter* filter = CLogFilter::NewL(); CleanupStack::PushL(filter); TLogConfig config; // Get log configuration active->StartL(); aClient.GetConfig(config, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Set the maximum log age config.iMaxLogSize = KTestEventAge * 2; config.iMaxEventAge = aMaxLogAge; // Change the log engine config active->StartL(); aClient.ChangeConfig(config, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Initialise the view - There should be no events TEST(!view->SetFilterL(*filter, active->iStatus)); TTime date; date.UniversalTime(); // Wait a second User::After(0x1000000); // Add events TInt count; for(count = 0; count < KTestEventAge * 2; count++) { active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Set the time and date of the event event->SetTime(date); date -= TTimeIntervalDays(1); active->StartL(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); User::After(1000000); TEST(view->SetFilterL(*filter, active->iStatus)); active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // Check the old events have been removed if ((count < KTestEventAge) || !aMaxLogAge) TEST(view->CountL() == count + 1); else TEST(view->CountL() == KTestEventAge); } User::After(0x1000000); date.UniversalTime(); date+=(TTimeIntervalYears )1; // Clear all the events active->StartL(); aClient.ClearLog(date, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); TEST(!view->SetFilterL(*filter, active->iStatus)); TEST(view->CountL() == 0); CleanupStack::PopAndDestroy(4); // filter, view, active, event }
void CCalAlarmAttachTest::TestDeleteAlarmL() { CCalEntryView &view = iTestLib->SynCGetEntryViewL() ; CCalEntryView *calentryview = &view ; TInt num ; ClearAllAlarmsL() ; test.Printf(_L("Going to check deletion of non-snoozed alarms\n")) ; /* create repeating parent entry */ HBufC8* guid = KGUID3().AllocLC(); // ownership of guid gets transferred CCalEntry *entry = CCalEntry::NewL(CCalEntry::ETodo, guid, CCalEntry::EMethodNone, 0) ; CleanupStack::Pop(guid); CleanupStack::PushL(entry) ; TTime now1; now1.UniversalTime(); now1 += TTimeIntervalSeconds(30); TCalTime startTime ; TCalTime endTime ; startTime.SetTimeUtcL(now1) ; endTime.SetTimeUtcL(now1 + TTimeIntervalSeconds(30)) ; entry->SetStartAndEndTimeL(startTime, endTime) ; TCalRRule rrule(TCalRRule::EDaily) ; rrule.SetDtStart(startTime); TCalTime endRTime ; endRTime.SetTimeUtcL(now1 + TTimeIntervalDays(7)) ; rrule.SetUntil(endRTime); rrule.SetInterval(1); entry->SetRRuleL(rrule) ; CCalAlarm *alarm = CCalAlarm::NewL() ; CleanupStack::PushL(alarm) ; alarm->SetTimeOffset(TTimeIntervalMinutes(0)) ; entry->SetAlarmL(alarm) ; //ownership does not get transferred RPointerArray<CCalEntry> entryarr ; entryarr.AppendL(entry) ; //ownership does not got transferred calentryview->StoreL(entryarr, num) ; entryarr.Close() ; CleanupStack::PopAndDestroy(alarm) ; CleanupStack::PopAndDestroy(entry) ; /* Now let the alarm go off */ RArray< TAlarmId > alarmIdArr ; iAlarmServer.GetAlarmIdListL(alarmIdArr) ; TInt cnt = alarmIdArr.Count() ; test(cnt > 0) ; TRequestStatus status = 0; TAlarmId alarmId = alarmIdArr[0]; alarmIdArr.Close() ; test.Printf(_L("Waiting one minute for the alarm to go off...\n")) ; for(;;) { iAlarmServer.NotifyChange(status, alarmId); User::WaitForRequest(status); PrintEventDetails(status.Int()); if (status.Int() == EAlarmChangeEventTimerExpired) { break; // alarm expired } } /* delete this entry - without snoozing */ RPointerArray< CCalEntry > calEntryArray ; calentryview->FetchL(KGUID3(), calEntryArray) ; test(calEntryArray.Count() == 1) ; CCalEntry *entry1 = calEntryArray[0] ; entry1->SetCompletedL(ETrue, startTime) ; calentryview->StoreL(calEntryArray, num) ; delete entry1 ; calEntryArray.Close() ; /* now check if the alarm still exists or not */ RArray< TAlarmId > alarmIdArr1 ; iAlarmServer.GetAlarmIdListL(alarmIdArr1) ; TInt cnt1 = alarmIdArr1.Count() ; test(cnt1 < cnt) ; if (cnt1 > 0) { TAlarmId alarmId1 = alarmIdArr1[0]; test(alarmId != alarmId1) ; } alarmIdArr1.Close() ; ClearAllAlarmsL() ; test.Printf(_L("Checking of non snoozed alarms successful\n")) ; }
TBool CTrialHandler::IsNowOkL(TBool& aFirstTime,TInt& aDaysLeft) { TBool ret(EFalse); aFirstTime = EFalse; RFs fsSession; User::LeaveIfError(fsSession.Connect()); TFindFile AufFolder2(fsSession); if(KErrNone == AufFolder2.FindByDir(KtxTrialHandFileFileName, KNullDesC)){ TFindFile AufFolder3(fsSession); if(KErrNone == AufFolder3.FindByDir(KtxTrialHandFileFileName2, KNullDesC)) { BaflUtils::DeleteFile(fsSession,AufFolder3.File()); } }else{ TFindFile AufFolder4(fsSession); if(KErrNone == AufFolder4.FindByDir(KtxTrialHandFileFileName2, KNullDesC)) { aFirstTime = ETrue; TParsePtrC parsse(AufFolder4.File()); TFileName hjelpper; hjelpper.Copy(parsse.Drive()); hjelpper.Append(KtxTrialHandFileFileName); BaflUtils::RenameFile(fsSession,AufFolder4.File(),hjelpper); } } TFindFile AufFolder5(fsSession); if(KErrNone == AufFolder5.FindByDir(KtxTrialHandFileFileName, KNullDesC)){ TTime homme; homme.HomeTime(); CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(fsSession,AufFolder5.File(), TUid::Uid(0x102013AD)); TInt sYear(-1),sMonth(-1),sDay(-1),sHour(-1),sMinute(-1); TInt mYear(-1),mMonth(-1),mDay(-1),mHour(-1),mMinute(-1); TInt eYear(-1),eMonth(-1),eDay(-1),eHour(-1),eMinute(-1); TUid FileUid = {0x8867675}; if(MyDStore->IsPresentL(FileUid)) { FileUid.iUid = 0x1299; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); sYear = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x1669; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); sMonth = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x4469; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); sDay = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x4421; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); sHour = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x4422; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); sMinute = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x9999; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); mYear = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x1688; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); mMonth = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x4889; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); mDay = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x4821; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); mHour = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x4822; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); mMinute = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x6789; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); eYear = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x1111; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); eMonth = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x9786; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); eDay = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x9721; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); eHour = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } FileUid.iUid = 0x9722; if(MyDStore->IsPresentL(FileUid)) { RDictionaryReadStream in; in.OpenLC(*MyDStore,FileUid); eMinute = in.ReadInt32L(); CleanupStack::PopAndDestroy(1);// in } if(sYear == -1 && sMonth == -1 && sDay == -1 && mYear == -1 && mMonth == -1 && mDay == -1 && eYear == -1 && eMonth == -1 && eDay == -1){ FileUid.iUid = 0x1299; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out1; out1.AssignLC(*MyDStore,FileUid); out1.WriteInt32L(homme.DateTime().Year()); out1.CommitL(); CleanupStack::PopAndDestroy(1);// out1 FileUid.iUid = 0x1669; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out2; out2.AssignLC(*MyDStore,FileUid); out2.WriteInt32L((TInt)homme.DateTime().Month()); out2.CommitL(); CleanupStack::PopAndDestroy(1);// out2 FileUid.iUid = 0x4469; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out3; out3.AssignLC(*MyDStore,FileUid); out3.WriteInt32L(homme.DateTime().Day()); out3.CommitL(); CleanupStack::PopAndDestroy(1);// out3 FileUid.iUid = 0x4421; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out31; out31.AssignLC(*MyDStore,FileUid); out31.WriteInt32L(homme.DateTime().Hour()); out31.CommitL(); CleanupStack::PopAndDestroy(1);// out31 FileUid.iUid = 0x4422; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out32; out32.AssignLC(*MyDStore,FileUid); out32.WriteInt32L(homme.DateTime().Minute()); out32.CommitL(); CleanupStack::PopAndDestroy(1);// out32 FileUid.iUid = 0x6789; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } homme = homme + TTimeIntervalDays(4); RDictionaryWriteStream out4; out4.AssignLC(*MyDStore,FileUid); out4.WriteInt32L(homme.DateTime().Year()); out4.CommitL(); CleanupStack::PopAndDestroy(1);// out4 FileUid.iUid = 0x1111; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out5; out5.AssignLC(*MyDStore,FileUid); out5.WriteInt32L((TInt)homme.DateTime().Month()); out5.CommitL(); CleanupStack::PopAndDestroy(1);// out5 FileUid.iUid = 0x9786; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out6; out6.AssignLC(*MyDStore,FileUid); out6.WriteInt32L(homme.DateTime().Day()); out6.CommitL(); CleanupStack::PopAndDestroy(1);// out6 FileUid.iUid = 0x9721; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out61; out61.AssignLC(*MyDStore,FileUid); out61.WriteInt32L(homme.DateTime().Hour()); out61.CommitL(); CleanupStack::PopAndDestroy(1);// out61 FileUid.iUid = 0x9722; if(MyDStore->IsPresentL(FileUid)) { MyDStore->Remove(FileUid); MyDStore->CommitL(); } RDictionaryWriteStream out62; out62.AssignLC(*MyDStore,FileUid); out62.WriteInt32L(homme.DateTime().Minute()); out62.CommitL(); CleanupStack::PopAndDestroy(1);// out62 MyDStore->CommitL(); TTime nowwTimm; nowwTimm.HomeTime(); TTimeIntervalHours leftTimm; homme.HoursFrom(nowwTimm,leftTimm); aDaysLeft = leftTimm.Int(); ret = ETrue; }else{ TTime startTime(TDateTime(sYear,(TMonth)sMonth,sDay,sHour,sMinute,0,0)); TTime middleTime(TDateTime(mYear,(TMonth)mMonth,mDay,mHour,mMinute,0,0)); TTime edningTime(TDateTime(eYear,(TMonth)eMonth,eDay,eHour,eMinute,0,0)); TTimeIntervalMinutes sInterval(0); TTimeIntervalMinutes mInterval(0); TTimeIntervalMinutes eInterval(0); homme.MinutesFrom(startTime,sInterval); homme.MinutesFrom(middleTime,mInterval); edningTime.MinutesFrom(homme,eInterval); if(sInterval.Int() >= 0 && mInterval.Int() >= 0 && eInterval.Int() >= 0){ TTimeIntervalHours leftTimm; edningTime.HoursFrom(homme,leftTimm); aDaysLeft = leftTimm.Int(); ret = ETrue; } } }else{ /* RDictionaryWriteStream out3; out3.AssignLC(*MyDStore,FileUid); out3.WriteInt32L(12985674); out3.CommitL(); CleanupStack::PopAndDestroy(1);// out3 MyDStore->CommitL();*/ } CleanupStack::PopAndDestroy(1);// Store } fsSession.Close(); return ret; }