iaupdate/IAD/ui/src/iaupdateappui.cpp
branchRCL_3
changeset 34 741e5bba2bd1
parent 23 09e5ea190d07
child 40 f8cf9d484c15
--- a/iaupdate/IAD/ui/src/iaupdateappui.cpp	Tue Apr 27 16:46:15 2010 +0300
+++ b/iaupdate/IAD/ui/src/iaupdateappui.cpp	Tue May 11 16:20:28 2010 +0300
@@ -65,6 +65,7 @@
 #include "iaupdategloballockhandler.h"
 #include "iaupdatenodefilter.h"
 #include "iaupdateuitimer.h"
+#include "iaupdateagreement.h"
 #include "iaupdatedebug.h"
 
 
@@ -164,7 +165,8 @@
 // -----------------------------------------------------------------------------
 //
 void CIAUpdateAppUi::CheckUpdatesRequestL( MIAUpdateRequestObserver& aObserver,
-                                           CIAUpdateParameters* aFilterParams )
+                                           CIAUpdateParameters* aFilterParams,
+                                           TBool aForcedRefresh )
                                            
     {
     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateAppUi::CheckUpdatesRequestL() begin");
@@ -184,7 +186,8 @@
     iRequestObserver = &aObserver;
     iRequestType = IAUpdateUiDefines::ECheckUpdates; 
     iController->SetRequestType( iRequestType );
-    
+    IAUPDATE_TRACE_1("[IAUPDATE] CIAUpdateAppUi::CheckUpdatesRequestL() Forced refresh: %d", aForcedRefresh );
+    iController->SetForcedRefresh( aForcedRefresh ); 
     iController->CheckUpdatesDeferredL( aFilterParams, EFalse );
     
 	IAUPDATE_TRACE("[IAUPDATE] CIAUpdateAppUi::CheckUpdatesRequestL() end");
@@ -593,8 +596,11 @@
                     {
                     if ( iController->Filter()->FilterParams()->Refresh() )
                         {
-                        //from bgchecker, make it silent
-                        totalSilent = ETrue;
+                        if ( !iController->ForcedRefresh() )
+                            {
+                            //from bgchecker, make it silent
+                            totalSilent = ETrue;
+                            }
                         }
                     }
                 }
@@ -683,7 +689,16 @@
             {
         	ActivateLocalViewL( TUid::Uid( EIAUpdateMainViewId ) );
             }
- 
+        CIAUpdateAgreement* agreement = CIAUpdateAgreement::NewLC();
+        TBool agreementAccepted = agreement->AgreementAcceptedL();
+        if ( iController->ForcedRefresh() )    
+            {
+            if ( !agreementAccepted )
+                {
+                agreement->SetAgreementAcceptedL();
+                }
+            }
+        CleanupStack::PopAndDestroy( agreement );
         // By calling CIdle possible waiting dialog can be closed before
         // automatic check where a new dialog may be launched
         delete iIdleAutCheck;
@@ -974,13 +989,6 @@
                //the bgchecker will try again later after 1 month. 
                //The LEAVE will be catched up later and complete the request from background checker.
                User::LeaveIfError( KErrNotFound );
-               
-               //the following code will pop up dialog to ask from user, just for proto
-              /* connectionMethodId = 0;               
-               TIAUpdateConnectionMethod connectionMethod( 
-                   connectionMethodId, TIAUpdateConnectionMethod::EConnectionMethodTypeDefault );
-
-               iController->SetDefaultConnectionMethodL( connectionMethod );*/
                }