harvesterplugins/contacts/src/ccontactsplugin.cpp
changeset 12 993ab30e92fc
parent 11 773be20e0a25
child 17 7d8c8d8f5eab
--- a/harvesterplugins/contacts/src/ccontactsplugin.cpp	Wed Jun 23 18:13:49 2010 +0300
+++ b/harvesterplugins/contacts/src/ccontactsplugin.cpp	Tue Jul 06 14:17:22 2010 +0300
@@ -78,16 +78,15 @@
 //
 CContactsPlugin::~CContactsPlugin()
 	{
-    if (iAsynchronizer)
-        iAsynchronizer->CancelCallback();
+    if( iAsynchronizer ) iAsynchronizer->CancelCallback(); 
 	delete iAsynchronizer;
 	iContacts = NULL;
 	delete iChangeNotifier;
 	delete iDatabase;
 	delete iIndexer;
-	
-	if (iExcerpt)
-		delete iExcerpt;
+	//delete NULL is safe - so no need to test nullity of iExceprt (which routinely
+	//keeps getting deleted in the plugin).
+	delete iExcerpt;
 	}
 	
 // -----------------------------------------------------------------------------
@@ -342,6 +341,8 @@
 //	    
 void CContactsPlugin::CreateContactIndexItemL(TInt aContentId, TCPixActionType aActionType )
     {
+    //indexer is created only when StartPlugin() is called. Don't create contact 
+    //if index is not ready. 
 	if (!iIndexer)
     	return;
     
@@ -483,8 +484,9 @@
 void CContactsPlugin::GetDateL(const TDesC& aTime, TDes& aDateString)
     {
     TTime time;
-    //sort the date string to the requried format dd/mm/yyyy from returned
-    //format yyyy/mm/dd as parse API is currently not supporting japanese date format
+    //aTime is of the form yyyy-mm-dd.
+    //aDateString is of the form dd Month(spelled out) Year.
+    //example: i/p: 2010-10-10; o/p: 10 October 2010.
     if( aTime.Length() >= KDateFieldLength)
         {
         aDateString.Copy(aTime.Mid( KDayPosition, KDayLength ));
@@ -499,6 +501,7 @@
             }
         }
     }
+
 // ---------------------------------------------------------------------------
 // CContactsPlugin::UpdatePerformaceDataL
 // ---------------------------------------------------------------------------