iaupdate/IAD/firmwareupdate/src/iaupdatefwsyncappengine.cpp
changeset 77 d1838696558c
parent 0 ba25891c3a9e
--- a/iaupdate/IAD/firmwareupdate/src/iaupdatefwsyncappengine.cpp	Tue Sep 28 14:48:39 2010 +0300
+++ b/iaupdate/IAD/firmwareupdate/src/iaupdatefwsyncappengine.cpp	Thu Oct 14 14:11:30 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -88,31 +88,17 @@
 	}
 
 // ------------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::DeleteProfileL
+// CIAUpdateFWSyncAppEngine::SetObserver
 // ------------------------------------------------------------------------------
 //
-void CIAUpdateFWSyncAppEngine::DeleteProfileL( TInt aProfileId )
+void CIAUpdateFWSyncAppEngine::SetObserver( MIAUpdateFWUpdateObserver* aObserver )
     {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::DeleteProfileL:" );
-    
-    delete iProfile;
-    iProfile = NULL;
-    iSyncMLSession.DeleteProfileL( aProfileId );
-	}
+    if ( iSyncHandler )
+        {
+        iSyncHandler->SetUpdateObserver( aObserver );
+        }
+    }
 
-// ------------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::CreateProfileL
-// ------------------------------------------------------------------------------
-//
-TInt CIAUpdateFWSyncAppEngine::CreateProfileL()
-    {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::CreateProfileL:" );
-    
-    delete iProfile;
-    iProfile = NULL;
-    iProfile = CIAUpdateFWSyncProfile::NewL( KIAUpdateUiUid, &iSyncMLSession );
-    return iProfile->CreateL();
-	}
 
 // ------------------------------------------------------------------------------
 // CIAUpdateFWSyncAppEngine::Profile
@@ -125,33 +111,6 @@
     return iProfile;
 	}
 	
-// ------------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::CreateCopyProfileL
-// ------------------------------------------------------------------------------
-//
-CIAUpdateFWSyncProfile* CIAUpdateFWSyncAppEngine::CreateCopyProfileL( TInt aProfileId )
-    {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::CreateCopyProfileL:" );
-    
-    delete iProfile;
-    iProfile = NULL;
-    iProfile = CIAUpdateFWSyncProfile::NewL( KIAUpdateUiUid, &iSyncMLSession );
-    
-    iProfile->CreateCopyL( aProfileId );
-    return iProfile;
-    }
-
-// -----------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::Session
-// -----------------------------------------------------------------------------
-//
-RSyncMLSession* CIAUpdateFWSyncAppEngine::Session()
-	{
-	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::Session:" );
-	
-	return &iSyncMLSession;
-	}
-
 // -----------------------------------------------------------------------------
 // CIAUpdateFWSyncAppEngine::OpenL
 // -----------------------------------------------------------------------------
@@ -163,18 +122,18 @@
 	
     delete iProfile;
     iProfile = NULL;
-    iProfile = CIAUpdateFWSyncProfile::NewL( KIAUpdateUiUid, &iSyncMLSession );
+    iProfile = CIAUpdateFWSyncProfile::NewL( &iSyncMLSession );
    	iProfile->OpenL( aProfileId, aOpenMode );
    	return iProfile;
     }
 
 // -----------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::Close
+// CIAUpdateFWSyncAppEngine::CloseProfile
 // -----------------------------------------------------------------------------
 //
 void CIAUpdateFWSyncAppEngine::CloseProfile()
     {
-    FLOG(  "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::Close:" );
+    FLOG(  "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::CloseProfile:" );
 
     delete iProfile;
     iProfile = NULL;
@@ -196,118 +155,7 @@
                                 aConnectionBearer,
                                 aUseFotaProgressNote);
     }
