mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp
branchRCL_3
changeset 31 a12246c97fcc
parent 28 56b11cf8addb
child 50 26a1709b9fec
equal deleted inserted replaced
28:56b11cf8addb 31:a12246c97fcc
   730 
   730 
   731         // special handling needed for year
   731         // special handling needed for year
   732         CCoeControl* coeControl = ControlOrNull( EMPXMetadataEditorDlgCtrlIdYear );
   732         CCoeControl* coeControl = ControlOrNull( EMPXMetadataEditorDlgCtrlIdYear );
   733         if ( coeControl )
   733         if ( coeControl )
   734             {
   734             {
   735             CEikNumberEditor* control = static_cast<CEikNumberEditor*>( coeControl );
   735             CEikEdwin* control = static_cast<CEikEdwin*>( coeControl );
   736             if ( control )
   736             if ( control )
   737                 {
   737                 {
   738                 TInt num = control->Number();
   738                 TBuf<KMPXSongDetailsNumTextWidth> num;
   739                 if ( num != iYear )
   739                 control->GetText( num );
       
   740                 TLex numLex( num );
       
   741                 TInt LexToInt;
       
   742                 numLex.Val( LexToInt );
       
   743                 if ( LexToInt != iYear )
   740                     {
   744                     {
   741                     MPX_DEBUG3( "CMPXMetadataEditorDialog::SaveFormDataL year changed from %d to %d", iYear, num );
   745                     MPX_DEBUG3( "CMPXMetadataEditorDialog::SaveFormDataL year changed from %d to %d", iYear, num );
   742                     TDateTime newYear;
   746                     TDateTime newYear;
   743                     newYear.Set( num, EJanuary, 0, 0, 0, 0, 0 );
   747                     newYear.Set( LexToInt, EJanuary, 0, 0, 0, 0, 0 );
   744                     TTime year( newYear );
   748                     TTime year( newYear );
   745                     iMedia->SetTObjectValueL<TInt64>(
   749                     iMedia->SetTObjectValueL<TInt64>(
   746                         KMPXMediaMusicYear, year.Int64() );
   750                         KMPXMediaMusicYear, year.Int64() );
   747                     media->SetTObjectValueL<TInt64>(
   751                     media->SetTObjectValueL<TInt64>(
   748                         KMPXMediaMusicYear, year.Int64() );
   752                         KMPXMediaMusicYear, year.Int64() );
   749                     iYear = num;
   753                     iYear = LexToInt;
   750                     changed = ETrue;
   754                     changed = ETrue;
   751                     }
   755                     }
   752                 else
   756                 else
   753                     {
   757                     {
   754                     MPX_DEBUG1( "CMPXMetadataEditorDialog::SaveFormDataL year not changed" );
   758                     MPX_DEBUG1( "CMPXMetadataEditorDialog::SaveFormDataL year not changed" );
  1081     if ( samplingRateNum > 0 )
  1085     if ( samplingRateNum > 0 )
  1082         {
  1086         {
  1083         HBufC* stringBuf = HBufC::NewLC( KMPXFileDetailsMaxBufferLen );
  1087         HBufC* stringBuf = HBufC::NewLC( KMPXFileDetailsMaxBufferLen );
  1084         TPtr stringBufPtr = stringBuf->Des();
  1088         TPtr stringBufPtr = stringBuf->Des();
  1085         stringBufPtr.AppendNum( samplingRateNum );
  1089         stringBufPtr.AppendNum( samplingRateNum );
       
  1090         AknTextUtils::LanguageSpecificNumberConversion( stringBufPtr );
  1086         HBufC* samplingrate = StringLoader::LoadLC(
  1091         HBufC* samplingrate = StringLoader::LoadLC(
  1087                         R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr );
  1092                         R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr );
  1088         aDataArray->AppendL( samplingrate->Des() );
  1093         aDataArray->AppendL( samplingrate->Des() );
  1089         CleanupStack::PopAndDestroy( samplingrate );
  1094         CleanupStack::PopAndDestroy( samplingrate );
  1090         CleanupStack::PopAndDestroy( stringBuf );
  1095         CleanupStack::PopAndDestroy( stringBuf );
  1121     if ( iCurrentLibrary == EMPXMetadataEditorDlgPodcast )
  1126     if ( iCurrentLibrary == EMPXMetadataEditorDlgPodcast )
  1122         {
  1127         {
  1123         PopulatePodcastFileDetailsL( aHeadingsArray, aDataArray );
  1128         PopulatePodcastFileDetailsL( aHeadingsArray, aDataArray );
  1124         }
  1129         }
  1125 
  1130 
  1126     // Get last modified time
  1131     // Get modified
  1127     TTime time;
  1132     TTime time;
  1128     User::LeaveIfError( fs.Modified( uri, time ) );
  1133     User::LeaveIfError( fs.Modified( uri, time ) );
  1129     ConvertToLocalTimeL( time );
  1134     ConvertToLocalTimeL( time );
  1130 	HBufC* modDateTime = HBufC::NewLC(
  1135 	HBufC* modDateTime = HBufC::NewLC(
  1131 		KMPXMaxTimeLength + KMPXDurationDisplayResvLen );
  1136 		KMPXMaxTimeLength + KMPXDurationDisplayResvLen );
  2152 // -----------------------------------------------------------------------------
  2157 // -----------------------------------------------------------------------------
  2153 //
  2158 //
  2154 void CMPXMetadataEditorDialog::PrepareForFocusTransitionL()
  2159 void CMPXMetadataEditorDialog::PrepareForFocusTransitionL()
  2155     {
  2160     {
  2156     MPX_FUNC( "CMPXMetadataEditorDialog::PrepareForFocusTransitionL" );
  2161     MPX_FUNC( "CMPXMetadataEditorDialog::PrepareForFocusTransitionL" );
  2157     TInt err = KErrNone;
       
  2158 
       
  2159     CEikNumberEditor* myTrackNumberEditor = static_cast<CEikNumberEditor*>
       
  2160             ( ControlOrNull( EMPXMetadataEditorDlgCtrlIdTrackNumber ) );
       
  2161 
       
  2162     CEikNumberEditor* myYearNumberEditor = static_cast<CEikNumberEditor*>
       
  2163             ( ControlOrNull( EMPXMetadataEditorDlgCtrlIdYear ) );
       
  2164 
       
  2165     if ( myTrackNumberEditor )
       
  2166         {
       
  2167         // if length 0 trap error and set to 0.
       
  2168         MPX_TRAP( err, myTrackNumberEditor->Number() );
       
  2169         if ( err )
       
  2170             {
       
  2171             myTrackNumberEditor->SetNumber( KMPXMinNumDateTrack );
       
  2172             }
       
  2173         }
       
  2174 
       
  2175     if ( myYearNumberEditor )
       
  2176         {
       
  2177         // if length 0 trap error and set to 0.
       
  2178         MPX_TRAP( err, myYearNumberEditor->Number() );
       
  2179         if ( err )
       
  2180             {
       
  2181             myYearNumberEditor->SetNumber( KMPXMinNumDateTrack );
       
  2182             }
       
  2183         }
       
  2184 
       
  2185     CAknForm::PrepareForFocusTransitionL();
  2162     CAknForm::PrepareForFocusTransitionL();
  2186     }
  2163     }
  2187 
  2164 
  2188 // -----------------------------------------------------------------------------
  2165 // -----------------------------------------------------------------------------
  2189 // CMPXMetadataEditorDialog::GetHelpContext
  2166 // CMPXMetadataEditorDialog::GetHelpContext
  2441     {
  2418     {
  2442     MPX_FUNC( "CMPXMetadataEditorDialog::PreLayoutDynInitL" );
  2419     MPX_FUNC( "CMPXMetadataEditorDialog::PreLayoutDynInitL" );
  2443     SetTitlePaneL();
  2420     SetTitlePaneL();
  2444     SetNaviLabelL();
  2421     SetNaviLabelL();
  2445 
  2422 
  2446     _LIT( KZero, "0" );
       
  2447     
       
  2448     SetControlNumberL( EMPXMetadataEditorDlgCtrlIdTrackNumber, KZero,
       
  2449     	KMPXSongDetailsTrackNumMin, KMPXSongDetailsTrackNumMax );
       
  2450 
       
  2451     SetControlNumberL ( EMPXMetadataEditorDlgCtrlIdYear, KZero,
       
  2452     	KMPXSongDetailsYearMin, KMPXSongDetailsYearMax );
       
  2453 
       
  2454     // Get media property for the current song
  2423     // Get media property for the current song
  2455     
  2424     
  2456     if ( iParam ) // Dialog launched from CollectionView
  2425     if ( iParam ) // Dialog launched from CollectionView
  2457         {
  2426         {
  2458 		CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
  2427 		CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
  2661 //
  2630 //
  2662 void CMPXMetadataEditorDialog::SetControlNumberL( TInt aControlId,
  2631 void CMPXMetadataEditorDialog::SetControlNumberL( TInt aControlId,
  2663     const TDesC& aValue, TInt aMinValue, TInt aMaxValue )
  2632     const TDesC& aValue, TInt aMinValue, TInt aMaxValue )
  2664     {
  2633     {
  2665     MPX_FUNC( "CMPXMetadataEditorDialog::SetControlNumberL" );
  2634     MPX_FUNC( "CMPXMetadataEditorDialog::SetControlNumberL" );
  2666     CEikNumberEditor* myNumberEditor = static_cast< CEikNumberEditor* >
  2635     CEikEdwin* myEdwin = static_cast< CEikEdwin* >
  2667         ( ControlOrNull( aControlId ) );
  2636         ( ControlOrNull( aControlId ) );
  2668 
  2637     
  2669     TInt defaultValue( 0 );
  2638     if ( myEdwin )
  2670     if ( aMinValue > 0  )
       
  2671         {
       
  2672         defaultValue = aMinValue;
       
  2673         }
       
  2674 
       
  2675     if ( myNumberEditor )
       
  2676         {
  2639         {
  2677         if ( aValue.Length() > 0 )
  2640         if ( aValue.Length() > 0 )
  2678             {
  2641             {
  2679             TLex trackNumLex( aValue );
  2642             TLex numLex( aValue );
  2680             TInt LexToInt;
  2643             TInt LexToInt;
  2681             if ( trackNumLex.Val( LexToInt ) == KErrNone )
  2644             if ( numLex.Val( LexToInt ) == KErrNone )
  2682                 {
  2645                 {
  2683                 if ( LexToInt > aMaxValue )
  2646                 if ( LexToInt > aMaxValue )
  2684                     {
  2647                     {
  2685                     LexToInt = aMaxValue;
  2648                     LexToInt = aMaxValue;
  2686                     }
  2649                     }
  2687                 if ( LexToInt < aMinValue )
  2650                 if ( LexToInt < aMinValue )
  2688                     {
  2651                     {
  2689                     LexToInt = aMinValue;
  2652                     LexToInt = aMinValue;
  2690                     }
  2653                     }
  2691                 myNumberEditor->SetNumber( LexToInt );
  2654                 TBuf<KMPXSongDetailsNumTextWidth> num;
       
  2655                 num.AppendNum( LexToInt );
       
  2656 			    myEdwin->SetTextL( &num );
  2692                 }
  2657                 }
  2693             else
       
  2694                 {
       
  2695                 myNumberEditor->SetNumber( defaultValue );
       
  2696                 }
       
  2697             }
       
  2698         else
       
  2699             {
       
  2700             myNumberEditor->SetNumber( defaultValue );
       
  2701             }
  2658             }
  2702         }
  2659         }
  2703     }
  2660     }
  2704 
  2661 
  2705 // -----------------------------------------------------------------------------
  2662 // -----------------------------------------------------------------------------
  2769             case EMPXMetadataEditorDlgCtrlIdSongName:
  2726             case EMPXMetadataEditorDlgCtrlIdSongName:
  2770             case EMPXMetadataEditorDlgCtrlIdArtist:
  2727             case EMPXMetadataEditorDlgCtrlIdArtist:
  2771             case EMPXMetadataEditorDlgCtrlIdAlbum:
  2728             case EMPXMetadataEditorDlgCtrlIdAlbum:
  2772             case EMPXMetadataEditorDlgCtrlIdComment:
  2729             case EMPXMetadataEditorDlgCtrlIdComment:
  2773             case EMPXMetadataEditorDlgCtrlIdComposer:
  2730             case EMPXMetadataEditorDlgCtrlIdComposer:
       
  2731             case EMPXMetadataEditorDlgCtrlIdTrackNumber:
  2774                 {
  2732                 {
  2775                 CEikEdwin* control = static_cast<CEikEdwin*>( coeControl );
  2733                 CEikEdwin* control = static_cast<CEikEdwin*>( coeControl );
  2776                 if ( control )
  2734                 if ( control )
  2777                     {
  2735                     {
  2778                     buf = control->GetTextInHBufL();
  2736                     buf = control->GetTextInHBufL();
  2805                     // should not reach here
  2763                     // should not reach here
  2806                     User::Leave( KErrArgument );
  2764                     User::Leave( KErrArgument );
  2807                     }
  2765                     }
  2808                 break;
  2766                 break;
  2809                 }
  2767                 }
  2810             case EMPXMetadataEditorDlgCtrlIdTrackNumber:
       
  2811                 {
       
  2812                 CEikNumberEditor* control = static_cast<CEikNumberEditor*>( coeControl );
       
  2813                 if ( control )
       
  2814                     {
       
  2815                     TInt num = control->Number();
       
  2816                     MPX_DEBUG2( "CMPXMetadataEditorDialog::UpdateMediaObjectWithControlL number from control %d", num );
       
  2817                     buf = HBufC::NewLC( KMPXFileDetailsMaxBufferLen );
       
  2818                     TPtr bufPtr = buf->Des();
       
  2819                     bufPtr.AppendNum( num );
       
  2820                     }
       
  2821                 else
       
  2822                     {
       
  2823                     // should not reach here
       
  2824                     User::Leave( KErrArgument );
       
  2825                     }
       
  2826                 break;
       
  2827                 }
       
  2828             default:
  2768             default:
  2829                 {
  2769                 {
  2830                 // should not reach here
  2770                 // should not reach here
  2831                 User::Leave( KErrArgument );
  2771                 User::Leave( KErrArgument );
  2832                 break;
  2772                 break;
  2868     MPX_FUNC( "CMPXMetadataEditorDialog::PopulateFileDetailsL" );
  2808     MPX_FUNC( "CMPXMetadataEditorDialog::PopulateFileDetailsL" );
  2869     
  2809     
  2870     ASSERT(iMedia);
  2810     ASSERT(iMedia);
  2871     TBool drmProtected(iMedia->ValueTObjectL<TBool> (KMPXMediaDrmProtected));
  2811     TBool drmProtected(iMedia->ValueTObjectL<TBool> (KMPXMediaDrmProtected));
  2872     MPX_DEBUG2( "CMPXMetadataEditorDialog::PopulateFileDetailsL drm protected: %d", drmProtected );
  2812     MPX_DEBUG2( "CMPXMetadataEditorDialog::PopulateFileDetailsL drm protected: %d", drmProtected );
  2873 
  2813     
  2874     if (drmProtected)
  2814     if (drmProtected)
  2875         {
  2815         {
  2876         HBufC* detail = StringLoader::LoadLC( R_MPX_CUI_LICENCE_DET_LINK );
  2816         HBufC* detail = StringLoader::LoadLC( R_MPX_CUI_LICENCE_DET_LINK );
  2877         InsertLineL(9,R_MPX_CUI_LICENCE_INFO,ActivePageId() );
       
  2878         SetControlTextL(EMPXMetadataEditorDlgCtrlIdDRMDetail, detail->Des(),
  2817         SetControlTextL(EMPXMetadataEditorDlgCtrlIdDRMDetail, detail->Des(),
  2879                 KNullDesC);
  2818                 KNullDesC);
  2880         CleanupStack::PopAndDestroy( detail );	
  2819         CleanupStack::PopAndDestroy( detail );	
  2881         }
  2820         }
  2882    
  2821     else
       
  2822         {
       
  2823         DeleteLine(EMPXMetadataEditorDlgCtrlIdDRMDetail,EFalse); 
       
  2824         } 
  2883     // Get filename
  2825     // Get filename
  2884     const TDesC& uri = iMedia->ValueText(KMPXMediaGeneralUri);
  2826     const TDesC& uri = iMedia->ValueText(KMPXMediaGeneralUri);
  2885     TParsePtrC parse(uri);
  2827     TParsePtrC parse(uri);
  2886 
  2828 
  2887     SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileName, parse.Name(),
  2829     SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileName, parse.Name(),
  2940     if (samplingRateNum > 0)
  2882     if (samplingRateNum > 0)
  2941         {
  2883         {
  2942         HBufC* stringBuf = HBufC::NewLC(KMPXFileDetailsMaxBufferLen);
  2884         HBufC* stringBuf = HBufC::NewLC(KMPXFileDetailsMaxBufferLen);
  2943         TPtr stringBufPtr = stringBuf->Des();
  2885         TPtr stringBufPtr = stringBuf->Des();
  2944         stringBufPtr.AppendNum(samplingRateNum);
  2886         stringBufPtr.AppendNum(samplingRateNum);
       
  2887         AknTextUtils::LanguageSpecificNumberConversion( stringBufPtr );
  2945         HBufC* samplingrate = StringLoader::LoadLC(
  2888         HBufC* samplingrate = StringLoader::LoadLC(
  2946                 R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr);
  2889                 R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr);
  2947         SetControlTextL(EMPXMetadataEditorDlgCtrlIdSamplingrate,
  2890         SetControlTextL(EMPXMetadataEditorDlgCtrlIdSamplingrate,
  2948                 samplingrate->Des(), KNullDesC);
  2891                 samplingrate->Des(), KNullDesC);
  2949         CleanupStack::PopAndDestroy(samplingrate);
  2892         CleanupStack::PopAndDestroy(samplingrate);
  3047 // CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL
  2990 // CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL
  3048 // -----------------------------------------------------------------------------
  2991 // -----------------------------------------------------------------------------
  3049 //
  2992 //
  3050 void CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL()
  2993 void CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL()
  3051     {
  2994     {
  3052       InsertLineL(13,R_MPX_CUI_LAST_PLAYBACK_POSITION,ActivePageId() );
  2995     TInt lastPbPosition((TInt) iMedia->ValueTObjectL<TInt> ( 
  3053                     
  2996 	        KMPXMediaGeneralLastPlaybackPosition ));
  3054             TInt lastPbPosition((TInt) iMedia->ValueTObjectL<TInt> (
  2997     if (lastPbPosition > 0)
  3055                     KMPXMediaGeneralLastPlaybackPosition));
  2998         {
  3056 
  2999         // convert milliseconds to seconds
  3057             if (lastPbPosition > 0)
  3000         lastPbPosition = lastPbPosition / KSecondInMilliseconds;
  3058                 {
  3001         CMPXCommonUiHelper::TMPXDuratDisplayMode lastPbPositionMode =
  3059                 // convert milliseconds to seconds
  3002         CMPXCommonUiHelper::EMPXDuratAuto;
  3060                 lastPbPosition = lastPbPosition / KSecondInMilliseconds;
  3003         if (lastPbPosition > KOneHourInSeconds)
  3061                 CMPXCommonUiHelper::TMPXDuratDisplayMode lastPbPositionMode =
  3004             {
  3062                 CMPXCommonUiHelper::EMPXDuratAuto;
  3005             lastPbPositionMode = CMPXCommonUiHelper::EMPXDuratHMS;
  3063                 if (lastPbPosition > KOneHourInSeconds)
  3006             }
  3064                     {
  3007         HBufC* stringBuf = iCommonUiHelper->DisplayableDurationL(
  3065                     lastPbPositionMode = CMPXCommonUiHelper::EMPXDuratHMS;
  3008                 lastPbPosition, lastPbPositionMode);
  3066                     }
  3009         CleanupStack::PushL(stringBuf);
  3067                 HBufC* stringBuf = iCommonUiHelper->DisplayableDurationL(
  3010         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
  3068                         lastPbPosition, lastPbPositionMode);
  3011                 *stringBuf, KNullDesC);
  3069                 CleanupStack::PushL(stringBuf);
  3012         CleanupStack::PopAndDestroy(stringBuf);
  3070                 SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
  3013         }
  3071                         *stringBuf, KNullDesC);
  3014     else if (lastPbPosition == 0 && iMedia->IsSupported(
  3072                 CleanupStack::PopAndDestroy(stringBuf);
  3015             KMPXMediaGeneralPlayCount) && iMedia->ValueTObjectL<TInt> (
  3073                 }
  3016                    KMPXMediaGeneralPlayCount) > 0)
  3074             else if (lastPbPosition == 0 && iMedia->IsSupported(
  3017         {
  3075                     KMPXMediaGeneralPlayCount) && iMedia->ValueTObjectL<TInt> (
  3018         HBufC* stringBuf = StringLoader::LoadLC(
  3076                             KMPXMediaGeneralPlayCount) > 0)
  3019                 R_MPX_CUI_METADATAEDITOR_PLAYBACK_COMPLETE);
  3077                 {
  3020         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
  3078                 HBufC* stringBuf = StringLoader::LoadLC(
  3021                 *stringBuf, KNullDesC);
  3079                         R_MPX_CUI_METADATAEDITOR_PLAYBACK_COMPLETE);
  3022         CleanupStack::PopAndDestroy(stringBuf);
  3080                 SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
  3023         }
  3081                         *stringBuf, KNullDesC);
  3024     else
  3082                 CleanupStack::PopAndDestroy(stringBuf);
  3025         {
  3083 
  3026         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
  3084                 }
  3027                 KNullDesC, KNullDesC);
  3085             else
  3028         }
  3086                 {
       
  3087                 SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
       
  3088                         KNullDesC, KNullDesC);
       
  3089                 }
       
  3090            
  3029            
  3091             InsertLineL(14,R_MPX_CUI_DETAILS_PUBLISHED,ActivePageId() );
  3030     // Get published
  3092             
  3031     if (iMedia->IsSupported(TMPXAttribute(KMPXMediaIdPodcast,
  3093             // Get published
  3032             EMPXMediaPodcastPubDate)))
  3094             if (iMedia->IsSupported(TMPXAttribute(KMPXMediaIdPodcast,
  3033         {
  3095                     EMPXMediaPodcastPubDate)))
  3034         TInt64 timeInt(
  3096                 {
  3035                 (TInt64) iMedia->ValueTObjectL<TInt64> (TMPXAttribute(
  3097                 TInt64 timeInt(
  3036                         KMPXMediaIdPodcast, EMPXMediaPodcastPubDate)));
  3098                         (TInt64) iMedia->ValueTObjectL<TInt64> (TMPXAttribute(
  3037     	TTime time(timeInt);
  3099                                 KMPXMediaIdPodcast, EMPXMediaPodcastPubDate)));
  3038     	ConvertToLocalTimeL(time);
  3100                 TTime time(timeInt);
  3039     	HBufC* modDateTime = HBufC::NewLC(KMPXMaxTimeLength
  3101                 ConvertToLocalTimeL(time);
  3040         	    + KMPXDurationDisplayResvLen);
  3102                 HBufC* modDateTime = HBufC::NewLC(KMPXMaxTimeLength
  3041     	HBufC* format = StringLoader::LoadLC(R_QTN_DATE_USUAL_WITH_ZERO);
  3103                         + KMPXDurationDisplayResvLen);
  3042     	TPtr modDatePtr = modDateTime->Des();
  3104                 HBufC* format = StringLoader::LoadLC(R_QTN_DATE_USUAL_WITH_ZERO);
  3043     	MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
  3105                 TPtr modDatePtr = modDateTime->Des();
  3044     	CleanupStack::PopAndDestroy(format);
  3106                 MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
  3045     	if (err != KErrNone || time == 0)
  3107                 CleanupStack::PopAndDestroy(format);
  3046         	{
  3108                 if (err != KErrNone || time == 0)
  3047         	SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3109                     {
  3048             	    KNullDesC, KNullDesC);
  3110                     SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3049         	}
  3111                             KNullDesC, KNullDesC);
  3050     	else
  3112                     }
  3051         	{
  3113                 else
  3052         	format = StringLoader::LoadLC(R_QTN_TIME_USUAL_WITH_ZERO);
  3114                     {
  3053         	HBufC* modTime = HBufC::NewLC(format->Length()
  3115                     format = StringLoader::LoadLC(R_QTN_TIME_USUAL_WITH_ZERO);
  3054             	    + KMPXDurationDisplayResvLen);
  3116                     HBufC* modTime = HBufC::NewLC(format->Length()
  3055         	TPtr modTimePtr = modTime->Des();
  3117                             + KMPXDurationDisplayResvLen);
  3056         	MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
  3118                     TPtr modTimePtr = modTime->Des();
  3057         	if (err != KErrNone)
  3119                     MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
  3058            		{
  3120                     if (err != KErrNone)
  3059             	SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3121                         {
  3060                 	    KNullDesC, KNullDesC);
  3122                         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3061             	}
  3123                                 KNullDesC, KNullDesC);
  3062         	else
  3124                         }
  3063             	{
  3125                     else
  3064             	modDatePtr.Append(KMPXSpace);
  3126                         {
  3065             	modDatePtr.Append(modTimePtr);
  3127                         modDatePtr.Append(KMPXSpace);
  3066             	SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3128                         modDatePtr.Append(modTimePtr);
  3067                 	    modTimePtr, KNullDesC);
  3129                         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3068             	}
  3130                                 modTimePtr, KNullDesC);
  3069         	CleanupStack::PopAndDestroy(modTime);
  3131                         }
  3070         	CleanupStack::PopAndDestroy(format);
  3132                     CleanupStack::PopAndDestroy(modTime);
  3071         	}
  3133                     CleanupStack::PopAndDestroy(format);
  3072         CleanupStack::PopAndDestroy(modDateTime);
  3134                     }
  3073     	}
  3135                 CleanupStack::PopAndDestroy(modDateTime);
  3074     else
  3136                 }
  3075         {
  3137             else
  3076         SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3138                 {
  3077                 KNullDesC, KNullDesC);
  3139                 SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
  3078         }
  3140                         KNullDesC, KNullDesC);
  3079     }
  3141                 }
       
  3142       }
       
  3143 
  3080 
  3144 // -----------------------------------------------------------------------------
  3081 // -----------------------------------------------------------------------------
  3145 // CMPXMetadataEditorDialog::LaunchDrmInfoL
  3082 // CMPXMetadataEditorDialog::LaunchDrmInfoL
  3146 // -----------------------------------------------------------------------------
  3083 // -----------------------------------------------------------------------------
  3147 //
  3084 //