harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp
changeset 23 33ae025ac1e8
parent 21 50bf9db68373
child 25 8e4539ab1889
child 41 2290317b9ec5
--- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Fri Apr 16 15:23:55 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Mon May 03 12:55:01 2010 +0300
@@ -276,6 +276,8 @@
 		{
 		CMdEObjectDef& objectDef = mdeObject.Def();
 		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
+		// Prefetch max text lengt for validity checking
+		iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
 		}
 	
 	CMdeObjectWrapper::HandleObjectPropertyL(
@@ -309,6 +311,8 @@
     		{
     		CMdEObjectDef& objectDef = mdeObject.Def();
     		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
+    		// Prefetch max text lengt for validity checking
+    		iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
     		}
         
     	CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
@@ -339,6 +343,8 @@
         {
         CMdEObjectDef& audioObjectDef = mdeObject.Def();
         iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( audioObjectDef );
+        // Prefetch max text lengt for validity checking
+        iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
         }
     
     TPtrC ext;
@@ -390,35 +396,35 @@
     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd );
 	
     if ( song.Length() > 0
-        && song.Length() < iPropDefs->iTitlePropertyDef->MaxTextLengthL() )
+        && song.Length() < iMaxTextLength )
         {    
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iTitlePropertyDef, &song, EFalse );
         }
 
     if ( artist.Length() > 0
-        && artist.Length() < iPropDefs->iArtistPropertyDef->MaxTextLengthL() )
+        && artist.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iArtistPropertyDef, &artist, aIsAdd );
         }
 
     if ( album.Length() > 0
-        && album.Length() < iPropDefs->iAlbumPropertyDef->MaxTextLengthL() )
+        && album.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iAlbumPropertyDef, &album, aIsAdd );
         }
  
     if ( genre.Length() > 0
-        && genre.Length() < iPropDefs->iGenrePropertyDef->MaxTextLengthL() )
+        && genre.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iGenrePropertyDef, &genre, aIsAdd );
         }
 
     if ( composer.Length() > 0
-        && composer.Length() < iPropDefs->iComposerPropertyDef->MaxTextLengthL() )
+        && composer.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iComposerPropertyDef, &composer, aIsAdd );
@@ -437,7 +443,7 @@
         }
     
     if ( orgArtist.Length() > 0
-        && orgArtist.Length() < iPropDefs->iOriginalArtistPropertyDef->MaxTextLengthL() )
+        && orgArtist.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iOriginalArtistPropertyDef, &orgArtist, aIsAdd );
@@ -468,7 +474,7 @@
         }
     
     if ( copyright.Length() > 0
-        && copyright.Length() < iPropDefs->iCopyrightPropertyDef->MaxTextLengthL() )
+        && copyright.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
         		*iPropDefs->iCopyrightPropertyDef, &copyright, aIsAdd );