apengine/apsettingshandlerui/src/apsettingsdeleteoperation.cpp
changeset 0 5a93021fdf25
child 8 2e6c4614c58e
child 23 7ec726f93df1
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of class CApSettingsDeleteOperation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <ApDataHandler.h>
       
    21 #include <ApUtils.h>
       
    22 #include <ActiveApDb.h>
       
    23 #include <ApSettingsHandlerCommons.h>
       
    24 #include <VpnApEngine.h>
       
    25 #include <AknWaitDialog.h>
       
    26 #include <AknProgressDialog.h>
       
    27 #include <cdbcols.h>
       
    28 #include <ErrorUI.h>
       
    29 #include "Apsettingsdeleteoperation.h"
       
    30 
       
    31 #include <WEPSecuritySettingsUI.h>
       
    32 #include <WPASecuritySettingsUI.h>
       
    33 #include <ApAccessPointItem.h>
       
    34 
       
    35 // Following includes are needed only for the test
       
    36 // when ALL APs are deleted (checking delays, etc.)
       
    37 // For testing purpose only, to make process time longer.
       
    38 //  TEST STARTS
       
    39 #include <ActiveApDb.h>
       
    40 #include <ApSelect.h>
       
    41 #include <ApListItem.h>
       
    42 #include "ApSelectorListBoxModel.h"
       
    43 #include "ApSettingsHandlerLogger.h"
       
    44 
       
    45 #include <ApSetUI.rsg>
       
    46 //  TEST ENDS
       
    47 
       
    48 
       
    49 // Stack size of the receiver thread.
       
    50 LOCAL_C const TInt KDeleteThreadStackSize = 40960;
       
    51 
       
    52 // Name of the receiver thread.
       
    53 _LIT( KDeleteThreadName, "Access Point Settings UI Delete Operation" );
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------
       
    57 // CApSettingsDeleteOperation::NewL
       
    58 // ---------------------------------------------------------
       
    59 //
       
    60 CApSettingsDeleteOperation* CApSettingsDeleteOperation::NewL(
       
    61                                 TInt aNoteControlId,
       
    62                                 TInt aResourceID,
       
    63                                 TUint32 aUid,
       
    64                                 const TDesC& aNoteText
       
    65                                 )
       
    66     {
       
    67     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::NewL")
       
    68     
       
    69     CApSettingsDeleteOperation* db =
       
    70             new ( ELeave ) CApSettingsDeleteOperation(
       
    71                             aNoteControlId,
       
    72                             aResourceID,
       
    73                             aUid
       
    74                             );
       
    75     CleanupStack::PushL( db );
       
    76     db->ConstructL( aNoteText );
       
    77     CleanupStack::Pop();
       
    78     
       
    79     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::NewL")
       
    80     return db;
       
    81     }
       
    82 
       
    83 
       
    84 // ---------------------------------------------------------
       
    85 // CApSettingsDeleteOperation::ConstructL
       
    86 // ---------------------------------------------------------
       
    87 //
       
    88 void CApSettingsDeleteOperation::ConstructL( const TDesC& aNoteText )
       
    89     {
       
    90     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::ConstructL")
       
    91     
       
    92     iErrorUi = CErrorUI::NewL( *CCoeEnv::Static() );
       
    93     iNoteText = aNoteText.AllocL();
       
    94     
       
    95     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::ConstructL")
       
    96     }
       
    97 
       
    98 
       
    99 // ---------------------------------------------------------
       
   100 // CApSettingsDeleteOperation::CApSettingsDeleteOperation
       
   101 // ---------------------------------------------------------
       
   102 //
       
   103 CApSettingsDeleteOperation::CApSettingsDeleteOperation(
       
   104                                  TInt aNoteControlId,
       
   105                                  TInt aResourceID,
       
   106                                  TUint32 aUid
       
   107                                  )
       
   108 : CActive( EPriorityLow ),
       
   109   iNoteControlId( aNoteControlId ),
       
   110   iResourceID( aResourceID ),
       
   111   iUid( aUid )
       
   112     {
       
   113     CActiveScheduler::Add(this);
       
   114     APSETUILOGGER_WRITE( EModel,"Thread added to scheduler");
       
   115     }
       
   116 
       
   117 
       
   118 // ---------------------------------------------------------
       
   119 // CApSettingsDeleteOperation::~CApSettingsDeleteOperation
       
   120 // ---------------------------------------------------------
       
   121 //
       
   122 CApSettingsDeleteOperation::~CApSettingsDeleteOperation()
       
   123     {
       
   124     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::~CApSettingsDeleteOperation")
       
   125     
       
   126     if(iDeleteOperation.Handle() != 0)
       
   127         {
       
   128         // wait for deletion to finish
       
   129         TRequestStatus status;          
       
   130         iDeleteOperation.Logon(status);
       
   131         User::WaitForRequest(status);
       
   132         
       
   133         iDeleteOperation.Close();
       
   134         }
       
   135         
       
   136     Cancel();                        
       
   137     
       
   138     delete iWaitDialog;
       
   139 
       
   140     delete iNoteText;
       
   141     delete iErrorUi;
       
   142     
       
   143     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::~CApSettingsDeleteOperation")
       
   144     }
       
   145 
       
   146 
       
   147 
       
   148 
       
   149 // ---------------------------------------------------------
       
   150 // CApSettingsDeleteOperation::RunL
       
   151 // ---------------------------------------------------------
       
   152 //
       
   153 void CApSettingsDeleteOperation::RunL()
       
   154     {
       
   155     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::RunL")
       
   156     
       
   157     switch ( iState )
       
   158         {
       
   159         case EProcOnDialogOn:
       
   160             { // two chances :
       
   161             // 1. Process finished normally
       
   162             // 2. Process leaved with error
       
   163             iState = EProcOffDialogOn;
       
   164             if ( iWaitDialog )
       
   165                 {
       
   166                 iWaitDialog->ProcessFinishedL();
       
   167                 }
       
   168             if ( iStatus.Int() != KErrNone )
       
   169                 {
       
   170                 // some error has occured
       
   171                 iErr = iStatus.Int();
       
   172                 }
       
   173             Next();
       
   174             break;
       
   175             }
       
   176         case EProcOffDialogOn:
       
   177             {
       
   178             // now we wait for the dialog to be dismissed
       
   179             // just to be able to delete it
       
   180             // stays in this state as long as DialogDismissedL()
       
   181             // is not called, it will move it out into
       
   182             // EProcOffDialogOff and it also deletes
       
   183             Next();
       
   184             break;
       
   185             }
       
   186         case EProcOnDialogOff:
       
   187             { // this can't be, as dialog MUST stay as long as operation...
       
   188             iState = EProcOffDialogOff;
       
   189             Next();
       
   190             break;
       
   191             }
       
   192         case EProcOffDialogOff:
       
   193             { // now we can safely delete the dialog
       
   194             if ( iWaitDialog )
       
   195                 {
       
   196                 delete iWaitDialog;
       
   197                 }
       
   198             if ( iErr != KErrNone )
       
   199                 {
       
   200                 // some error has occured
       
   201                 iErrorUi->ShowGlobalErrorNoteL( iErr );
       
   202                 }
       
   203             iDeleteOperation.Kill( iErr );
       
   204             iDeleteOperation.Close();            
       
   205 //            delete this;
       
   206             break;
       
   207             }
       
   208         default:
       
   209             {
       
   210             __ASSERT_DEBUG( EFalse, Panic( EInvalidState ) );
       
   211             break;
       
   212             }
       
   213         }
       
   214     
       
   215     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::RunL")
       
   216     }
       
   217 
       
   218 
       
   219 // ---------------------------------------------------------
       
   220 // CApSettingsDeleteOperation::DoCancel
       
   221 // ---------------------------------------------------------
       
   222 //
       
   223 void CApSettingsDeleteOperation::DoCancel()
       
   224     { // must be here as it is pure virtual in base...    
       
   225     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::DoCancel")
       
   226     
       
   227     if (iDeleteOperation.Handle() != 0 && iStatus == KRequestPending)
       
   228         {
       
   229         iDeleteOperation.LogonCancel(iStatus);
       
   230         } 
       
   231     
       
   232     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::DoCancel")
       
   233     }
       
   234 
       
   235 
       
   236 
       
   237 // ---------------------------------------------------------
       
   238 // CApSettingsDeleteOperation::DialogDismissedL
       
   239 // ---------------------------------------------------------
       
   240 //
       
   241 void CApSettingsDeleteOperation::DialogDismissedL( TInt /*aButtonId*/ )
       
   242     {
       
   243     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::DialogDismissedL")
       
   244     
       
   245     switch ( iState )
       
   246         {
       
   247         case EProcOnDialogOn:
       
   248             { // can't be, it means that dialog is dismissed by user
       
   249             // but process is still runing...
       
   250             iState = EProcOnDialogOff;
       
   251             break;
       
   252             }
       
   253         case EProcOffDialogOn:
       
   254             {
       
   255             // set dialog off
       
   256             iState = EProcOffDialogOff;
       
   257             // as proc is already off, it circles in RunL,
       
   258             break;
       
   259             }
       
   260         case EProcOnDialogOff:
       
   261             { // can't be, it is already off...
       
   262             iState = EProcOnDialogOff;
       
   263             Next();
       
   264             break;
       
   265             }
       
   266         case EProcOffDialogOff:
       
   267             {// can't be, it is already off...
       
   268             iState = EProcOffDialogOff;
       
   269             Next();
       
   270             break;
       
   271             }
       
   272         default:
       
   273             {
       
   274             __ASSERT_DEBUG( EFalse, Panic( EInvalidState ) );
       
   275             break;
       
   276             }
       
   277         }
       
   278     
       
   279     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::DialogDismissedL")
       
   280     }
       
   281 
       
   282 
       
   283 // ---------------------------------------------------------
       
   284 // CApSettingsDeleteOperation::StartL
       
   285 // ---------------------------------------------------------
       
   286 //
       
   287 void CApSettingsDeleteOperation::StartL()
       
   288     {
       
   289     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::StartL")
       
   290     
       
   291     iStatus = KRequestPending;
       
   292     // set the internal state as both is running
       
   293     iState = EProcOnDialogOn;
       
   294 
       
   295     // now we can start wait note...
       
   296     StartWaitNoteL();
       
   297 
       
   298     // now start new thread with operation
       
   299     StartDeleteOperationThreadL();
       
   300 
       
   301     SetActive();
       
   302     // now we can wait on it...
       
   303     // wait until the started thread completes (delete operation completes)
       
   304     // and it will enter RunL. RunL will notify the wait dialog about the
       
   305     // completion of the process.
       
   306     // As the dialog shall wait ~0.5 sec till display AND must be visible
       
   307     // for ~1.5 sec. as a minimum, but must stay up as long as the 'process'
       
   308     // on it is waiting for does not completes, we have the following chances:
       
   309     // if the process is shorter than 0.5,
       
   310         // after operation completes, state moves to EProcOffDialogOn,
       
   311         // dialog will be notified about completion by RunL, and RunL starts
       
   312         // circle and wait for the dialog to finish, multiply re-entering
       
   313         // and leaving RunL, as long as the state is EProcOffDialogOn.
       
   314         // As time was shorter than 0.5, thus dialog will not show itself
       
   315         // and will call DialogDismissedL, which will change the
       
   316         // state to EProcOffDialogOff, which, on entering
       
   317         // RunL again, will delete the dialog and kill the thread.
       
   318     // if the process was longer than 0.5 but shorter than 0.5+1.5sec,
       
   319         // after operation completes, state moves to EProcOffDialogOn,
       
   320         // dialog will be notified about completion by RunL, and RunL starts
       
   321         // circle and wait for the dialog to finish, multiply re-entering
       
   322         // and leaving RunL, as long as the state is EProcOffDialogOn.
       
   323         // As time was longer than 0.5, thus dialog will show itself
       
   324         // and will stay up for 1.5 sec, as process ended between
       
   325         // 0.5 and (0.5+1.5). After it dialog will call DialogDismissedL,
       
   326         // which will change the state to EProcOffDialogOff, which, on
       
   327         // entering RunL again, will delete the dialog and kill the thread.
       
   328     // if the process was longer than 0.5+1.5
       
   329         // after operation completes, state moves to EProcOffDialogOn,
       
   330         // dialog will be notified about completion by RunL, and RunL starts
       
   331         // circle and wait for the dialog to finish, multiply re-entering
       
   332         // and leaving RunL, as long as the state is EProcOffDialogOn.
       
   333         // As time was longer than 0.5+1.5, thus dialog will show itself
       
   334         // and will stay up for as long as 'process/operation' is not finished.
       
   335         // As thread completes, notifies dialog, after it dialog will
       
   336         // call back DialogDismissedL, which will change the state
       
   337         // to EProcOffDialogOff, which, on entering RunL again,
       
   338         // will delete the dialog and kill the thread.
       
   339     
       
   340     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::StartL")
       
   341     }
       
   342 
       
   343 
       
   344 
       
   345 // ---------------------------------------------------------
       
   346 // CApSettingsDeleteOperation::Next
       
   347 // ---------------------------------------------------------
       
   348 //
       
   349 void CApSettingsDeleteOperation::Next()
       
   350     {
       
   351     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::Next")
       
   352     
       
   353     iStatus = KRequestPending;
       
   354     SetActive();
       
   355     TRequestStatus *status = &iStatus;
       
   356     User::RequestComplete( status, KErrNone );  // Invoke RunL()
       
   357     
       
   358     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::Next")
       
   359     }
       
   360 
       
   361 
       
   362 
       
   363 
       
   364 // ---------------------------------------------------------
       
   365 // CApSettingsDeleteOperation::RunDeleteThread
       
   366 // ---------------------------------------------------------
       
   367 //
       
   368 TInt CApSettingsDeleteOperation::RunDeleteThread( TAny* aPtr )
       
   369     {
       
   370     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::RunDeleteThread")
       
   371     
       
   372     CApSettingsDeleteOperation* aop = 
       
   373             STATIC_CAST( CApSettingsDeleteOperation*, aPtr );
       
   374 
       
   375 
       
   376     CTrapCleanup* TheTrapCleanup = CTrapCleanup::New(); // get cleanup stack
       
   377 
       
   378     TRAPD(r, aop->DoRunDeleteThreadL( aop ) );
       
   379 
       
   380     delete TheTrapCleanup; // destroy cleanup stack
       
   381 
       
   382     aop->iErr = r;
       
   383     
       
   384     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::RunDeleteThread")
       
   385     return ( r );
       
   386     }
       
   387 
       
   388 
       
   389 
       
   390 // ---------------------------------------------------------
       
   391 // CApSettingsDeleteOperation::DoRunDeleteThreadL
       
   392 // ---------------------------------------------------------
       
   393 //
       
   394 TInt CApSettingsDeleteOperation::DoRunDeleteThreadL( 
       
   395                                     CApSettingsDeleteOperation* aop )
       
   396     {
       
   397     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::DoRunDeleteThreadL")
       
   398     
       
   399     CCommsDatabase* db = CCommsDatabase::NewL( EDatabaseTypeIAP );
       
   400     CleanupStack::PushL( db );
       
   401     
       
   402     APSETUILOGGER_WRITE( EDelete,"Commsdb created");
       
   403 
       
   404     CApDataHandler* handler = CApDataHandler::NewLC( *db );
       
   405     
       
   406     APSETUILOGGER_WRITE( EDelete,"CApDataHandler created");
       
   407     
       
   408     CVpnApEngine* vpnengine = CVpnApEngine::NewLC( db );
       
   409 
       
   410     APSETUILOGGER_WRITE( EDelete,"CVpnApEngine created");
       
   411 
       
   412     TBool ownTransaction = StartTransactionLC( db, 
       
   413                                                /*aWrite*/ETrue, 
       
   414                                                /*aRetry*/ETrue );
       
   415 
       
   416     APSETUILOGGER_WRITE( EDelete,"Tr.started");
       
   417 
       
   418 //  NORMAL OPERATION STARTS
       
   419     TBool isvpn = vpnengine->IsVpnApL( aop->iUid );
       
   420 
       
   421     APSETUILOGGER_WRITE( EDelete,"IsVpnApL returned");
       
   422     
       
   423     // if linked to a VPN, the VPN also must be deleted
       
   424     // deleting the VPN part is the delete operation's responsibility...
       
   425     if ( isvpn )
       
   426         {
       
   427         vpnengine->DeleteVpnL( aop->iUid );
       
   428         }
       
   429     else
       
   430         {
       
   431         handler->RemoveAPL( aop->iUid );
       
   432         }
       
   433     
       
   434     APSETUILOGGER_WRITE( EDelete,"RemoveAPL returned");
       
   435 
       
   436 
       
   437     if ( ownTransaction )
       
   438         {
       
   439         TInt err = db->CommitTransaction();
       
   440         User::LeaveIfError( err );
       
   441         CleanupStack::Pop(); // RollbackTransactionOnLeave
       
   442         }
       
   443 
       
   444     APSETUILOGGER_WRITE( EDelete," delete finished");
       
   445 
       
   446     CleanupStack::PopAndDestroy( 3, db ); //db,handler,vpnengine
       
   447 
       
   448 //  NORMAL OPERATION ENDS
       
   449 
       
   450 
       
   451     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::DoRunDeleteThreadL")
       
   452     return KErrNone;
       
   453     }
       
   454 
       
   455 
       
   456 
       
   457 // ---------------------------------------------------------
       
   458 // CApSettingsDeleteOperation::StartWaitNoteL
       
   459 // ---------------------------------------------------------
       
   460 //
       
   461 void CApSettingsDeleteOperation::StartWaitNoteL()
       
   462     {
       
   463     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::StartWaitNoteL")
       
   464     
       
   465     if ( iWaitDialog )
       
   466         {
       
   467         delete iWaitDialog;
       
   468         iWaitDialog = NULL;
       
   469         }
       
   470     iWaitDialog =
       
   471         new ( ELeave ) CAknWaitDialog
       
   472                 ( REINTERPRET_CAST(CEikDialog**,&iWaitDialog) );
       
   473     iWaitDialog->PrepareLC( iResourceID );
       
   474     iWaitDialog->SetTone( CAknNoteDialog::ENoTone );
       
   475     iWaitDialog->SetTextL( *iNoteText );
       
   476     iWaitDialog->SetCallback( this );
       
   477     iWaitDialog->RunLD();
       
   478     
       
   479     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::StartWaitNoteL")
       
   480     }
       
   481 
       
   482 
       
   483 
       
   484 // ---------------------------------------------------------
       
   485 // CApSettingsDeleteOperation::StartDeleteOperationThreadL
       
   486 // ---------------------------------------------------------
       
   487 //
       
   488 void CApSettingsDeleteOperation::StartDeleteOperationThreadL()
       
   489     {
       
   490     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::StartDeleteOperationThreadL")
       
   491     
       
   492     TInt err = iDeleteOperation.Create
       
   493             (
       
   494             KDeleteThreadName, // aName
       
   495             RunDeleteThread, // aFunction
       
   496             KDeleteThreadStackSize, // aStackSize
       
   497             NULL,         // Use this heap.
       
   498             this // aPtr
       
   499             );
       
   500     APSETUILOGGER_WRITE_FORMAT( EDelete, "iDeleteOperation create returned, code:%d", err);    
       
   501     
       
   502     User::LeaveIfError( err );
       
   503     // on termination/death of this thread, it will call RunL
       
   504     iDeleteOperation.Logon( iStatus );
       
   505     // let's start the thread
       
   506     iDeleteOperation.Resume();
       
   507     // set the internal state as both is running
       
   508     iState = EProcOnDialogOn;
       
   509     
       
   510     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::StartDeleteOperationThreadL")
       
   511     }
       
   512 
       
   513 
       
   514 
       
   515 
       
   516 
       
   517 // ---------------------------------------------------------
       
   518 // CApSettingsDeleteOperation::StarTransactionLC
       
   519 // ---------------------------------------------------------
       
   520 //
       
   521 TBool CApSettingsDeleteOperation::StartTransactionLC( CCommsDatabase* aDb,
       
   522                                                       TBool aWrite, 
       
   523                                                       TBool aRetry /*ETrue*/ )
       
   524     {
       
   525     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::StartTransactionLC")
       
   526     
       
   527     TBool retval( EFalse );
       
   528     if ( !aDb->InTransaction() )
       
   529         {
       
   530         TInt retriesLeft( aRetry ? KRetryCount : 1 );
       
   531         TInt err = aDb->BeginTransaction();
       
   532         while ( ( err == KErrLocked ) && --retriesLeft )
       
   533             {
       
   534             User::After( KRetryWait );
       
   535             err = aDb->BeginTransaction();
       
   536             if (aWrite )
       
   537                 {
       
   538                 TRAP_IGNORE( GetWriteLockL( aDb ) );
       
   539                 }
       
   540             }
       
   541         if ( err )
       
   542             {
       
   543             ShowNoteL( R_APUI_VIEW_TEXT_CANNOT_ACCESS_DB );
       
   544             }
       
   545         User::LeaveIfError( err );
       
   546         CleanupStack::PushL( TCleanupItem( RollbackTransactionOnLeave, aDb ) );
       
   547         retval = ETrue;
       
   548         }
       
   549     else
       
   550         {
       
   551         retval = EFalse;
       
   552         }
       
   553         
       
   554     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::StartTransactionLC")
       
   555     return retval;
       
   556     }
       
   557 
       
   558 
       
   559 // ---------------------------------------------------------
       
   560 // CApSettingsDeleteOperation::GetWriteLockL
       
   561 // ---------------------------------------------------------
       
   562 //
       
   563 void CApSettingsDeleteOperation::GetWriteLockL( CCommsDatabase* aDb )
       
   564     {
       
   565     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::GetWriteLockL")
       
   566     
       
   567     CCommsDbTableView* v = aDb->OpenTableLC( TPtrC(WAP_ACCESS_POINT ) );
       
   568     TUint32 aDummyUid( KApNoneUID );
       
   569     TInt err = v->InsertRecord( aDummyUid );
       
   570     User::LeaveIfError( err );
       
   571     v->CancelRecordChanges();
       
   572     User::LeaveIfError( err );
       
   573     CleanupStack::PopAndDestroy(); // v
       
   574     
       
   575     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::GetWriteLockL")
       
   576     }
       
   577 
       
   578 // ---------------------------------------------------------
       
   579 // CApSettingsDeleteOperation::RollbackTransactionOnLeave
       
   580 // ---------------------------------------------------------
       
   581 //
       
   582 void CApSettingsDeleteOperation::RollbackTransactionOnLeave( TAny* aDb )
       
   583     {
       
   584     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::RollbackTransactionOnLeave")
       
   585     
       
   586     CCommsDatabase* db = STATIC_CAST( CCommsDatabase*, aDb );
       
   587     db->RollbackTransaction();
       
   588     
       
   589     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::RollbackTransactionOnLeave")
       
   590     }
       
   591 
       
   592 
       
   593 // ---------------------------------------------------------
       
   594 // CApSettingsDeleteOperation::ReadUintL
       
   595 // ---------------------------------------------------------
       
   596 //
       
   597 TInt CApSettingsDeleteOperation::ReadUintL( CCommsDbTableView* atable,
       
   598                                             const TDesC& aColumn,
       
   599                                             TUint32& aValue )
       
   600     {
       
   601     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::ReadUintL")
       
   602     
       
   603     __ASSERT_DEBUG( (atable), Panic( ENullPointer ) ) ;
       
   604     TRAPD( err, atable->ReadUintL( aColumn, aValue ) );
       
   605     if ( err != KErrNone )
       
   606         { // do not leave if readed value is not present in table...
       
   607         if ( err != KErrUnknown )
       
   608             User::Leave( err );
       
   609         }
       
   610     
       
   611     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::ReadUintL")
       
   612     return err;
       
   613     }
       
   614 
       
   615 
       
   616 // ---------------------------------------------------------
       
   617 // CApSettingsDeleteOperation::SetNoteTextL
       
   618 // ---------------------------------------------------------
       
   619 //
       
   620 void CApSettingsDeleteOperation::SetNoteTextL( const TDesC& aNoteText )
       
   621     {
       
   622     APSETUILOGGER_ENTERFN( EDelete,"DeleteOp::SetNoteTextL")
       
   623     
       
   624     delete iNoteText;
       
   625     iNoteText = NULL; // must NULL it to satisfy CodeScanner...
       
   626     iNoteText = aNoteText.AllocL();
       
   627     
       
   628     APSETUILOGGER_LEAVEFN( EDelete,"DeleteOp::SetNoteTextL")
       
   629     }
       
   630 // End of File