connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp
branchRCL_3
changeset 18 453dfc402455
parent 0 d0791faffa3f
--- a/connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp	Thu Jul 15 19:35:12 2010 +0300
+++ b/connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp	Thu Aug 19 10:44:03 2010 +0300
@@ -23,6 +23,7 @@
 #include "sconinstqueue.h"
 #include "sconbrqueue.h"
 #include "sconmetadata.h"
+#include "sconsynchandler.h"
 #include "debug.h"
 
 // ============================= MEMBER FUNCTIONS ===============================
@@ -88,6 +89,7 @@
         }
     CActiveScheduler::Add( iInstallerQueue );
     CActiveScheduler::Add( iBackupRestoreQueue );
+    iSyncHandler = CSconSyncHandler::NewL( iFs );
     TRACE_FUNC_EXIT;
     }
     
@@ -119,6 +121,12 @@
         iLatestReply = NULL;
         }
     
+    if ( iSyncHandler )
+        {
+        iSyncHandler->Cancel();
+        delete iSyncHandler;
+        iSyncHandler = NULL;
+        }
     iFs.Close();
     TRACE_FUNC_EXIT;
     }
@@ -260,6 +268,32 @@
     }
 
 // -----------------------------------------------------------------------------
+// CSConPCD::HandleGetSyncRequestL()
+// 
+// -----------------------------------------------------------------------------
+//
+void CSConPCD::HandleGetSyncRequestL( const TDesC8& aRequest, RWriteStream& aResult, TInt aMaxObjectSize )
+    {
+    TRACE_FUNC_ENTRY;
+    iSyncHandler->HandleGetSyncRequestL( aRequest, aResult, aMaxObjectSize );
+    
+    TRACE_FUNC_EXIT;
+    }
+
+// -----------------------------------------------------------------------------
+// CSConPCD::HandlePutSyncRequestL()
+// 
+// -----------------------------------------------------------------------------
+//
+void CSConPCD::HandlePutSyncRequestL( const TDesC8& aRequest, RReadStream& aResult )
+    {
+    TRACE_FUNC_ENTRY;
+    iSyncHandler->HandlePutSyncRequestL( aRequest, aResult );
+    
+    TRACE_FUNC_EXIT;
+    }
+
+// -----------------------------------------------------------------------------
 // CSConPCD::SupportedInstTaskL( CSConTask* aTask )
 // Fills a reply with predefined supported task -information
 // -----------------------------------------------------------------------------
@@ -421,16 +455,22 @@
         
     for ( TInt i = 0; i < installerReply->iTasks.Count(); i++ )
         {
-        mergeReply->iTasks.Append( installerReply->iTasks[i]->CopyAndFreeL() );
+        CSConTaskReply* temp = installerReply->iTasks[i]->CopyAndFreeL();
+        CleanupStack::PushL( temp );
+        mergeReply->iTasks.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
     
     // installer replys are copied to mergereply, delete installerReply
     CleanupStack::PopAndDestroy( installerReply );
     
     // do same for br reply
-    for ( TInt j = 0; j < brReply->iTasks.Count(); j++ )
+    for ( TInt i = 0; i < brReply->iTasks.Count(); i++ )
         {
-        mergeReply->iTasks.Append( brReply->iTasks[j]->CopyAndFreeL() );
+        CSConTaskReply* temp = brReply->iTasks[i]->CopyAndFreeL();
+        CleanupStack::PushL( temp );
+        mergeReply->iTasks.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
     
     CleanupStack::PopAndDestroy( brReply );