smsprotocols/smsstack/smsprot/Src/smspenum.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
--- a/smsprotocols/smsstack/smsprot/Src/smspenum.cpp	Tue Aug 31 16:23:08 2010 +0300
+++ b/smsprotocols/smsstack/smsprot/Src/smspenum.cpp	Wed Sep 01 12:40:21 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,12 +17,6 @@
  @file
 */
 
-
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "smspenumTraces.h"
-#endif
-
 #include "smspenum.h"
 #include "smspproc.h"
 #include "smsuset.h"
@@ -58,7 +52,7 @@
 								   TInt aPriority,
 								   CSmsMonitorDiskSpace& aSmsMonitorDiskSpace)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_NEWL_1, "CSmsStoreRead::NewL()");
+	LOGSMSPROT1("CSmsStoreRead::NewL()");
 
 	CSmsStoreRead* smsStoreRead = new ( ELeave ) CSmsStoreRead(aSmsComm,
 															   aSmsSettings,
@@ -111,7 +105,7 @@
  */
 void CSmsStoreRead::ConstructL()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_CONSTRUCTL_1, "CSmsStoreRead::ConstructL()");
+	LOGSMSPROT1("CSmsStoreRead::ConstructL()");
 
 	ConstructTimeoutL();
 	ReadConfigurableSmsSettingsL();
@@ -160,13 +154,13 @@
  */
 void CSmsStoreRead::ReadConfigurableSmsSettingsL()
     {
-    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_READCONFIGURABLESMSSETTINGSL_1, "CSmsStoreRead::ReadConfigurableSmsSettingsL()");
+    LOGSMSPROT1("CSmsStoreRead::ReadConfigurableSmsSettingsL()");
 
     CESockIniData*  ini = NULL;
     TRAPD(ret, ini=CESockIniData::NewL(_L("smswap.sms.esk")));
     if(ret!=KErrNone)
         {
-        OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_READCONFIGURABLESMSSETTINGSL_2, "CSmsStoreRead::ReadConfigurableSmsSettingsL(): ret=%d", ret);
+        LOGSMSPROT2("CSmsStoreRead::ReadConfigurableSmsSettingsL(): ret=%d", ret);
         User::Leave(ret);
         }
 
@@ -183,7 +177,8 @@
         iConfigAutomaticDeletionForClass2 = status;
         }
 
-	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_READCONFIGURABLESMSSETTINGSL_3, "CSmsStoreRead::ReadConfigurableSmsSettingsL(): iConfigAutomaticDeletionForClass2=%d",iConfigAutomaticDeletionForClass2);
+	LOGSMSPROT2("CSmsStoreRead::ReadConfigurableSmsSettingsL(): iConfigAutomaticDeletionForClass2=%d",
+				iConfigAutomaticDeletionForClass2);
 
     if (ini->FindVar(_L("Release6Configurability"),
     				 _L("DiscardType0_Class2Message"), status))
@@ -191,7 +186,8 @@
         iConfigDiscardingType0Class2 = status;
         }
 
-	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_READCONFIGURABLESMSSETTINGSL_4, "CSmsStoreRead::ReadConfigurableSmsSettingsL(): iConfigDiscardingType0Class2=%d",iConfigDiscardingType0Class2);
+	LOGSMSPROT2("CSmsStoreRead::ReadConfigurableSmsSettingsL(): iConfigDiscardingType0Class2=%d",
+				iConfigDiscardingType0Class2);
 
     if (ini->FindVar(_L("Release6Configurability"),
     				 _L("DiscardType0_Class0Message"), status))
@@ -199,7 +195,8 @@
         iConfigDiscardingType0Class0 = status;
         }
 
-	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_READCONFIGURABLESMSSETTINGSL_5, "CSmsStoreRead::ReadConfigurableSmsSettingsL(): iConfigDiscardingType0Class0=%d",iConfigDiscardingType0Class0);
+	LOGSMSPROT2("CSmsStoreRead::ReadConfigurableSmsSettingsL(): iConfigDiscardingType0Class0=%d",
+				iConfigDiscardingType0Class0);
 
     CleanupStack::PopAndDestroy(ini);
     } // CSmsStoreRead::ReadConfigurableSmsSettingsL
@@ -214,7 +211,7 @@
  */
 void CSmsStoreRead::Start( TRequestStatus& aStatus, TInt aStoreIndex )
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_START_1, "CSmsStoreRead::Start()");
+	LOGSMSPROT1("CSmsStoreRead::Start()");
 
 	iState = ESmsStoreReadGettingStoreInfo;
 	// Initialises current slot index
@@ -253,7 +250,7 @@
  */
 void CSmsStoreRead::DoRunL()
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_DORUNL_1, "CSmsStoreRead::DoRunL [iStatus=%d]", iStatus.Int() );
+	LOGSMSPROT2("CSmsStoreRead::DoRunL [iStatus=%d]", iStatus.Int() );
 
 	TInt status = iStatus.Int();
 
