pushmtm/MtmUiSrc/PushMessageInfoDialog.cpp
branchRCL_3
changeset 35 5c11946e75b3
parent 25 92a061761a7b
--- a/pushmtm/MtmUiSrc/PushMessageInfoDialog.cpp	Mon Mar 15 12:40:52 2010 +0200
+++ b/pushmtm/MtmUiSrc/PushMessageInfoDialog.cpp	Wed Mar 31 21:35:49 2010 +0300
@@ -39,9 +39,9 @@
 #include <f32file.h>
 #include <AknUtils.h>
 #include <AknBidiTextUtils.h>
-
+#include "PushMtmPrivateCRKeys.h"
+#include <centralrepository.h> 
 // CONSTANTS
-
 LOCAL_D const TInt KNoResource = 0;
 LOCAL_D const TInt KArrayGranularity = 16;
 LOCAL_D const TReal KReal1024 = 1024.0;
@@ -91,12 +91,17 @@
 void CPushMessageInfoDialog::ConstructL( CMsvSession& aMsvSession, TMsvId aId )
     {
     PUSHLOG_ENTERFN("CPushMessageInfoDialog::ConstructL");
-
     __ASSERT_DEBUG( !iListBox &&
                     !iListBoxModel,
                     UiPanic( EPushMtmUiPanAlreadyInitialized ) );
 
     FeatureManager::InitializeLibL();
+    
+    CRepository* PushSL = CRepository::NewL( KCRUidPushMtm );
+    CleanupStack::PushL( PushSL );
+    User::LeaveIfError( PushSL->Get( KPushMtmServiceEnabled , iPushSLEnabled ) );
+    PUSHLOG_WRITE_FORMAT(" iPushSLEnabled: <%d>",iPushSLEnabled);
+    CleanupStack::PopAndDestroy( PushSL ); 
 
     // Add resource file.
     TParse* fileParser = new (ELeave) TParse;
@@ -299,13 +304,11 @@
         msg = CSIPushMsgEntry::NewL();
         PUSHLOG_WRITE(" SI");
         }
-#ifdef __SERIES60_PUSH_SL
-    else if ( bioType == KUidWapPushMsgSL.iUid )
+    else if(iPushSLEnabled && bioType == KUidWapPushMsgSL.iUid)
         {
         msg = CSLPushMsgEntry::NewL();
         PUSHLOG_WRITE(" SL");
         }
-#endif // __SERIES60_PUSH_SL
 #ifdef __SERIES60_PUSH_SP
     else if ( bioType == KUidWapPushMsgUnknown.iUid )
         {
@@ -365,8 +368,7 @@
             CleanupStack::PopAndDestroy( convertedUrl );
             }
         }
-#ifdef __SERIES60_PUSH_SL
-    else if ( msg->PushMsgType() == KUidWapPushMsgSL.iUid )
+    else if ( iPushSLEnabled && msg->PushMsgType() == KUidWapPushMsgSL.iUid )
         {
         CSLPushMsgEntry* sl = STATIC_CAST( CSLPushMsgEntry*, msg );
         const TPtrC url = sl->Url();
@@ -383,7 +385,6 @@
             CleanupStack::PopAndDestroy( convertedUrl );
             }
         }
-#endif // __SERIES60_PUSH_SL
 
     // ************************************************************************
     // Information item: Message body/text (SI specific).
@@ -496,13 +497,11 @@
         CSIPushMsgEntry* si = STATIC_CAST( CSIPushMsgEntry*, msg );
         messageSize = (TReal)si->Text().Size() / KReal1024;
         }
-#ifdef __SERIES60_PUSH_SL
-    else if ( msg->PushMsgType() == KUidWapPushMsgSL.iUid )
+    else if ( iPushSLEnabled && msg->PushMsgType() == KUidWapPushMsgSL.iUid )
         {
         CSLPushMsgEntry* sl = STATIC_CAST( CSLPushMsgEntry*, msg );
         messageSize = (TReal)sl->Url().Size() / KReal1024;
         }
-#endif // __SERIES60_PUSH_SL
 #ifdef __SERIES60_PUSH_SP
     else if ( msg->PushMsgType() == KUidWapPushMsgUnknown.iUid )
         {