-    
-// -----------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::SynchronizeL
-// -----------------------------------------------------------------------------
-//
-void CIAUpdateFWSyncAppEngine::SynchronizeL( TDesC& aServerName,
-                                         TInt aProfileId,
-                                         TInt aJobId,
-                                         TInt aConnectionBearer,
-                                         const TBool aUseFotaProgressNote )
-    {
-   	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::SynchronizeL:" );
 
-    iSyncHandler->SynchronizeL( aServerName, 
-                                aProfileId, 
-                                aJobId, 
-                                aConnectionBearer,
-                                aUseFotaProgressNote );
-    }
-
-    
-// -----------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::ServerIdFoundL
-// -----------------------------------------------------------------------------
-//    
-TBool CIAUpdateFWSyncAppEngine::ServerIdFoundL( const TDesC& aServerId,
-                                            const TInt aProfileId )
-    {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::ServerIdFoundL:" );
-    
-	RArray<TSmlProfileId> arr;
-    iSyncMLSession.ListProfilesL( arr, ESmlDevMan );
-    TBool ret = EFalse;
-   	CleanupClosePushL(arr);
-   	
-	for ( TInt index = 0; index < arr.Count(); index++ )
-		{
-	    TRAPD( error, OpenProfileL( arr[index], ESmlOpenRead ) );
-	    if ( error == KErrNone )
-	        {
-	        if ( aProfileId != Profile()->ProfileId() )
-	            {	        
-    	        TBuf<KNSmlMaxItemLength> buf;
-    	        Profile()->GetServerId( buf );
-    	        if ( buf.Compare( aServerId ) == 0 )
-    	            {
-    	            FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::ServerIdFoundL: Match" );
-                    ret = ETrue;
-                    CloseProfile();
-                    break;
-                    }
-	            }
-		    CloseProfile();
-	        }
-		}
-    CleanupStack::PopAndDestroy( &arr );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-//  CIAUpdateFWSyncAppEngine::Compare
-// -----------------------------------------------------------------------------
-//
-TInt CIAUpdateFWSyncAppEngine::Compare( const TDesC& aLeft, const TDesC& aRight )
-	{
-	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::Compare:" );
-	
-	// Empty Name() is always greater than non-empty Name()
-    if (aLeft.Length() == 0 && aRight.Length() == 0)
-        {
-        return 0;
-        }
-    if (aLeft.Length() == 0)
-        {
-        return 1;
-        }
-    if (aRight.Length() == 0)
-        {
-        return -1;
-        }
-
-    // None of the Name()s was empty, use TDesC::CompareC to do the comparison.
-    // This is from cntmodel.
-    TCollationMethod collateMethod;
-    // get the standard method
-	collateMethod = *Mem::CollationMethodByIndex(0);
-    // dont ignore punctuation and spaces
-	collateMethod.iFlags |= TCollationMethod::EIgnoreNone; 
-	TInt comparison( aLeft.CompareC(aRight, 3, &collateMethod) );
-	return comparison;	
-	}
-	
-// -----------------------------------------------------------------------------
-//  CIAUpdateFWSyncAppEngine::SyncRunning
-// -----------------------------------------------------------------------------
-//
-TBool CIAUpdateFWSyncAppEngine::SyncRunning()
-    {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::SyncRunning:" );
-    
-    return iSyncHandler->SyncRunning();
-    }
-
-// -----------------------------------------------------------------------------
-//  CIAUpdateFWSyncAppEngine::CancelSyncL
-// -----------------------------------------------------------------------------
-//
-void CIAUpdateFWSyncAppEngine::CancelSyncL()
-    {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::CancelSyncL()" );
-    iSyncHandler->CancelSynchronizeL();
-    }
 
 // -----------------------------------------------------------------------------
 //  CIAUpdateFWSyncAppEngine::SyncCompleted
@@ -316,29 +164,8 @@
 void CIAUpdateFWSyncAppEngine::SyncCompleted( TNSmlStatus /*aStatus*/ )
     {
     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::SyncCompleted:" );
-    
-    /*if( iSyncObserver )
-        {
-        FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::SyncCompleted: inform observer" );
-        
-        iSyncObserver->SyncComplete( aStatus );
-        }    */
     }
     
-// -----------------------------------------------------------------------------
-// CIAUpdateFWSyncAppEngine::RequestSyncStatus
-// -----------------------------------------------------------------------------
-//	
-/*void CIAUpdateFWSyncAppEngine::RequestSyncStatus( 
-                                           MNSmlDMSyncObserver* aSyncObserver )
-    {
-    FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::RequestSyncStatus:" );
-    
-    if( aSyncObserver )
-        {
-        FLOG( "[IAUPDATEFW] CIAUpdateFWSyncAppEngine::RequestSyncStatus: added observer" );
-        iSyncObserver = aSyncObserver;
-        }
-    }*/
+
 
 // End of File