clientprovisioning/cpqtsp/src/CWPSaver.cpp
changeset 42 aa33c2cb9a50
parent 30 d3981f4fe6a4
child 62 03849bd79877
--- a/clientprovisioning/cpqtsp/src/CWPSaver.cpp	Wed Jun 23 18:03:02 2010 +0300
+++ b/clientprovisioning/cpqtsp/src/CWPSaver.cpp	Tue Jul 06 14:06:19 2010 +0300
@@ -3,7 +3,7 @@
 *  Name        : CWPSaver.cpp
 *  Part of     : Provisioning / ProvisioningBC
 *  Description : Helper class for saving Provisioning settings. Provides a progress note.
-*  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: 2 % << Don't touch! Updated by Synergy at check-out.
 *
 *  Copyright © 2002-2006 Nokia.  All rights reserved.
 *  This material, including documentation and any related computer
@@ -17,13 +17,10 @@
 */
 
 // INCLUDE FILES
-#include <aknquerydialog.h>
-#include <eikprogi.h>
-//#include <ProvisioningBC.rsg>
 #include <commdb.h>
 #include <CWPEngine.h>
 #include <CWPAdapter.h>
-#include <ActiveFavouritesDbNotifier.h>
+
 #include "CWPSaver.h"
 #include <HbProgressDialog>
 #include <HbAction>
@@ -56,24 +53,9 @@
     {
     // Assume ownership of this.
     CleanupStack::PushL( this );
-
-    iApDbNotifier = CActiveApDb::NewL( EDatabaseTypeIAP );
-    iApDbNotifier->AddObserverL( this );
-    
-    User::LeaveIfError( iSession.Connect() );
-    User::LeaveIfError( iBookmarkDb.Open( iSession, KBrowserBookmarks ) );
-    iFavouritesNotifier = 
-                new(ELeave) CActiveFavouritesDbNotifier( iBookmarkDb, *this );  
-
-    iFavouritesNotifier->Start();
-
-    iRetryTimer = CPeriodic::NewL( EPriorityStandard );
     iProgress = new HbProgressDialog(HbProgressDialog::WaitDialog);
     iProgress->setText(hbTrId("txt_device_update_setlabel_saving_settings"));
-    //iProgress->setTextAlignment(Qt::AlignCenter);
     iProgress->clearActions();   
-    //iProgress->setPrimaryAction(new HbAction(""));
-    //iProgress->setSecondaryAction(new HbAction(""));
     iProgress->show();
 
  }
@@ -107,19 +89,7 @@
 CWPSaver::~CWPSaver()
     {
     Cancel();
-
-    delete iApDbNotifier;
-
-    if( iFavouritesNotifier )
-        {
-        iFavouritesNotifier->Cancel();
-        delete iFavouritesNotifier;
-        }
-
-    iBookmarkDb.Close();
-    iSession.Close();
-    delete iRetryTimer;
-    }
+  }
 
 // ----------------------------------------------------------------------------
 // CWPSaver::DoCancel
@@ -149,20 +119,7 @@
         {
         TRAP(err, QT_TRYCATCH_LEAVING( iEngine.SaveL( iCurrentItem ) )); 
         }
-    // If CommsDB or BookmarkDB are locked, schedule a retry
-    if( err == EWPCommsDBLocked || err == KErrLocked)
-        {
-        iWaitCommsDb = ETrue;
-        DelayedCompleteRequestL();
-        return;
-        }
-    else if( err == EWPBookmarksLocked )
-        {
-        iWaitFavourites = ETrue;
-        DelayedCompleteRequestL();
-        return;
-        }
-    else if( err != KErrNone )
+    if( err != KErrNone )
         {
         // For all other errors, pass them through.
         iValue = iEngine.SummaryText(iCurrentItem);
@@ -205,20 +162,6 @@
     }
 
 // ----------------------------------------------------------------------------
-// CWPSaver::DialogDismissedL
-// ----------------------------------------------------------------------------
-//
-void CWPSaver::DialogDismissedL( TInt aButtonId )
-    {
-    if( aButtonId < 0 )
-        {
-        iResult = KErrCancel;
-        }
-
-    iWait.AsyncStop();
-    }
-
-// ----------------------------------------------------------------------------
 // CWPSaver::CompleteRequest
 // ----------------------------------------------------------------------------
 //
@@ -227,86 +170,10 @@
     // Schedule an immediate complete. Make sure that there
     // is no timer alive first
     Cancel();
-    iRetryTimer->Cancel();
+    //iRetryTimer->Cancel();
 
     SetActive();
     TRequestStatus* sp = &iStatus;
     User::RequestComplete( sp, KErrNone );
     }
 
-// ----------------------------------------------------------------------------
-// CWPSaver::DelayedCompleteRequestL
-// ----------------------------------------------------------------------------
-//
-void CWPSaver::DelayedCompleteRequestL()
-    {
-    if( iRetryCount < KRetryCount )
-        {
-        // Schedule a delayed complete. Cancel first in case
-        // an immediate request was scheduled.
-        iRetryTimer->Cancel();
-        iRetryTimer->Start( KMaxWaitTime, KMaxTInt32, TCallBack( Timeout, this ) );
-        iRetryCount++;
-        }
-    else
-        {
-        User::Leave( KErrTimedOut );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CWPSaver::Retry
-// ----------------------------------------------------------------------------
-//
-void CWPSaver::Retry()
-    {
-    // Immediate retry. Mark that we're not waiting
-    // for an event and complete request.
-    iWaitCommsDb = EFalse;
-    iWaitFavourites = EFalse;
-    CompleteRequest();
-    }
-
-// ----------------------------------------------------------------------------
-// CWPSaver::Timeout
-// ----------------------------------------------------------------------------
-//
-TInt CWPSaver::Timeout(TAny* aSelf)
-    {
-    // There was a time-out. Retry saving even though we
-    // didn't get a notify from database.
-    CWPSaver* self = static_cast<CWPSaver*>( aSelf );
-    self->Retry();
-
-    return KErrNone;
-    }
-
-// ----------------------------------------------------------------------------
-// CWPSaver::HandleApDbEventL
-// ----------------------------------------------------------------------------
-//
-void CWPSaver::HandleApDbEventL( TEvent aEvent )
-    {
-    // We received an event from CommsDB. Retry if we're
-    // waiting for it.
-    if( iWaitCommsDb && aEvent == EDbAvailable )
-        {
-        Retry();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CWPSaver::HandleFavouritesDbEventL
-// ----------------------------------------------------------------------------
-//
-void CWPSaver::HandleFavouritesDbEventL( RDbNotifier::TEvent /*aEvent*/ )
-    {
-    // We received an event from BookmarkDB. Retry if we're
-    // waiting for it.
-    if( iWaitFavourites )
-        {
-        Retry();
-        }
-    }
-
-//  End of File