fotaapplication/fotaserver/src/fotaupdate.cpp
changeset 73 ae69c2e8bc34
parent 55 1c556dee8eb1
equal deleted inserted replaced
71:d2517372cc44 73:ae69c2e8bc34
    14  * Description:   starts update sequence
    14  * Description:   starts update sequence
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 // INCLUDE FILES
    18 // INCLUDE FILES
    19 #include <StringLoader.h>
    19 
    20 #include <centralrepository.h>
    20 #include <centralrepository.h>
    21 #include <AknUtils.h>
    21 #include <AknUtils.h>
    22 #include <AknBidiTextUtils.h> 
    22 #include <AknBidiTextUtils.h> 
    23 #include <biditext.h>
    23 #include <biditext.h>
    24 #include <gdi.h>
    24 #include <gdi.h>
    25 #include <fotaengine.h>
    25 #include <fotaengine.h>
    26 #include <apgtask.h>
    26 #include <apgtask.h>
    27 #include <aknradiobuttonsettingpage.h> 
       
    28 #include <akntitle.h>
       
    29 #include <schtime.h>
    27 #include <schtime.h>
    30 #include <csch_cli.h>
    28 #include <csch_cli.h>
    31 #include <fotaengine.h>
    29 #include <fotaengine.h>
    32 #include <XQConversions>
    30 #include <XQConversions>
    33 #include "fotaupdate.h"
    31 #include "fotaupdate.h"
    63 
    61 
    64     CancelMonitor();
    62     CancelMonitor();
    65 
    63 
    66     if (iProperty.Handle())
    64     if (iProperty.Handle())
    67         iProperty.Close();
    65         iProperty.Close();
       
    66     
       
    67     if(iNotifier)
       
    68         {
       
    69          delete iNotifier;
       
    70          iNotifier = NULL;
       
    71         }
       
    72     if(iNotifParams)
       
    73         {
       
    74          delete iNotifParams;
       
    75          iNotifParams = NULL;
       
    76         }            
    68 
    77 
    69     FLOG(_L("CFotaUpdate::~CFotaUpdate <<"));
    78     FLOG(_L("CFotaUpdate::~CFotaUpdate <<"));
    70     }
    79     }
    71 
    80 
    72 // ---------------------------------------------------------------------------
    81 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
    75 //
    84 //
    76 CFotaUpdate* CFotaUpdate::NewL(CFotaServer* aServer)
    85 CFotaUpdate* CFotaUpdate::NewL(CFotaServer* aServer)
    77     {
    86     {
    78     CFotaUpdate* ao = new (ELeave) CFotaUpdate();
    87     CFotaUpdate* ao = new (ELeave) CFotaUpdate();
       
    88 	CleanupStack::PushL( ao );
       
    89     ao->ConstructL();
    79     ao->iFotaServer = aServer;
    90     ao->iFotaServer = aServer;
       
    91 	CleanupStack::Pop(ao);
    80     return ao;
    92     return ao;
       
    93     }
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // CFotaUpdate::ConstructL 
       
    97 // ---------------------------------------------------------------------------
       
    98 //
       
    99 
       
   100 void CFotaUpdate::ConstructL()
       
   101     {
       
   102     iNotifier = CFotaDownloadNotifHandler::NewL(this);
    81     }
   103     }
    82 
   104 
    83 // ---------------------------------------------------------------------------
   105 // ---------------------------------------------------------------------------
    84 // CFotaUpdate::CheckUpdateResults
   106 // CFotaUpdate::CheckUpdateResults
    85 // Checks if there is update result file available (meaning that update just
   107 // Checks if there is update result file available (meaning that update just
   631     {
   653     {
   632     FLOG(_L("CFotaUpdate::ShowDialogL, dialogid = %d >>"), aDialogid);
   654     FLOG(_L("CFotaUpdate::ShowDialogL, dialogid = %d >>"), aDialogid);
   633     iFotaServer->ServerCanShut(EFalse);
   655     iFotaServer->ServerCanShut(EFalse);
   634 
   656 
   635     if (iFotaServer->FullScreenDialog())
   657     if (iFotaServer->FullScreenDialog())
   636         iFotaServer->FullScreenDialog()->Close();
   658         iFotaServer->FullScreenDialog()->close();
   637 
   659 
   638     iNotifParams = CHbSymbianVariantMap::NewL();
   660     iNotifParams = CHbSymbianVariantMap::NewL();
   639 
   661 
   640     HBufC* keyDialog = HBufC::NewL(10);
   662     HBufC* keyDialog = HBufC::NewL(10);
   641     CleanupStack::PushL(keyDialog);
   663     CleanupStack::PushL(keyDialog);
   642     *keyDialog = KKeyDialog;
   664     *keyDialog = KKeyDialog;
   643 
   665 
   644     CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&aDialogid,
   666     CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&aDialogid,
   645             CHbSymbianVariant::EInt);
   667             CHbSymbianVariant::EInt);
   646     iNotifParams->Add(*keyDialog, dialogId);
   668     iNotifParams->Add(*keyDialog, dialogId);
   647     iNotifier = CFotaDownloadNotifHandler::NewL(this);
   669     
   648 
   670 
   649     iNotifier->LaunchNotifierL(iNotifParams, aDialogid);
   671     iNotifier->LaunchNotifierL(iNotifParams, aDialogid);
   650 
   672 
   651     CleanupStack::PopAndDestroy();
   673     CleanupStack::PopAndDestroy();
   652     FLOG(_L("CFotaUpdate::ShowDialogL <<"));
   674     FLOG(_L("CFotaUpdate::ShowDialogL <<"));