harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp
changeset 43 c5e73110f733
parent 28 c461c7fa72c2
child 60 79f826a55db2
child 63 e538444823de
--- a/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -35,11 +35,24 @@
 // Enough size to recognize file and read metaheader
 const TInt KFileBufferSize( KMaxMetaHeaderLength );
 
-CHarvesterRtpPluginPropertyDefs::CHarvesterRtpPluginPropertyDefs() : CBase()
+CHarvesterRtpPluginPropertyDefs::CHarvesterRtpPluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
-void CHarvesterRtpPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
+void CHarvesterRtpPluginPropertyDefs::ConstructL( CMdEObjectDef& aObjectDef )
+    {
+    SetByObjectDefL( aObjectDef );
+    }
+
+CHarvesterRtpPluginPropertyDefs* CHarvesterRtpPluginPropertyDefs::NewL()
+    {
+    CHarvesterRtpPluginPropertyDefs* self = 
+        new (ELeave) CHarvesterRtpPluginPropertyDefs();
+    return self;
+    }
+
+void CHarvesterRtpPluginPropertyDefs::SetByObjectDefL( CMdEObjectDef& aObjectDef )
 	{
 	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
 	
@@ -61,16 +74,6 @@
 	iRecordingFlagsPropertyDef = &videoDef.GetPropertyDefL( MdeConstants::Video::KRecordingFlagsProperty );
 	}
 
-CHarvesterRtpPluginPropertyDefs* CHarvesterRtpPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterRtpPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterRtpPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
 // ======== MEMBER FUNCTIONS ========
 
 // ---------------------------------------------------------------------------
@@ -89,6 +92,7 @@
     {
     WRITELOG( "CHarvesterRtpPlugin::ConstructL()" );
     SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );
+    iPropDefs = CHarvesterRtpPluginPropertyDefs::NewL();
     }
 
 // ---------------------------------------------------------------------------
@@ -262,12 +266,8 @@
     WRITELOG( "CHarvesterRtpPlugin::HandleObjectPropertiesL()" );
 
     CMdEObject& mdeObject = aHD.MdeObject();
-    
-    if( !iPropDefs )
-		{
-		CMdEObjectDef& objectDef = mdeObject.Def();
-		iPropDefs = CHarvesterRtpPluginPropertyDefs::NewL( objectDef );
-		}
+     
+    InitPropDefsL( mdeObject.Def() );
 
     TTimeIntervalSeconds timeOffset = User::UTCOffset();
     TTime localModifiedTime = aClipDetails.iModifiedDate + timeOffset;
@@ -340,3 +340,13 @@
     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     		*iPropDefs->iRecordingFlagsPropertyDef, &flags, aIsAdd );
     }
+
+void CHarvesterRtpPlugin::InitPropDefsL( CMdEObjectDef& aObjectDef )
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        }
+    }
+
+