@@ -318,9 +315,7 @@
 				{
 				// Add current message to the list
 				iMobilePhoneGsmSmsList->AddEntryL( iSmsEntry );
-#if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_DEBUG)
-                LogSmsIfSmsEntry(_L8("SMSENTRY: "), iSmsEntry);
-#endif
+				LOGSMSIFSMSENTRY(_L8("SMSENTRY: "), iSmsEntry);
 				iStoreInfo.iUsedEntries--;
 				}
 			// Reads next single message from the store
@@ -366,7 +361,7 @@
  */
 void CSmsStoreRead::ReadNextSlotL()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_READNEXTSLOTL_1, "CSmsStoreRead::ReadNextSlotL()");
+	LOGSMSPROT1("CSmsStoreRead::ReadNextSlotL()");
 
 	//Increments current slot index
 	iCurrentSlotIndex++;
@@ -392,7 +387,7 @@
  */
 void CSmsStoreRead::ProcessPduL()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_PROCESSPDUL_1, "CSmsStoreRead::ProcessPduL()");
+	LOGSMSPROT1("CSmsStoreRead::ProcessPduL()");
 
 	// Increments slot index
 	for ( iCurrentSlotIndex = 0; iCurrentSlotIndex < iMobilePhoneGsmSmsList->Enumerate(); iCurrentSlotIndex++ )
@@ -421,7 +416,7 @@
         // but in this case none of the messages have been passed
         // to the client, this has been fixed here
 		TRAPD(ret, pduProcessor->DecodeAndProcessPDUL(iSlot, ETrue));
-		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_PROCESSPDUL_2, "CSmsStoreRead::ProcessPduL(): DecodeAndProcessPDUL() returned %d", ret);
+		LOGSMSPROT2("CSmsStoreRead::ProcessPduL(): DecodeAndProcessPDUL() returned %d", ret);
 
 		if (ret == KErrNone)
 			{
@@ -467,7 +462,7 @@
  */
 void CSmsStoreRead::DoCancel()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_DOCANCEL_1, "CSmsStoreRead::DoCancel()");
+	LOGSMSPROT1("CSmsStoreRead::DoCancel()");
 
 	TimedSetActiveCancel();
 
@@ -527,7 +522,7 @@
  */
 void CSmsStoreRead::Complete(TInt aStatus)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSSTOREREAD_COMPLETE_1, "CSmsStoreRead::Complete()");
+	LOGSMSPROT1("CSmsStoreRead::Complete()");
 
 	__ASSERT_DEBUG(iState != ESmsStoreReadIdle, SmspPanic(KSmspPanicUnexpectedState));
 
@@ -588,7 +583,7 @@
 												  TInt aPriority,
 												  CSmsMonitorDiskSpace& aSmsMonitorDiskSpace )
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPHONEENUMERATION_NEWL_1, "CSmsPhoneEnumeration::NewL()");
+	LOGSMSPROT1("CSmsPhoneEnumeration::NewL()");
 
 	CSmsPhoneEnumeration* smsPhoneEnumeration =
 		new ( ELeave ) CSmsPhoneEnumeration( aSmsComm,
@@ -643,7 +638,7 @@
  */
 void CSmsPhoneEnumeration::Start()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPHONEENUMERATION_START_1, "CSmsPhoneEnumeration::Start()");
+	LOGSMSPROT1("CSmsPhoneEnumeration::Start()");
 
 	iState = ESmsPhoneEnumerationInitializing;
 	iCurrentStore = 0;
@@ -673,7 +668,7 @@
  */
 void CSmsPhoneEnumeration::DoRunL()
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPHONEENUMERATION_DORUNL_1, "CSmsPhoneEnumeration::RunL [iStatus=%d], [iState=%d]", iStatus.Int(), iState );
+	LOGSMSPROT3("CSmsPhoneEnumeration::RunL [iStatus=%d], [iState=%d]", iStatus.Int(), iState );
 
     switch (iState)
 		{
@@ -721,7 +716,7 @@
 
 void CSmsPhoneEnumeration::DoCancel()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPHONEENUMERATION_DOCANCEL_1, "CSmsPhoneEnumeration::DoCancel()");
+	LOGSMSPROT1("CSmsPhoneEnumeration::DoCancel()");
 
 	TimedSetActiveCancel();
 
@@ -767,7 +762,7 @@
  */
 void CSmsPhoneEnumeration::ConstructL(CFacadeSmsReassemblyStore& aReassemblyStore,CSmsSegmentationStore& aSegmentationStore,CSmsMonitorDiskSpace& aSmsMonitorDiskSpace)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPHONEENUMERATION_CONSTRUCTL_1, "CSmsPhoneEnumeration::ConstructL()");
+	LOGSMSPROT1("CSmsPhoneEnumeration::ConstructL()");
 
 	iSmsStoreRead = CSmsStoreRead::NewL(iSmsComm, iSmsSettings, iSmsMessaging, aReassemblyStore, aSegmentationStore, Priority(), aSmsMonitorDiskSpace);
 	ConstructTimeoutL();
@@ -776,7 +771,7 @@
 
 void CSmsPhoneEnumeration::Complete(TInt aStatus)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPHONEENUMERATION_COMPLETE_1, "CSmsPhoneEnumeration::Complete [aStatus=%d]", aStatus);
