webengine/wrtharvester/src/wrtharvester.cpp
branchRCL_3
changeset 62 c711bdda59f4
parent 59 1f3c3f2f5b0a
child 71 4bd5176e1bc8
--- a/webengine/wrtharvester/src/wrtharvester.cpp	Mon Mar 15 12:44:50 2010 +0200
+++ b/webengine/wrtharvester/src/wrtharvester.cpp	Wed Mar 31 23:16:40 2010 +0300
@@ -230,11 +230,10 @@
     iWidgetUIListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetUIState );
     iWidgetRegListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetRegAltered );
     iWidgetSystemShutdownListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetSystemShutdown );
+    iMsModeListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetMassStorageMode );
     
     User::LeaveIfError( iFs.Connect() );
-    iWidgetUsbListener = CWrtUsbHandler::NewL( this, iFs );
     
-    iWidgetUsbListener->Start();
     SetMSMode(0);
     
     iCanAccessRegistry = ETrue;    
@@ -286,11 +285,12 @@
     iObservers.ResetAll();
     iWidgetInfo.ResetAll();
     iWidgetStateArray.ResetAll();
+    
     delete iWidgetUIListener;
-    delete iWidgetRegListener;
-    delete iWidgetMMCListener;
-    delete iWidgetUsbListener;
+    delete iWidgetRegListener;    
+    delete iMsModeListener;    
     delete iWidgetSystemShutdownListener;
+    
     if(iAsyncCallBack)
         {
         iAsyncCallBack->Cancel();       
@@ -327,12 +327,11 @@
     	{
     	return ;
     	}
-    if( IsInMSMode() == 1 && aTrigger == KDeActive)
+    if( IsInMSMode() == 1 )
       {
-      RemovePublisherAndObserverL(aContentId);
-      
-      if(!iSystemShutdown)
+      if( aTrigger == KDeActive && !iSystemShutdown )
           {
+          RemovePublisherAndObserverL(aContentId);
           RWidgetRegistryClientSession session;
           CleanupClosePushL( session );
           User::LeaveIfError( session.Connect() );
@@ -890,8 +889,11 @@
     RWidgetRegistryClientSession session;
     CleanupClosePushL( session );
     User::LeaveIfError( session.Connect() );
-    TBool preInstalled = *(session.GetWidgetPropertyValueL( aUid, EPreInstalled ) );
-    
+
+    CWidgetPropertyValue* property = session.GetWidgetPropertyValueL( aUid, EPreInstalled );
+    TBool preInstalled = property && *(property);
+    delete property;
+
     // Set blanket permission to true for pre-installed widgets
     if ( preInstalled )
         {
@@ -982,7 +984,11 @@
     RWidgetRegistryClientSession session;
     CleanupClosePushL( session );
     User::LeaveIfError( session.Connect() );
-    TBool networkAccess = *(session.GetWidgetPropertyValueL( aUid, EAllowNetworkAccess ) );
+
+    CWidgetPropertyValue* value = session.GetWidgetPropertyValueL( aUid, EAllowNetworkAccess );
+    TBool networkAccess = value && *(value);
+    delete value;
+
     CleanupStack::PopAndDestroy( &session );
     
     return networkAccess;