calendarui/editors/src/calenunifiededitor.cpp
branchRCL_3
changeset 20 9c5b1510919f
parent 18 d68a4b5d5885
child 25 bf573002ff72
equal deleted inserted replaced
18:d68a4b5d5885 20:9c5b1510919f
  1213 
  1213 
  1214 
  1214 
  1215 TInt CCalenUnifiedEditor::AsyncProcessCommandL( TAny* aThisPtr )
  1215 TInt CCalenUnifiedEditor::AsyncProcessCommandL( TAny* aThisPtr )
  1216     {
  1216     {
  1217     TInt focusControl( static_cast<CCalenUnifiedEditor*>(aThisPtr)->IdOfFocusControl() );
  1217     TInt focusControl( static_cast<CCalenUnifiedEditor*>(aThisPtr)->IdOfFocusControl() );
  1218     CEikEdwin* edwin = static_cast<CEikEdwin*>( static_cast<CCalenUnifiedEditor*>(aThisPtr)->Control( focusControl ) );  
  1218     if(focusControl == ECalenEditorDescription)
       
  1219         {
       
  1220         CEikEdwin* edwin = static_cast<CEikEdwin*>( static_cast<CCalenUnifiedEditor*>(aThisPtr)->Control( focusControl ) );  
  1219         if ( edwin && edwin->Text()->DocumentLength() == 0 )
  1221         if ( edwin && edwin->Text()->DocumentLength() == 0 )
  1220             {
  1222             {
  1221             static_cast<CCalenUnifiedEditor*>(aThisPtr)->ProcessCommandL(ECalenCmdAddDescription);
  1223             static_cast<CCalenUnifiedEditor*>(aThisPtr)->ProcessCommandL(ECalenCmdAddDescription);
  1222             }
  1224             }
  1223         else
  1225         else
  1224             {
  1226             {
  1225             static_cast<CCalenUnifiedEditor*>(aThisPtr)->ProcessCommandL(ECalenCmdShowDescription);
  1227             static_cast<CCalenUnifiedEditor*>(aThisPtr)->ProcessCommandL(ECalenCmdShowDescription);
  1226             }
  1228             }
  1227     
  1229         }
  1228     return 0;
  1230     return 0;
  1229     }
  1231     }
  1230 
  1232 
  1231 
  1233 
  1232 // -----------------------------------------------------------------------------
  1234 // -----------------------------------------------------------------------------
  1910     TRACE_ENTRY_POINT;
  1912     TRACE_ENTRY_POINT;
  1911 
  1913 
  1912     const TBool continueOnError = EFalse;
  1914     const TBool continueOnError = EFalse;
  1913     iUnifiedEditorControl->ReadDataFromEditorL( continueOnError );
  1915     iUnifiedEditorControl->ReadDataFromEditorL( continueOnError );
  1914     
  1916     
  1915     TEntryExistenceStatus status = EntryStillExistsL();
  1917     TEntryExistenceStatus status;
       
  1918     
       
  1919 	if(!IsCreatingNewEntry())
       
  1920 		{
       
  1921         status = EntryStillExistsL();
       
  1922 		}
       
  1923     else
       
  1924 		{
       
  1925 		status = EEntryOk;
       
  1926 		}
       
  1927 	 
  1916     TTimeIntervalDays aDay(0);
  1928     TTimeIntervalDays aDay(0);
  1917     if( iCurrentDurationDay<aDay )
  1929     if( iCurrentDurationDay<aDay )
  1918         {
  1930         {
  1919         DisplayErrorMsgL( CCalenEditorDataHandler::EFormErrStopTimeEarlierThanStartTime );
  1931         DisplayErrorMsgL( CCalenEditorDataHandler::EFormErrStopTimeEarlierThanStartTime );
  1920         return EFalse;
  1932         return EFalse;
  3256 void CCalenUnifiedEditor::GetAttachmentNamesL(RPointerArray<HBufC>& aAttachmentNames)
  3268 void CCalenUnifiedEditor::GetAttachmentNamesL(RPointerArray<HBufC>& aAttachmentNames)
  3257     {
  3269     {
  3258     TInt attachCount = iServices->GetAttachmentData()->NumberOfItems();
  3270     TInt attachCount = iServices->GetAttachmentData()->NumberOfItems();
  3259     if( attachCount )
  3271     if( attachCount )
  3260         {    
  3272         {    
  3261         RPointerArray<CCalenAttachmentInfo> attachmentInfoList;      
  3273         RPointerArray<CCalenAttachmentInfo> attachmentInfoList;  
       
  3274 		CleanupClosePushL( attachmentInfoList );
  3262         iServices->GetAttachmentData()->GetAttachmentListL(attachmentInfoList);
  3275         iServices->GetAttachmentData()->GetAttachmentListL(attachmentInfoList);
  3263         for( TInt index =0; index<attachCount; index++ )
  3276         for( TInt index =0; index<attachCount; index++ )
  3264             {
  3277             {
  3265             CCalenAttachmentInfo* attachmentInfo = attachmentInfoList[index];
  3278             CCalenAttachmentInfo* attachmentInfo = attachmentInfoList[index];
  3266             TParsePtrC fileNameParser( attachmentInfo->FileName() );
  3279             TParsePtrC fileNameParser( attachmentInfo->FileName() );
  3267             HBufC* attachmentName = HBufC::NewL(fileNameParser.NameAndExt().Length());
  3280             HBufC* attachmentName = HBufC::NewL(fileNameParser.NameAndExt().Length());
  3268             attachmentName->Des().Copy(fileNameParser.NameAndExt());
  3281             attachmentName->Des().Copy(fileNameParser.NameAndExt());
  3269             aAttachmentNames.Append(attachmentName);
  3282             aAttachmentNames.Append(attachmentName);
  3270             }
  3283             }
       
  3284 		CleanupStack::PopAndDestroy( &attachmentInfoList );		
  3271         }
  3285         }
  3272     else
  3286     else
  3273         {
  3287         {
  3274         Edited().AttachmentNamesL(aAttachmentNames);
  3288         Edited().AttachmentNamesL(aAttachmentNames);
  3275         }
  3289         }