diff -r 42814f902fe6 -r 38571fd2a704 calendarui/editors/src/calenunifiededitor.cpp --- a/calendarui/editors/src/calenunifiededitor.cpp Fri Feb 19 22:49:53 2010 +0200 +++ b/calendarui/editors/src/calenunifiededitor.cpp Fri Mar 12 15:42:35 2010 +0200 @@ -165,7 +165,10 @@ delete iUnifiedEditorControl; iCollectionIds.Reset(); - + + iAsyncCallback->Cancel(); + delete iAsyncCallback; + TRACE_EXIT_POINT; } @@ -285,6 +288,11 @@ isReplaceLocation = EFalse; + + TCallBack callback(CCalenUnifiedEditor::AsyncProcessCommandL,this); + iAsyncCallback = new(ELeave) CAsyncCallBack(callback,CActive::EPriorityStandard); + + iIdle = CIdle::NewL( CActive::EPriorityUserInput ); iIdle->Start( TCallBack( KeyCallBack, this) ); iCoeEnv->AddFepObserverL( *this ); @@ -1242,7 +1250,22 @@ } break; } - + + case ECalenEditorDescription: + { +// CEikEdwin* edwin = static_cast( Control( focusControl ) ); +// if ( edwin && edwin->Text()->DocumentLength() == 0 ) +// { +// ProcessCommandL( ECalenCmdAddDescription ); +// } +// else +// { +// ProcessCommandL( ECalenCmdShowDescription ); +// } + iAsyncCallback->CallBack(); + break; + } + default: { break; @@ -1275,6 +1298,24 @@ } } + +TInt CCalenUnifiedEditor::AsyncProcessCommandL( TAny* aThisPtr ) + { + TInt focusControl( static_cast(aThisPtr)->IdOfFocusControl() ); + CEikEdwin* edwin = static_cast( static_cast(aThisPtr)->Control( focusControl ) ); + if ( edwin && edwin->Text()->DocumentLength() == 0 ) + { + static_cast(aThisPtr)->ProcessCommandL(ECalenCmdAddDescription); + } + else + { + static_cast(aThisPtr)->ProcessCommandL(ECalenCmdShowDescription); + } + + return 0; + } + + // ----------------------------------------------------------------------------- // CCalenUnifiedEditor::HandleResourceChange // Handdles the resource change @@ -1525,13 +1566,10 @@ TRACE_ENTRY_POINT; // Only insert if there is some summary (or location) - if( !EditorDataHandler().AreTextFieldsEmptyL() ) + // Changes done to remove Lunar calendar item from options menu + if( EditorDataHandler().AreTextFieldsEmptyL() ) { - // Insert Send menu item - iServices->OfferMenuPaneL( aResourceId, aMenuPane ); - } - else - {// Delete Send Menu item if exists + // Delete Send Menu item if exists aMenuPane->DeleteMenuItem( ECalenSend ); } @@ -1981,7 +2019,8 @@ if( startDate == CalenDateUtils::BeginningOfDay( startDate ) && endDate == CalenDateUtils::BeginningOfDay( endDate ) ) { - if( CCalEntry::EAppt == Edited().EntryType() && startDate != endDate ) + TTimeIntervalDays differenceInTime = endDate.DaysFrom(startDate); // fix for AllDayEntry issue + if( CCalEntry::EAppt == Edited().EntryType() && startDate != endDate && differenceInTime.Int() == 1 ) { Edited().SetEntryType( CCalEntry::EEvent ); } @@ -2238,6 +2277,7 @@ if(!IsCreatingNewEntry() && !iEditorDataHandler->IsCalendarEditedL()) { + iServices->GetAttachmentData()->Reset(); iServices->EntryViewL(iEditorDataHandler->PreviousDbCollectionId()) ->DeleteL(*iOriginalCalEntry); } @@ -2268,6 +2308,7 @@ } if(!IsCreatingNewEntry() && iEditorDataHandler->IsCalendarEditedL()) { + iServices->GetAttachmentData()->Reset(); iServices->EntryViewL(iEditorDataHandler->PreviousDbCollectionId()) ->DeleteL(*iOriginalCalEntry); } @@ -3050,9 +3091,9 @@ if( attachmentCount ) { RPointerArray attachmentNames; - Edited().AttachmentNamesL(attachmentNames); - TInt attachmentCount = attachmentNames.Count(); - TInt attachmentLength(0); + GetAttachmentNamesL(attachmentNames); + attachmentCount = attachmentNames.Count(); + TInt attachmentLength(0); for( TInt index =0; index0) @@ -3340,6 +3381,33 @@ TRACE_EXIT_POINT; } + +// ----------------------------------------------------------------------------- +// CCalenUnifiedEditor::AttachmentNamesL +// Provides all the attachments names +// ----------------------------------------------------------------------------- +// +void CCalenUnifiedEditor::GetAttachmentNamesL(RPointerArray& aAttachmentNames) + { + TInt attachCount = iServices->GetAttachmentData()->NumberOfItems(); + if( attachCount ) + { + RPointerArray attachmentInfoList; + iServices->GetAttachmentData()->GetAttachmentListL(attachmentInfoList); + for( TInt index =0; indexFileName() ); + HBufC* attachmentName = HBufC::NewL(fileNameParser.NameAndExt().Length()); + attachmentName->Des().Copy(fileNameParser.NameAndExt()); + aAttachmentNames.Append(attachmentName); + } + } + else + { + Edited().AttachmentNamesL(aAttachmentNames); + } + } // ----------------------------------------------------------------------------- // CMapsIconPicture::CMapsIconPicture