+	LOGSMSPROT2("CSmsPhoneEnumeration::Complete [aStatus=%d]", aStatus);
 
 	//
 	// Call the base function to perform the actual complete...
@@ -808,7 +803,7 @@
 										  CSmsSegmentationStore& aSegmentationStore
 										  )
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_NEWL_1, "CSmsMessageWrite::NewL()");
+	LOGSMSPROT1("CSmsMessageWrite::NewL()");
 
 	CSmsMessageWrite* smsMessageWrite = new (ELeave) CSmsMessageWrite(aSmsComm, aSmsSettings,
 																	  aGsmPhone,
@@ -825,7 +820,7 @@
  */
 CSmsMessageWrite::~CSmsMessageWrite()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_DTOR_1, "CSmsMessageWrite::~CSmsMessageWrite()");
+	LOGSMSPROT1("CSmsMessageWrite::~CSmsMessageWrite()");
 
 	Cancel();
 	iSmsStorage.Close();
@@ -844,7 +839,7 @@
 
 
 	iSmsMessage = aSmsMessage;
-    OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_START_1, "CSmsMessageWrite::Start  Storage=[%d]   Type=[%d]", iSmsMessage->Storage(), iSmsMessage->Type());
+    LOGSMSPROT3("CSmsMessageWrite::Start  Storage=[%d]   Type=[%d]", iSmsMessage->Storage(), iSmsMessage->Type());
 	iCurrentStore = 0;
 	iStoreInfo.iName = KNullDesC;
 
@@ -915,7 +910,7 @@
 
 void CSmsMessageWrite::DoRunL()
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_DORUNL_1, "CSmsMessageWrite::DoRunL [iStatus=%d iState=%d]", iStatus.Int() , iState);
+	LOGSMSPROT3("CSmsMessageWrite::DoRunL [iStatus=%d iState=%d]", iStatus.Int() , iState);
 
 	switch (iState)
 		{
@@ -942,7 +937,7 @@
 					{
 					if ((iStoreInfo.iCaps & RMobilePhoneStore::KCapsWriteAccess) == 0)
 						{
-                        OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_DORUNL_2, "CSmsMessageWrite::DoRunL left with KErrNotSuported [iState=%d]", iState);
+                        LOGSMSPROT2("CSmsMessageWrite::DoRunL left with KErrNotSuported [iState=%d]", iState);
 						User::Leave(KErrNotSupported);
 						}
 
@@ -960,7 +955,7 @@
 						}
 					else
 						{
-                        OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_DORUNL_3, "CSmsMessageWrite::DoRunL left with KErrNotFound [iState=%d]", iState);
+                        LOGSMSPROT2("CSmsMessageWrite::DoRunL left with KErrNotFound [iState=%d]", iState);            
 						User::Leave(KErrNotFound);
 						}
 					}
@@ -1004,7 +999,7 @@
 
 void CSmsMessageWrite::DoCancel()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_DOCANCEL_1, "CSmsMessageWrite::DoCancel()");
+	LOGSMSPROT1("CSmsMessageWrite::DoCancel()");
 
 	TimedSetActiveCancel();
 
@@ -1063,14 +1058,14 @@
 	iSegmentationStore(aSegmentationStore),
 	iSmsArray(8)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_CTOR_1, "CSmsMessageWrite::CSmsMessageWrite()");
+	LOGSMSPROT1("CSmsMessageWrite::CSmsMessageWrite()");
 
 	} // CSmsMessageWrite::CSmsMessageWrite
 
 
 void CSmsMessageWrite::ConstructL()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_CONSTRUCTL_1, "CSmsMessageWrite::ConstructL()");
+	LOGSMSPROT1("CSmsMessageWrite::ConstructL()");
 
 	ConstructTimeoutL();
 	} // CSmsMessageWrite::ConstructL
@@ -1078,7 +1073,7 @@
 
 void CSmsMessageWrite::SegmentMessageL()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_SEGMENTMESSAGEL_1, "CSmsMessageWrite::SegmentMessageL()");
+	LOGSMSPROT1("CSmsMessageWrite::SegmentMessageL()");
 
 	if (iStoreInfo.iTotalEntries == iStoreInfo.iUsedEntries)
 		{
@@ -1122,7 +1117,7 @@
 
 void CSmsMessageWrite::WriteNextSlot()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_WRITENEXTSLOT_1, "CSmsMessageWrite::WriteNextSlot()");
+	LOGSMSPROT1("CSmsMessageWrite::WriteNextSlot()");
 
 	if (iSmsArray.Count()>0)
 		{
@@ -1146,7 +1141,7 @@
 
 void CSmsMessageWrite::Complete(TInt aStatus)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGEWRITE_COMPLETE_1, "CSmsMessageWrite::Complete [aStatus=%d]", aStatus);
+	LOGSMSPROT2("CSmsMessageWrite::Complete [aStatus=%d]", aStatus);
 
 	__ASSERT_DEBUG(iState != ESmsMessageWriteIdle, SmspPanic(KSmspPanicUnexpectedState));