201041
authorhgs
Fri, 15 Oct 2010 11:39:02 +0530
changeset 67 fdbfe0a95492
parent 62 03849bd79877
child 71 a6c938002837
201041
applicationmanagement/RfsPlugin/src/RfsAppMgmtPlugin.cpp
applicationmanagement/amadapter2/src/amadapter.cpp
applicationmanagement/omascomoadapter/src/omascomoadapter.cpp
applicationmanagement/server/src/AMDeploymentComponentData.cpp
applicationmanagement/server/src/AMPreInstallApp.cpp
applicationmanagement/server/src/ApplicationManagementServer.cpp
applicationmanagement/server/src/amstorage.cpp
clientprovisioning/cpqtsp/src/CWPBioControl.cpp
clientprovisioning/cpqtsp/src/CpQtSpView.cpp
devicemgmtdialogsplugin/inc/devicemanagementnotifierutils.h
devicemgmtdialogsplugin/inc/devicemanagementnotifierwidget_p.h
devicemgmtdialogsplugin/inc/fotadevicedialogs.h
devicemgmtdialogsplugin/inc/omacppinquerydialog.h
devicemgmtdialogsplugin/src/devicemanagementnotifierplugin.cpp
devicemgmtdialogsplugin/src/devicemanagementnotifierutils.cpp
devicemgmtdialogsplugin/src/devicemanagementnotifierwidget.cpp
devicemgmtdialogsplugin/src/fotadevicedialogs.cpp
devicemgmtdialogsplugin/src/omacppinquerydialog.cpp
deviceupdatesui/deviceupdates/deviceupdates.pro
deviceupdatesui/deviceupdates/inc/dmfotaview.h
deviceupdatesui/deviceupdates/inc/dmserviceprovider.h
deviceupdatesui/deviceupdates/inc/nsmldmdef.h
deviceupdatesui/deviceupdates/inc/nsmldmsyncinternalpskeys.h
deviceupdatesui/deviceupdates/inc/serversettingsview.h
deviceupdatesui/deviceupdates/resources/devman.docml
deviceupdatesui/deviceupdates/resources/service_conf.xml
deviceupdatesui/deviceupdates/src/deviceupdatemoniter.cpp
deviceupdatesui/deviceupdates/src/dmadvancedview.cpp
deviceupdatesui/deviceupdates/src/dmfotaview.cpp
deviceupdatesui/deviceupdates/src/dmserviceprovider.cpp
deviceupdatesui/deviceupdates/src/main.cpp
deviceupdatesui/deviceupdates/src/nsmldmsynchandler.cpp
deviceupdatesui/deviceupdates/src/serversettingsview.cpp
deviceupdatesui/deviceupdatesplugin/deviceupdatesplugin.pro
deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesdata.h
deviceupdatesui/deviceupdatesplugin/src/deviceupdatesdata.cpp
deviceupdatesui/deviceupdatesqtsp/deviceupdatesqtsp.pro
deviceupdatesui/deviceupdatesqtsp/inc/DmTelServiceHandler.h
deviceupdatesui/deviceupdatesqtsp/src/DmTelServiceHandler.cpp
deviceupdatesui/deviceupdatesqtsp/src/main.cpp
omacpadapters/MbxNbrAdapter/Data/WPMbxNbrAdapterResource.rss
omacpadapters/MbxNbrAdapter/Group/MbxNbrAdapter.mmp
omacpadapters/MbxNbrAdapter/Group/bld.inf
omacpadapters/MbxNbrAdapter/Src/MbxNbrAdapter.cpp
omacpadapters/MbxNbrAdapter/loc/MailboxAdapter.loc
omacpadapters/StreamingAdapter/Data/WPStreamingAdapterResource.rss
omacpadapters/StreamingAdapter/Group/StreamingAdapter.mmp
omacpadapters/StreamingAdapter/Group/bld.inf
omacpadapters/StreamingAdapter/Src/Streamingadapter.cpp
omacpadapters/StreamingAdapter/loc/StreamingAdapter.loc
omacpadapters/WAPAdapter/Data/WPWAPAdapterResource.rss
omacpadapters/WAPAdapter/Group/WPWAPAdapter.mmp
omacpadapters/WAPAdapter/Group/bld.inf
omacpadapters/WAPAdapter/Src/CWPWAPAdapterBase.cpp
omacpadapters/WAPAdapter/Src/CWPWAPBookmarkItem.cpp
omacpadapters/WAPAdapter/Src/CWPWAPBrowserAdapter.cpp
omacpadapters/WAPAdapter/Src/CWPWAPItemBAse.cpp
omacpadapters/WAPAdapter/Src/CWPWAPMMSAdapter.cpp
omacpadapters/accesspointadapter/Src/CWPAPAdapter.cpp
omacpadapters/accesspointadapter/Src/CWPAPNapdef.cpp
omacpadapters/accesspointadapter/group/WPAPAdapter.mmp
omacpadapters/accesspointadapter/group/bld.inf
omacpadapters/accesspointadapter/loc/WPAPAdapter.loc
omacpadapters/bld/bld.inf
omacpadapters/cpdestinationnwadapter/data/2000b4af.rss
omacpadapters/cpdestinationnwadapter/group/bld.inf
omacpadapters/cpdestinationnwadapter/group/wpdestinationnwadapter.mmp
omacpadapters/cpdestinationnwadapter/inc/cwpdestinationnwadapter.h
omacpadapters/cpdestinationnwadapter/inc/cwpdestinationnwadapter.inl
omacpadapters/cpdestinationnwadapter/inc/cwpdestinationnwitem.h
omacpadapters/cpdestinationnwadapter/inc/wpdestinationnwadapteruids.h
omacpadapters/cpdestinationnwadapter/inc/wpdestinationnwdebug.h
omacpadapters/cpdestinationnwadapter/rom/wpdestinationnwadapter.iby
omacpadapters/cpdestinationnwadapter/rom/wpdestinationnwadapter_resources.iby
omacpadapters/cpdestinationnwadapter/src/cwpdestinationnwadapter.cpp
omacpadapters/cpdestinationnwadapter/src/cwpdestinationnwitem.cpp
omacpadapters/cpdestinationnwadapter/src/wpdestinationnwadaptergroupproxy.cpp
omacpadapters/rom/ProvisioningAdapter.iby
omacpadapters/rom/ProvisioningAdapterResources.iby
omadmadapters/connmoadapter/src/AddBuffer.cpp
omadmadapters/connmoadapter/src/ProxyBranch.cpp
omadmadapters/fota/src/nsmldmfotaadapter.cpp
omadmadapters/nsmldminternet/src/NSmlInternetAdapter.cpp
omadmadapters/nsmldminternet/src/NSmlWLanAdapter.cpp
omadmadapters/nsmldminternet/src/NSmlWlanSettings.cpp
--- a/applicationmanagement/RfsPlugin/src/RfsAppMgmtPlugin.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/RfsPlugin/src/RfsAppMgmtPlugin.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -73,8 +73,9 @@
     if( appManagement.Connect() == KErrNone )
         {
         RDEBUG("CRfsAppMgmtPlugin::RestoreFactorySettingsL(): Connected to AppMgmt ");
+        CleanupClosePushL(appManagement);
         appManagement.PerformRfsL();
-        appManagement.Close();
+        CleanupStack::PopAndDestroy(&appManagement);
         }
     else
         {
--- a/applicationmanagement/amadapter2/src/amadapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/amadapter2/src/amadapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -2191,7 +2191,7 @@
 						}
 					else if ( dataType == EDCConRef )
 						{
-						CBufBase *b = CBufFlat::NewL(4);
+						CBufBase *b = CBufFlat::NewL(12);
 						CleanupStack::PushL( b );
 						SessionL().DeploymentComponentDataL( iluid, dataType, *b);
 						TPckgBuf<TInt> iap;
@@ -3628,7 +3628,7 @@
 			RDEBUG( "CAmAdapter::CheckStateChangesL(): Adding Trust Closing Session" );
 			iManagement.Close();
 			iSessionOpened = EFalse;
-			RApplicationManagement &session = SessionL();
+//			RApplicationManagement &session = SessionL(); // coverity Fix
 			RDEBUG( "CAmAdapter::CheckStateChangesL(): Adding Trust new session started" );
 		}
 	}
--- a/applicationmanagement/omascomoadapter/src/omascomoadapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/omascomoadapter/src/omascomoadapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -977,9 +977,10 @@
             
 
     		CNSmlDMAlertItem* item = new (ELeave) CNSmlDMAlertItem ;
-    		
+    		CleanupStack::PushL(item);
     		HBufC8 *data = HBufC8::NewL(1024);
-            
+        CleanupStack::PushL(data);    
+        	
             TPtr8 ptr = data->Des();
             //ptr.Append(KDataStart);
             ptr.Append(KResultCodeStart);
@@ -990,48 +991,43 @@
             ptr.Append(KIdentifierEnd);
             //ptr.Append(KDataEnd);
 
-            HBufC8 *sourceuri = genericalerts[i]->iSourceURI;
+        HBufC8 *sourceuri = genericalerts[i]->iSourceURI;
     		
     		item->iSource = sourceuri;
 
-			HBufC8 *targeturi = targetURIGet.AllocL();
-    		
+				HBufC8 *targeturi = targetURIGet.AllocL();
+    		CleanupStack::PushL(targeturi);  
     		item->iTarget = targeturi;
     		
     		HBufC8 *metatype = scomometatype.AllocL();
-    		            
+    		CleanupStack::PushL(metatype);            
     		item->iMetaType = metatype;
     		            
-    		HBufC8 *metaformat = scomometaformat.AllocL();         
-
+    		HBufC8 *metaformat = scomometaformat.AllocL();
+    		CleanupStack::PushL(metaformat);
     		item->iMetaFormat = metaformat;
 
     		HBufC8 *metamark = scomomark.AllocL();
-    		            
+    		CleanupStack::PushL(metamark);            
     		item->iMetaMark = metamark;
     
     		item->iData = data;
     
     		iItemArray.AppendL(*item);
             
-            TRAP_IGNORE(privateAPI.AddDMGenericAlertRequestL(              
-                    *genericalerts[i]->iCorrelator,iItemArray ));
-                    
-                    
-            delete data;
-            
-            delete metamark;
+        TRAP_IGNORE(privateAPI.AddDMGenericAlertRequestL(              
+                    *genericalerts[i]->iCorrelator,iItemArray ));       
             
-            delete metaformat;
-            
-            delete metatype;
-            
-            delete targeturi;
-            delete item;
+        CleanupStack::PopAndDestroy( metamark);            
+        CleanupStack::PopAndDestroy( metaformat);           
+        CleanupStack::PopAndDestroy( metatype);	            
+        CleanupStack::PopAndDestroy( targeturi);	
+        CleanupStack::PopAndDestroy( data);	
+        CleanupStack::PopAndDestroy( item);
                     
-            iItemArray.Reset();			
-			iItemArray.Close();
-            CleanupStack::PopAndDestroy( &privateAPI);
+        iItemArray.Reset();			
+				iItemArray.Close();
+        CleanupStack::PopAndDestroy( &privateAPI);
             }
         }
     genericalerts.ResetAndDestroy();
@@ -2598,7 +2594,7 @@
                                     else
                                         if (dataType == EDCConRef)
                                             {
-                                            CBufBase *b = CBufFlat::NewL(4);
+                                            CBufBase *b = CBufFlat::NewL(12);
                                             CleanupStack::PushL(b);
                                             SessionL().DeploymentComponentDataL(
                                                     iluid, dataType, *b);
@@ -4144,7 +4140,7 @@
         RDEBUG( "CSCOMOAdapter::CheckStateChangesL(): Adding Trust Closing Session" );
         iManagement.Close();
         iSessionOpened = EFalse;
-        RApplicationManagement &session = SessionL();
+//        RApplicationManagement &session = SessionL(); // coverity Fix
         RDEBUG( "CSCOMOAdapter::CheckStateChangesL(): Adding Trust new session started" );
         }
     }
--- a/applicationmanagement/server/src/AMDeploymentComponentData.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/server/src/AMDeploymentComponentData.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -180,7 +180,7 @@
         if (err == KErrNone)
             {
             CleanupClosePushL(file); // 2
-            TInt fsize;
+            TInt fsize = 0;
             User::LeaveIfError(file.Size(fsize) );
             iData = HBufC8::NewL(fsize);
             TPtr8 ptr(iData->Des() );
@@ -396,7 +396,8 @@
         // leave if can not open the original file
         User::LeaveIfError(originalFile.Open(aFs, ptr, EFileWrite) );
         RDEBUG("	-> done");
-
+				
+		CleanupClosePushL(originalFile);
         // First construct the temp path
         User::LeaveIfError(aFs.PrivatePath(decryptedTempFileName) );
         // set drive letter into the path
@@ -422,11 +423,10 @@
         User::LeaveIfError(decryptedFile.Open(aFs, decryptedTempFileName,
                 EFileShareAny) );
         RDEBUG("	-> done");
+        CleanupClosePushL(decryptedFile);
         // parse the uid from the file
         ret = ParseUidFromSisFileL(decryptedFile);
 
-        // no use anymore for the decrypted file
-        decryptedFile.Close();
         // delete the temp file
         TInt err = aFs.Delete(decryptedTempFileName);
         if (err != KErrNone)
@@ -434,9 +434,9 @@
             RDEBUG_2("**** ERROR, unable to delete temporary file: %S", &decryptedTempFileName );
             }
 
-        CleanupStack::PopAndDestroy(licenseMgr);
-        decryptedFile.Close();
-        originalFile.Close();
+        CleanupStack::PopAndDestroy(&decryptedFile);
+        CleanupStack::PopAndDestroy(licenseMgr);      
+        CleanupStack::PopAndDestroy(&originalFile);
         }
     else
         if (iMimeType == KSisxMimeType || iMimeType == KSisMimeType )
--- a/applicationmanagement/server/src/AMPreInstallApp.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/server/src/AMPreInstallApp.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -178,8 +178,10 @@
 			{
 
 			RDEBUG("Clist_PreInstallAppUi: err == KErrNone");
+												CleanupStack::PushL(sisRegistry); 
                         TPreInstalledAppParams *params =
                                 new (ELeave) TPreInstalledAppParams;
+                        CleanupStack::PushL(params);   
                         params->iPreInstalledAppame.Copy(sisRegistry->Name());
                         params->iPreInstalledAppVendorName.Copy(
                                 sisRegistry->Vendor());
@@ -199,7 +201,8 @@
                         RDEBUG_2("Clist_PreInstallAppUi: ListPreInstalledApp: Installed App Name is: %S",&(sisRegistry->Name()));
                         RDEBUG_2("Clist_PreInstallAppUi: ListPreInstalledApp: Installed App Vendor is: %S",&(sisRegistry->Vendor()));
                         RDEBUG_2("Clist_PreInstallAppUi: ListPreInstalledApp: Installed App UID is : '0x%X'",sisRegistry->Uid());
-                        delete sisRegistry;
+                        CleanupStack::PopAndDestroy(params);
+                        CleanupStack::PopAndDestroy(sisRegistry);
 			}
                         continue;
                         }
--- a/applicationmanagement/server/src/ApplicationManagementServer.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/server/src/ApplicationManagementServer.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -489,6 +489,10 @@
 
     delete iUtility;
     delete iAMServerDB;
+    if ( iArgu )
+    	delete iArgu;
+    if ( iResults )
+    	delete iResults;
 
     RProperty::Delete(KUidPSApplicationManagementKeys, KAMServerUIEnabled);
 
@@ -1007,7 +1011,8 @@
             if (m_Dlg)
                 m_Dlg->registerInstallRequest(aStatus);
             delete iArgu;
-            iArgu = NULL;
+            iArgu = NULL;            
+            CleanupStack::PushL(m_Dlg);
             iArgu = Usif::COpaqueNamedParams::NewL();
             iArgu->AddIntL(Usif::KSifInParam_InstallSilently, 1);
             TAMInstallOptions opts = aComponent.InstallOpts();
@@ -1021,13 +1026,14 @@
             delete iResults;
             iResults = NULL;
             iResults = Usif::COpaqueNamedParams::NewL();
-
+							
             RDEBUG_3( "CApplicationManagementServer::InstallL: Install '%S' sizeof opts: %d", &fn, sizeof (aComponent.InstallOpts()));
 		TRAPD( err ,iInstaller.Install( iInstallFile, *iArgu, *iResults, aStatus ) );
 
             RDEBUG_2( "CApplicationManagementServer::InstallL: status: %d", err);
             User::LeaveIfError(err);
             iInstallInProgress = ETrue;
+            CleanupStack::Pop(m_Dlg);
             }
         else
             {
@@ -1213,7 +1219,7 @@
                             = silentsession;
                     TRequestStatus s1 = KRequestPending;
                     AppMgmtNotifier* note = new AppMgmtNotifier(m_appName);
-                    
+                    CleanupStack::PushL(note);
                     // displaying uninstall confirm notes
                     if (!CApplicationManagementUtility::iSilentSession)
                         {
@@ -1237,6 +1243,7 @@
                                         true);
                                 
                             }
+                        CleanupStack::PushL(m_Dlg);
                         CDialogWait* wait1 = CDialogWait::NewL();           
                      
                         TRAP(err,UninstallL( aCompo, wait1->iStatus ));
@@ -1267,6 +1274,7 @@
                                 RDEBUG_2("CApplicationManagementServer: RemoveInternalL ERROR uninstall failed %d", s.Int() );
                                 }
                             }
+                        CleanupStack::Pop(m_Dlg);    
                         }
                     else
                         {
@@ -1274,7 +1282,7 @@
                         aCompo.SetStatusNode(EDelivered_RemoveFailed);
                         RDEBUG( "CApplicationManagementServer: RemoveInternalL User cancelled" );
                         }
-                    delete note;
+                    CleanupStack::PopAndDestroy(note);
                     }
                 else
                     {
@@ -3675,6 +3683,7 @@
     RDEBUG( "CApplicationManagementSession: StateChangeComponentIdsCountL" );
     RPointerArray<TPreInstalledAppParams> preInstalledAppParams;
     CAMPreInstallApp* preInstallApp = CAMPreInstallApp::NewL();
+    CleanupStack::PushL(preInstallApp) ;
     preInstallApp->GetPreInstalledAppsL(preInstalledAppParams);
     TInt count = 0;
     for (count = 0; count < preInstalledAppParams.Count(); count++)
@@ -3721,7 +3730,7 @@
                     *preInstallCompo);
             }
         }
-    delete preInstallApp;
+    CleanupStack::PopAndDestroy(preInstallApp);
     RComponentIdArray arr;
     Server().Storage()->GetStateChangeComponentIdsL(arr);
     TPckgBuf<TInt> buflen(arr.Count());
--- a/applicationmanagement/server/src/amstorage.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/applicationmanagement/server/src/amstorage.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -170,6 +170,7 @@
         RDEBUG_2( "CDeliveryComponentStorage::ConstructL() ERROR CentRep not initialized: Check deployment! %d", erx );
         User::Leave(erx);
         }
+     
     TInt err(iRepository->Get(KNextIdKey, iNextId) );
     if (err == KErrNotFound)
         {
@@ -181,6 +182,7 @@
         User::LeaveIfError(err);
         }
     LoadComponentsL();
+    
     }
 
 void CDeliveryComponentStorage::LoadCertsL()
--- a/clientprovisioning/cpqtsp/src/CWPBioControl.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/clientprovisioning/cpqtsp/src/CWPBioControl.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -103,9 +103,15 @@
     if (iDevDialog)
         {
         delete iDevDialog;
+        iDevDialog = NULL;
         }
     delete ibootstrap;
     delete iWait;
+    if ( iMsg )
+    {
+    	delete iMsg;
+    	iMsg = NULL;
+    }
     }
 // ----------------------------------------------------------------------------
 // CWPBioControl ::RestoreMsgL
--- a/clientprovisioning/cpqtsp/src/CpQtSpView.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/clientprovisioning/cpqtsp/src/CpQtSpView.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -79,10 +79,7 @@
 void CpQtSpView::corruptMessageDialog(HbAction *action)
 {
     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
-    if(action == dlg->primaryAction())
-    {
     window->closeWindow();
-    }   
 }
 // ----------------------------------------------------------------------------
 // CpQtSpView::constructView
--- a/devicemgmtdialogsplugin/inc/devicemanagementnotifierutils.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/inc/devicemanagementnotifierutils.h	Fri Oct 15 11:39:02 2010 +0530
@@ -38,6 +38,8 @@
 
 class devicemanagementnotifierwidget;
 class syncmlConnectNotifier;
+class fotadevicedialogs;
+
 class devicemanagementnotifierutils :public HbDialog  {
 
 Q_OBJECT
@@ -48,6 +50,7 @@
 private:
 syncmlnotifier* notifier;
 syncmlConnectNotifier* connectDialog;
+fotadevicedialogs * fotadialog;
   
 };
 
--- a/devicemgmtdialogsplugin/inc/devicemanagementnotifierwidget_p.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/inc/devicemanagementnotifierwidget_p.h	Fri Oct 15 11:39:02 2010 +0530
@@ -50,6 +50,7 @@
     void closeDeviceDialog(bool byClient);
     HbDialog *deviceDialogWidget() const;
     void dmDevdialogDismissed(ENotfierType notifiertype, int response);
+    void fotaDevdialogDismissed(int notifiertype, int response);
 
 signals:
         void deviceDialogClosed();
--- a/devicemgmtdialogsplugin/inc/fotadevicedialogs.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/inc/fotadevicedialogs.h	Fri Oct 15 11:39:02 2010 +0530
@@ -27,39 +27,53 @@
 #include "syncmlnotifierprivate.h"
 #include "devicemanagementnotifierwidget_p.h"
 
+#include <QObject>
 
-class fotadevicedialogs:public HbDialog, public HbDeviceDialogInterface {
-//class fotadevicedialogs:public devicemanagementnotifierwidget {
+
+class fotadevicedialogs:public QObject
+{
+
 
 Q_OBJECT
 
 public:
-/**
-  * Construction and setting of observer happens here
-  *
-  * @since   S60   SF4
-  * @param   aType - tell sthe type of the dialog to be shown
-  * @param   aObserver is the parent class which owns the notifier and information is
-  * passed to the parent class from the device dialog.
-  */
+		/**
+		  * Construction and setting of observer happens here
+		  *
+		  * @since   SF4
+		  * @param   ptr - pointer to the devicemanagementnotifierwidget which sends the data to the calling module.
+		  * passed to the parent class from the device dialog.
+		  */
+		
+		fotadevicedialogs(devicemanagementnotifierwidget* ptr);
+		
+		
+		/**
+		  * Destructor to release the memory
+		  *
+		  * @since   SF4
+		  * @param   None
+		  */
+		  
+		~fotadevicedialogs();
 
-fotadevicedialogs(const QVariantMap &parameters);
-
-private:
-    /**
+		/**
       * Function to call the appropriate device dialog based on the dialog ID.
       *
-      * @since   S60   SF4
+      * @since   SF4
       * @param   aType - tell sthe type of the dialog to be shown
       * @param   parameters - contains the dialogID + information to be shown in the dialogs
       */
 
      void launchFotaDialog(const QVariantMap &parameters);
-     
+
+
+private:
+         
      /**
        * Function to show the informative dialog of FOTA
        *
-       * @since   S60   SF4
+       * @since   SF4
        * @param   aType - tell sthe type of the dialog to be shown
        * @param   parameters - contains the dialogID + information to be shown in the dialogs
        */
@@ -69,7 +83,7 @@
      /**
         * Function to show the error message dialog of FOTA
         *
-        * @since   S60   SF4
+        * @since   SF4
         * @param   aType - tell sthe type of the dialog to be shown
         * @param   parameters - contains the dialogID + information to be shown in the dialogs
         */
@@ -79,7 +93,7 @@
      /**
          * Function to show the confirmative dialog of FOTA
          *
-         * @since   S60   SF4
+         * @since  SF4
          * @param   aType - tell sthe type of the dialog to be shown
          * @param   parameters - contains the dialogID + information to be shown in the dialogs
          */
@@ -87,56 +101,34 @@
 
 public slots:
 
-/**
-  * Construction and setting of observer happens here
-  *
-  * @since   S60   SF4
-  * @param   aObserver is the parent class which owns the notifier and information is
-  * passed to the parent class from the device dialog.
-  */
-
+		/**
+	  * Construction and setting of observer happens here
+	  *
+	  * @since   SF4
+	  * @param   aObserver is the parent class which owns the notifier and information is
+	  * passed to the parent class from the device dialog.
+	  */
     void fotaLSK();
+    
     /**
-      * Construction and setting of observer happens here
-      *
-      * @since   S60   SF4
-      * @param   aObserver is the parent class which owns the notifier and information is
-      * passed to the parent class from the device dialog.
-      */
-
+    * Construction and setting of observer happens here
+    *
+    * @since   SF4
+    * @param   aObserver is the parent class which owns the notifier and information is
+    * passed to the parent class from the device dialog.
+    */
     void fotaRSK();
     
-
-public: //derived from HbDeviceDialogInterface
-    /**
-      * Ccalled when device dialog is closed.
-      *
-      * @since   S60   SF4
-      * @param   byClient - The Name of the client which closed the dialog.
-      */
-
-	void closeDeviceDialog(bool byClient);
+private:
+    
+    // The dialog ID of the current shown dialog.
+    TInt m_DialogId;
     
-    bool setDeviceDialogParameters(const QVariantMap &parameters);
-    int deviceDialogError() const;
-//    void closeDeviceDialog(bool byClient);
-    HbDialog *deviceDialogWidget() const;
-
-signals:
-        void deviceDialogClosed();
-        void deviceDialogData(QVariantMap data);
-
-
-signals:
-/**
-  * servertextmessage
-  *
-  * @since   S60   SF4
-  * @param   aObserver is the parent class which owns the notifier and information is
-  * passed to the parent class from the device dialog.
-  */
-
-    void servertextmessage(const QString &string);
+    // HbDialog instance which actually shows the dialog from the docml.
+    HbDialog* m_dialog;
+    
+    // widget pointer which is used to send the signals to the calling module.
+    devicemanagementnotifierwidget* m_Ptr;
 };
 
 #endif
--- a/devicemgmtdialogsplugin/inc/omacppinquerydialog.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/inc/omacppinquerydialog.h	Fri Oct 15 11:39:02 2010 +0530
@@ -26,7 +26,7 @@
 #include <hbinputeditorinterface.h>
 #include "devicemanagementnotifierwidget_p.h"
 
-class omacppinquerydialog : public devicemanagementnotifierwidget
+class omacppinquerydialog : public QObject, public HbDeviceDialogInterface
     {
 
 Q_OBJECT
@@ -37,16 +37,27 @@
 public:
     void createcppinquery(const QVariantMap &parameters);
     HbDialog *deviceDialogWidget() const;
+    //derived from HbDeviceDialogInterface
+    bool setDeviceDialogParameters(const QVariantMap &parameters);
+    int deviceDialogError() const;
+    void closeDeviceDialog(bool byClient);
+    QObject *signalSender() const;
 
 public slots:
 
     void pintextChanged();
     void okSelected();
     void cancelSelected();
-    
+
+private:
+signals:
+    void deviceDialogClosed();
+    void deviceDialogData(QVariantMap data);
+
 private:
     HbLineEdit *mlineedit;
     HbAction *mactionok;
+    HbDialog *mDialog;
     };
     
 
--- a/devicemgmtdialogsplugin/src/devicemanagementnotifierplugin.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/src/devicemanagementnotifierplugin.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -67,7 +67,9 @@
 bool devicemanagementnotifierplugin::accessAllowed(const QString &deviceDialogType,
     const QVariantMap &parameters, const QVariantMap &securityInfo) const
 {
-       
+    Q_UNUSED(deviceDialogType);
+    Q_UNUSED(parameters);
+    Q_UNUSED(securityInfo);
     // This plugin doesn't perform operations that may compromise security.
     // All clients are allowed to use.
     return true;
@@ -89,17 +91,18 @@
             // Return specific object for showing appropriate dialog
             return new omacppinquerydialog(parameters);
             }
-           
-        if (dialogtype >= EFwDLNeedMoreMemory && dialogtype <= EFwUpdResumeUpdate)
-            {
-            // Return specific object for showing appropriate dialog
-            return new fotadevicedialogs(parameters);
-            }
+
+        //if (dialogtype >= EFwDLNeedMoreMemory && dialogtype <= EFwUpdResumeUpdate)
+        //{
+        // Return specific object for showing appropriate dialog
+        // return new fotadevicedialogs(parameters);
+        //}
 
         }
+
     return new devicemanagementnotifierwidget(parameters);
-        
-}
+    
+    }
 
 // Return information of device dialog the plugin creates
 bool devicemanagementnotifierplugin::deviceDialogInfo(const QString &deviceDialogType,
--- a/devicemgmtdialogsplugin/src/devicemanagementnotifierutils.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/src/devicemanagementnotifierutils.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -27,6 +27,8 @@
 #include "pnputillogger.h"
 #include "omacppinquerydialog.h"
 #include "devicemanagementnotifierwidget_p.h"
+#include "fotadevicedialogs.h"
+
  enum TSyncmlHbNotifierKeys 
 		{
 
@@ -46,6 +48,7 @@
 	
 	QVariantMap::const_iterator i = parameters.constBegin();
     int notifiertolaunch = 0;
+    int dialogtype = 0;
 	while (i != parameters.constEnd())
         {
             if (i.key().toAscii() == "syncmlfw")
@@ -53,7 +56,15 @@
 
             notifiertolaunch = i.value().toInt();
                // profileidenabled = true;
+                }
+            
+            if (i.key().toAscii() == keydialog)
+                {
+
+                dialogtype = i.value().toInt();
+               // profileidenabled = true;
                 }           
+
             ++i;
             }
     if(notifiertolaunch == 1000001 )// Connecting dialog
@@ -61,15 +72,24 @@
     connectDialog = new syncmlConnectNotifier(ptr);
     	 connectDialog->launchDialog(parameters);
     	 notifier = NULL;
+    	 fotadialog = NULL;
         }
-        
+    else if (dialogtype >= EFwDLNeedMoreMemory && dialogtype <= EFwUpdResumeUpdate)
+        {
+        fotadialog = new fotadevicedialogs(ptr);
+        fotadialog->launchFotaDialog(parameters);
+        connectDialog = NULL;
+        notifier = NULL;
+        //return  fotadialog;
+        }
     else 
         {
     notifier = new syncmlnotifier(ptr);
        notifier->launchDialog(parameters);
        connectDialog = NULL;
+       fotadialog = NULL;
         }
-        }
+     }
 devicemanagementnotifierutils::~devicemanagementnotifierutils()
     {
     qDebug("devicemanagementnotifierutils::~devicemanagementnotifierutils");
--- a/devicemgmtdialogsplugin/src/devicemanagementnotifierwidget.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/src/devicemanagementnotifierwidget.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -19,6 +19,7 @@
 #include <hbdialog.h>
 
 #include "devicemanagementnotifierwidget_p.h"
+#include <devicedialogconsts.h>
 
 
 // Constructor
@@ -83,3 +84,12 @@
     resultMap.insert("keypress", response);
     emit deviceDialogData(resultMap);    
     }	
+
+
+void devicemanagementnotifierwidget::fotaDevdialogDismissed(int notifiertype, int response)
+    {
+    QVariantMap resultMap;
+    resultMap.insert(keydialog,notifiertype);
+    resultMap.insert(returnkey, response);
+    emit deviceDialogData(resultMap);    
+    }
--- a/devicemgmtdialogsplugin/src/fotadevicedialogs.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/src/fotadevicedialogs.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -15,13 +15,16 @@
 *
 */
 
-
+#include "devicemanagementnotifierutils.h"
 #include <hbdocumentloader.h>
 #include <hbdialog.h>
 #include <hblabel.h>
 #include <hbmessagebox.h>
 #include <hbaction.h>
 #include <e32property.h>
+//#include "syncmlnotifierparams.h"
+#include "fotadevicedialogs.h"
+
 #include <qdebug.h>
 #include <hblistview.h>
 #include <hbpushbutton.h>
@@ -39,10 +42,11 @@
 // ---------------------------------------------------------------------------
 //
 
-fotadevicedialogs::fotadevicedialogs(const QVariantMap &parameters)
+fotadevicedialogs::fotadevicedialogs(devicemanagementnotifierwidget* ptr)
 //:	devicemanagementnotifierwidget(parameters)
     {
     qDebug("devicemanagementnotifierutils fotadevicedialogs");
+    m_Ptr = ptr;
     QTranslator *translator = new QTranslator();
     QString lang = QLocale::system().name();
     QString path = "Z:/resource/qt/translations/";
@@ -58,7 +62,15 @@
         qDebug("device dialog common translator loading failed");
 
     
-    launchFotaDialog(parameters);
+  
+    }
+
+
+fotadevicedialogs::~fotadevicedialogs()
+    {
+    if(m_dialog)
+        m_dialog->deleteLater();
+    
     }
 
 
@@ -76,13 +88,11 @@
     qDebug("devicemanagementnotifierutils fotadevicedialogs launchDialog");    
     TFwUpdNoteTypes aType = EFwUpdDeviceBusy;
     
-    //QString temp = QString::fromUtf8(reinterpret_cast<const char*>(url.Ptr()), url.Length());
-    //TDesC8 * tempStr = KKeyDialog;
-    //const QString temp = QString::fromUtf8(reinterpret_cast<const char*>(tempStr.Ptr()), tempStr.Length());
     i = parameters.find(keydialog);
     if(i != parameters.end())
         aType = (TFwUpdNoteTypes)i.value().toInt();
     
+    m_DialogId = (TInt)aType; 
     
     if(aType == EFwUpdRebootNote)
     	{
@@ -91,13 +101,9 @@
     	else if(aType == EFwUpdResumeDownload || aType == EFwUpdResumeUpdate)
         {
         createfotaconfirmationdialog(aType,parameters);
-        //createfotainformativedialog();
         }
-    else if(aType == EFwDLNeedMoreMemory || aType == EFwDLConnectionFailure || aType == EFwDLGeneralFailure || 
-    	 aType == EFwUpdNotEnoughBattery || aType == EFwUpdDeviceBusy || aType == EFwUpdSuccess || aType == EFwUpdNotCompatible
-    || aType == EFwDLNonResumableFailure)
+    else
         {
-        //createfotamessagedialog();
         createfotamessagedialog(aType,parameters);
         }
     }
@@ -111,7 +117,6 @@
 void fotadevicedialogs::createfotainformativedialog(TFwUpdNoteTypes aType,const QVariantMap &parameters)
     {
     qDebug("createserveralertinformative start");
-		LOGSTRING("createserveralertinformative start");
     HbDocumentLoader loader;
     bool ok = false;
     loader.load(":/xml/resources/fotainformativedialog.docml", &ok);
@@ -119,7 +124,7 @@
         {
         return;
         }
-    HbDialog *dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
+    m_dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
 
     HbLabel *content = qobject_cast<HbLabel *> (loader.findWidget(
             "lblContent"));
@@ -127,12 +132,12 @@
     // No translations required
     //content->setPlainText("Testing");
 
-    dialog->setTimeout(3000);
+    m_dialog->setTimeout(3000);
 
-    if (dialog)
-        dialog->show();
+    if (m_dialog)
+        m_dialog->show();
 
-    QObject::connect(dialog, SIGNAL(aboutToClose()), this, SLOT(okSelected()));
+    QObject::connect(m_dialog, SIGNAL(aboutToClose()), this, SLOT(okSelected()));
 
 	qDebug("createserveralertinformative end");
 
@@ -148,7 +153,6 @@
 void fotadevicedialogs::createfotaconfirmationdialog(TFwUpdNoteTypes aType,const QVariantMap &parameters)
     {
     qDebug("createserveralertinformative start");
-        LOGSTRING("createserveralertinformative start");
         
     QVariantMap::const_iterator i;
     HbDocumentLoader loader;
@@ -184,7 +188,7 @@
             {
             return;
             }
-            dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
+            m_dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
             
             HbLabel *headingString = qobject_cast<HbLabel *> (loader.findWidget(
                                 "lblDialogHeading"));
@@ -211,18 +215,17 @@
                 contentString->setPlainText(hbTrId("txt_device_update_info_the_last_update_incomplete_dwnld_kb")
                         .arg(param1).arg(param2).arg(sizeRounded));
                 }
-            //HbAction *primaryAction = dialog->primaryAction();
-            HbAction *primaryAction = (HbAction *) dialog->actions().first();
+
+            HbAction *primaryAction = (HbAction *) m_dialog->actions().first();
             primaryAction->setText(hbTrId("txt_common_button_continue_dialog"));
 
-            //HbAction *secondaryAction = dialog->secondaryAction();
-            HbAction *secondaryAction = (HbAction *) dialog->actions().at(1);
+            HbAction *secondaryAction = (HbAction *) m_dialog->actions().at(1);
             secondaryAction->setText(hbTrId("txt_device_update_button_resume_later"));
             if(!postpone)
                 secondaryAction->setEnabled(postpone);
 
-            dialog->setTimeout(HbPopup::NoTimeout);
-            dialog->setDismissPolicy(HbPopup::NoDismiss);
+            m_dialog->setTimeout(HbPopup::NoTimeout);
+            m_dialog->setDismissPolicy(HbPopup::NoDismiss);
 
             QObject::connect(primaryAction, SIGNAL(triggered()), this,
                     SLOT(fotaLSK()));
@@ -240,22 +243,20 @@
                     return;
                     }
                 
-                dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
+                m_dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
                 
-                dialog->setTimeout(HbPopup::NoTimeout);
-                dialog->setDismissPolicy(HbPopup::NoDismiss);
+                m_dialog->setTimeout(HbPopup::NoTimeout);
+                m_dialog->setDismissPolicy(HbPopup::NoDismiss);
                 
                 HbLabel *headingString = qobject_cast<HbLabel *> (loader.findWidget(
                         "lblHeading"));
                 headingString->setPlainText(hbTrId("txt_device_update_title_device_update"));
                             
                 
-                //HbAction *primaryAction = dialog->primaryAction();
-                HbAction *primaryAction = (HbAction *) dialog->actions().first();
+                HbAction *primaryAction = (HbAction *) m_dialog->actions().first();
                 primaryAction->setText(hbTrId("txt_common_button_continue_dialog"));
                 
-                //HbAction *secondaryAction = dialog->secondaryAction();
-                HbAction *secondaryAction = (HbAction *) dialog->actions().at(1);
+                HbAction *secondaryAction = (HbAction *) m_dialog->actions().at(1);
                 secondaryAction->setText(hbTrId("txt_device_update_button_resume_later"));
                 if(!postpone)
                     secondaryAction->setEnabled(postpone);
@@ -292,7 +293,7 @@
                                                                 "label_1"));
                 contentEmergency->setPlainText(hbTrId("txt_device_update_info_during_the_installation_the"));
 
-                dialog->setTimeout(HbPopup::NoTimeout);
+                m_dialog->setTimeout(HbPopup::NoTimeout);
 
                 QObject::connect(primaryAction, SIGNAL(triggered()), this,
                         SLOT(fotaLSK()));
@@ -307,8 +308,8 @@
             }
         }
 
-    if (dialog)
-        dialog->show();
+    if (m_dialog)
+        m_dialog->show();
 
     qDebug("createserveralertinformative end");
 
@@ -324,7 +325,6 @@
     {
     QVariantMap::const_iterator i;
     qDebug("createserveralertinformative start");
-        LOGSTRING("createserveralertinformative start");
     HbDocumentLoader loader;
     bool ok = false;
     loader.load(":/xml/resources/fotasoftkeydialog.docml", &ok);
@@ -332,7 +332,7 @@
         {
         return;
         }
-    HbDialog *dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
+    m_dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
     
     HbLabel *headingString = qobject_cast<HbLabel *> (loader.findWidget(
             "lblHeaind"));
@@ -341,11 +341,10 @@
     HbLabel *contentString = qobject_cast<HbLabel *> (loader.findWidget(
             "lblContent"));
             
-    dialog->setTimeout(HbPopup::NoTimeout);
-    dialog->setDismissPolicy(HbPopup::NoDismiss);
+    m_dialog->setTimeout(HbPopup::NoTimeout);
+    m_dialog->setDismissPolicy(HbPopup::NoDismiss);
     
-    //HbAction *primaryAction = dialog->primaryAction();
-    HbAction *primaryAction = (HbAction *) dialog->actions().first();
+    HbAction *primaryAction = (HbAction *) m_dialog->actions().first();
     primaryAction->setText(hbTrId("txt_common_button_ok_single_dialog"));
 
     QObject::connect(primaryAction, SIGNAL(triggered()), this,
@@ -416,8 +415,8 @@
            }
         }
 
-    if (dialog)
-        dialog->show();
+    if (m_dialog)
+        m_dialog->show();
 
     qDebug("createserveralertinformative end");
 
@@ -432,9 +431,7 @@
 void fotadevicedialogs::fotaLSK()
     {
     qDebug("ok selected");
-    QVariantMap resultMap;
-    resultMap.insert(returnkey, EHbLSK);
-    emit deviceDialogData(resultMap);
+    emit m_Ptr->fotaDevdialogDismissed(m_DialogId,EHbLSK);
     }
 
 
@@ -447,47 +444,5 @@
 void fotadevicedialogs::fotaRSK()
     {
     qDebug("cancel selected");
-    QVariantMap resultMap;
-    resultMap.insert(returnkey, EHbRSK);
-    emit deviceDialogData(resultMap);
+    emit m_Ptr->fotaDevdialogDismissed(m_DialogId,EHbRSK);
     }
-
-
-
-// Set parameters
-bool fotadevicedialogs::setDeviceDialogParameters(
-    const QVariantMap &parameters)
-{
-    
-    return true;
-}
-
-// Get error
-int fotadevicedialogs::deviceDialogError() const
-{
-    
-    return 0;
-}
-
-
-// Close device dialog
-// ---------------------------------------------------------------------------
-// fotadevicedialogs::closeDeviceDialog
-// This slot is called when device dialog is closed due to errors.
-// ---------------------------------------------------------------------------
-//
-
-void fotadevicedialogs::closeDeviceDialog(bool byClient)
-{
-		qDebug("cancel selected");
-    emit deviceDialogClosed();
-}
-
-
-// Return display widget
-HbDialog *fotadevicedialogs::deviceDialogWidget() const
-{
-   
-    return const_cast<fotadevicedialogs*>(this);
-    //return const_cast<devicemanagementnotifierwidget*>(this);
-}
--- a/devicemgmtdialogsplugin/src/omacppinquerydialog.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/devicemgmtdialogsplugin/src/omacppinquerydialog.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -29,19 +29,50 @@
 // Initialization of member variables; Create Pin query
 // ----------------------------------------------------------------------------
 //
-omacppinquerydialog::omacppinquerydialog(const QVariantMap &parameters) :
-    devicemanagementnotifierwidget(parameters)
+omacppinquerydialog::omacppinquerydialog(const QVariantMap &parameters)
     {
     qDebug("omacppinquerydialog omacppinquerydialog() start");
+
+    // Do translation
+    QTranslator *translator = new QTranslator();
+    QString lang = QLocale::system().name();
+    QString path = "Z:/resource/qt/translations/";
+    bool fine = translator->load("deviceupdates_en.qm", path);
+    if (fine)
+        qApp->installTranslator(translator);
+
+    QTranslator *commontranslator = new QTranslator();
+
+    fine = commontranslator->load("common_" + lang, path);
+    if (fine)
+        qApp->installTranslator(commontranslator);
+
     mlineedit = 0;
     mactionok = 0;
+    mDialog = 0;
     createcppinquery(parameters);
     qDebug("omacppinquerydialog omacppinquerydialog() end");
     }
 
+
+// Set parameters
+bool omacppinquerydialog::setDeviceDialogParameters(
+    const QVariantMap &parameters)
+{
+    
+    return true;
+}
+
+// Get error
+int omacppinquerydialog::deviceDialogError() const
+{
+    
+    return 0;
+}
+
 HbDialog *omacppinquerydialog::deviceDialogWidget() const
     {
-    return const_cast<omacppinquerydialog*> (this);
+    return mDialog;
     }
 
 // ----------------------------------------------------------------------------
@@ -61,9 +92,10 @@
         
         }
 
-    HbDialog *dialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
-    dialog->setDismissPolicy(HbPopup::NoDismiss);
-    dialog->setTimeout(HbPopup::NoTimeout);
+    
+    mDialog = qobject_cast<HbDialog *> (loader.findWidget("dialog"));
+    mDialog->setDismissPolicy(HbPopup::NoDismiss);
+    mDialog->setTimeout(HbPopup::NoTimeout);
 
     int tries = -1;
 
@@ -88,12 +120,12 @@
 
     label->setPlainText(labelstring);
 
-    mactionok = (HbAction *) dialog->actions().first();
+    mactionok = (HbAction *) mDialog->actions().first();
     QString softkeyok = hbTrId("txt_common_button_ok");
     mactionok->setText(softkeyok);
     mactionok->setEnabled(false);
 
-    HbAction *actioncancel = (HbAction *) dialog->actions().at(1);
+    HbAction *actioncancel = (HbAction *) mDialog->actions().at(1);
     QString softkeyCancel = hbTrId("txt_common_button_cancel");
     actioncancel->setText(softkeyCancel);
 
@@ -105,7 +137,7 @@
     HbEditorInterface editorInterface(mlineedit);
     editorInterface.setMode(HbInputModeNumeric);
     editorInterface.setInputConstraints(HbEditorConstraintFixedInputMode);
-    dialog->setTimeout(HbPopup::NoTimeout);
+    mDialog->setTimeout(HbPopup::NoTimeout);
 
     bool bconnect = false;
     // Connection to the slot when PIN text is changed
@@ -120,9 +152,7 @@
     QObject::connect(actioncancel, SIGNAL(triggered()), this,
             SLOT(cancelSelected()));
 
-    if (dialog)
-        dialog->show();
-        
+       
     
 
     qDebug("omacppinquerydialog createcppinquery() end");
@@ -202,5 +232,19 @@
     qDebug("omacppinquerydialog::cancelSelected() end");
     }
 
+// Close device dialog
+void omacppinquerydialog::closeDeviceDialog(bool byClient)
+    {
+    Q_UNUSED(byClient);
+    mDialog->close();
+    emit deviceDialogClosed();
+    }
+
+// Return signal source (container) for the dialog
+QObject *omacppinquerydialog::signalSender() const
+{
+    return const_cast<omacppinquerydialog*>(this);
+}
+
 //  End of File
 
--- a/deviceupdatesui/deviceupdates/deviceupdates.pro	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/deviceupdates.pro	Fri Oct 15 11:39:02 2010 +0530
@@ -47,7 +47,7 @@
 		-lfotaengine	\
 		-leuser	\
 		-lflogger	\
-		-lxqutils  \
+        -lxqutils -lxqservice \
 		-lapgrfx \
 		-lcone
 	}
@@ -56,47 +56,52 @@
 DEPENDPATH += ./inc
 INCLUDEPATH += .
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+SERVICE.FILE = ./resources/service_conf.xml
+SERVICE.OPTIONS = embeddable
+libFiles.sources = xqservice.dll
+libFiles.path = "!:\sys\bin"
+DEPLOYMENT += libFiles
 # Input
-HEADERS += ./inc/dminforetrieval.h \
-./inc/nsmldmdef.h\
-./inc/nsmldmsyncappengine.h \
-./inc/nsmldmsyncdebug.h \
-./inc/nsmldmsynchandler.h\
-./inc/nsmldmsyncinternalpskeys.h \
-./inc/nsmldmsyncprivatecrkeys.h \
-./inc/nsmldmsyncprofile.h \
-./inc/nsmldmsyncprofileitem.h \
-./inc/nsmldmsyncprofilelist.h \
-./inc/nsmldmsyncutil.h \
-./inc/nsmldmuidefines.h \
-./inc/serversettingsview.h\
-./inc/dmadvancedview.h\
-./inc/settingsdataformcustomitem.h\
-./inc/dmfotaview.h\
-./inc/nsmldmdbnotifier.h	\
-./inc/deviceupdatemoniter.h	\
-./inc/deviceupdatemoniterobserver.h	\
-./inc/DeviceUpdateDebug.h \
-./inc/customviewitem.h
-
-SOURCES += ./src/dmadvancedview.cpp \
-			./src/main.cpp \
-			./src/nsmldmsyncutil.cpp \
-			./src/nsmldmsyncprofilelist.cpp \
-			./src/nsmldmsyncprofileitem.cpp \
-			./src/nsmldmsyncprofile.cpp \
-			./src/nsmldmsyncappengine.cpp \
-			./src/nsmldmsynchandler.cpp \
-			./src/dminforetrieval.cpp\
-			./src/serversettingsview.cpp\
-			./src/settingsdataformcustomitem.cpp\
-			./src/dmfotaview.cpp \
-			./src/nsmldmdbnotifier.cpp	\
-			./src/deviceupdatemoniter.cpp \
-			./src/customviewitem.cpp
-			
+HEADERS += inc/dmserviceprovider.h \
+    ./inc/dminforetrieval.h \
+    ./inc/nsmldmdef.h \
+    ./inc/nsmldmsyncappengine.h \
+    ./inc/nsmldmsyncdebug.h \
+    ./inc/nsmldmsynchandler.h \
+    ./inc/nsmldmsyncinternalpskeys.h \
+    ./inc/nsmldmsyncprivatecrkeys.h \
+    ./inc/nsmldmsyncprofile.h \
+    ./inc/nsmldmsyncprofileitem.h \
+    ./inc/nsmldmsyncprofilelist.h \
+    ./inc/nsmldmsyncutil.h \
+    ./inc/nsmldmuidefines.h \
+    ./inc/serversettingsview.h \
+    ./inc/dmadvancedview.h \
+    ./inc/settingsdataformcustomitem.h \
+    ./inc/dmfotaview.h \
+    ./inc/nsmldmdbnotifier.h \
+    ./inc/deviceupdatemoniter.h \
+    ./inc/deviceupdatemoniterobserver.h \
+    ./inc/DeviceUpdateDebug.h \
+    ./inc/customviewitem.h
+SOURCES += src/dmserviceprovider.cpp \
+    ./src/dmadvancedview.cpp \
+    ./src/main.cpp \
+    ./src/nsmldmsyncutil.cpp \
+    ./src/nsmldmsyncprofilelist.cpp \
+    ./src/nsmldmsyncprofileitem.cpp \
+    ./src/nsmldmsyncprofile.cpp \
+    ./src/nsmldmsyncappengine.cpp \
+    ./src/nsmldmsynchandler.cpp \
+    ./src/dminforetrieval.cpp \
+    ./src/serversettingsview.cpp \
+    ./src/settingsdataformcustomitem.cpp \
+    ./src/dmfotaview.cpp \
+    ./src/nsmldmdbnotifier.cpp \
+    ./src/deviceupdatemoniter.cpp \
+    ./src/customviewitem.cpp
 RESOURCES += ./resources/deviceupdates.qrc
-CONFIG += hb
+CONFIG += hb service
 TRANSLATIONS += deviceupdates.ts
    
 
--- a/deviceupdatesui/deviceupdates/inc/dmfotaview.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/inc/dmfotaview.h	Fri Oct 15 11:39:02 2010 +0530
@@ -37,9 +37,12 @@
 #include <nsmldmdef.h>
 #include <fotaengine.h>
 #include "dminforetrieval.h"
+#include "dmserviceprovider.h"
 #include "deviceupdatemoniterobserver.h"
 //_LIT( KSmlEOL,      "\n" );
-const TUid KControlPanelAppUid ={0x20025fd9};
+enum {
+    EQtHighwayLaunch = 6
+};
 
 class HbDialog;
 class HbPushButton;
@@ -50,10 +53,9 @@
     {
     Q_OBJECT
 public:
-    DMFotaView(HbMainWindow *mainWindow);
+    DMFotaView(HbMainWindow *aMainWindow,DMServiceProvider* aService=NULL);
     virtual ~DMFotaView();
     bool addFotaView();
-    //HbDialog* createDialog() const;
     void displayNoteAndDisableButtons();
     void enableButtons();
     
@@ -66,42 +68,43 @@
     void OnHelp();
     void OnExit();
 	void CheckforUpdate();
-	void AdvancedDeviceManager(bool launchadvanceview = true);	
+	void AdvancedDeviceManager(bool aLaunchadvanceview = true);	
 	void backtoMainWindow();
-	void readSection( Qt::Orientation orientation );
+	void readSection( Qt::Orientation aOrientation );
 	void ResumeUpdate();
 public:
 	void UpdateDMUI(TBool aVal);
 private:
-    void FormatList(QString val, QString str);
+    void FormatList(QString aVal, QString aStr);
     RFotaEngineSession& FotaEngineL();
     void fotaSupportEnabled();
 private:
 	HbMainWindow* mMainWindow;
-	HbView* fotaPortraitView;
-	HbView* fotaLandscapeView;
-	DmAdvancedView* profilesView;
+	HbView* mFotaPortraitView;
+	HbView* mFotaLandscapeView;
+	DmAdvancedView* mProfilesView;
 	HbAction    *mSoftKeyBackAction;
     RSyncMLSession iSession;
-    RSyncMLDevManProfile profile;
+    RSyncMLDevManProfile iProfile;
     RSyncMLDevManJob iSyncJob;
     QTranslator* mTranslator;
-    HbLabel *label,*label2,*label3,*label4;
-    QStringList list1,list2;
-    TInt i;   
-    DmInfo* mainDmInfo;
-    HbDocumentLoader loader,loader2;
-    HbPushButton *updateButton;
-    TInt fotaValue;
-    HbPushButton *advancedButton;
-    HbPushButton *updateButtonLandscape;
-    HbPushButton *advancedButtonLandscape;
+    HbLabel *mLabel,*mLabel2,*mLabel3,*mLabel4;
+    QStringList mList1,mList2;
+    TInt iCount;   
+    DMServiceProvider* mService;
+    DmInfo* iMainDmInfo;
+    HbDocumentLoader mLoader,mLoader2;
+    HbPushButton *mUpdateButton;
+    TInt iFotaValue;
+    HbPushButton *mAdvancedButton;
+    HbPushButton *mUpdateButtonLandscape;
+    HbPushButton *mAdvancedButtonLandscape;
     
     RFotaEngineSession iFotaEngine;
     RFotaEngineSession::TState iFotaState;
     
     CDeviceUpdateMoniter * iMoniter;
-    TBool Connected;
+    TBool iConnected;
     };
     
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deviceupdatesui/deviceupdates/inc/dmserviceprovider.h	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Qt Highway Service Provider for control panel
+*
+*/
+
+#ifndef DMSERVICEPROVIDER_H_
+#define DMSERVICEPROVIDER_H_
+
+#include <xqserviceprovider.h>
+
+class DMServiceProvider : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    DMServiceProvider( QObject *parent = NULL );
+    ~DMServiceProvider();
+
+    void complete();
+    
+public slots:
+    void launchDM();
+private:
+    int requestId;
+};
+
+#endif /* DMSERVICEPROVIDER_H_ */
--- a/deviceupdatesui/deviceupdates/inc/nsmldmdef.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/inc/nsmldmdef.h	Fri Oct 15 11:39:02 2010 +0530
@@ -157,6 +157,10 @@
 		EFotaUpdateDM
 };
 
+enum  {
+    EDMLaunchedFromDialer=0,
+    EDMLaunchedFromCP 
+    };
 
 #endif // NSMLDMDEF_H
 
--- a/deviceupdatesui/deviceupdates/inc/nsmldmsyncinternalpskeys.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/inc/nsmldmsyncinternalpskeys.h	Fri Oct 15 11:39:02 2010 +0530
@@ -76,6 +76,10 @@
 //Sets by DM UI & used by IAD or others
 const TUint32 KDMIdle = 0x0000000C; 
 const TUint32 KSilentSession = 0x0000000D;
+
+//PubSub key used to store the information regarding whether DM has been launched 
+// by Control panel or not
+const TUint32 KDMLaunched = 0x0000000E;
 #endif // NSMLDMSYNCINTERNALPSKEYS_H
             
 // End of File
--- a/deviceupdatesui/deviceupdates/inc/serversettingsview.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/inc/serversettingsview.h	Fri Oct 15 11:39:02 2010 +0530
@@ -52,6 +52,7 @@
 public slots:
     void backButtonClicked();
     void checkServerIdvalue();    
+    void onDialogClosed(int action);   
     void accessPointItemChanged(int apindex);
     void portItemChanged(QString port);
 
--- a/deviceupdatesui/deviceupdates/resources/devman.docml	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/resources/devman.docml	Fri Oct 15 11:39:02 2010 +0530
@@ -127,12 +127,6 @@
                             <anchoritem dst="p:update" dstEdge="RIGHT" spacing="-11.22387un" src="" srcEdge="RIGHT"/>
                             <anchoritem dst="p:advanced" dstEdge="RIGHT" spacing="-11.07463un" src="" srcEdge="RIGHT"/>
                             <anchoritem dst="p:advanced" dstEdge="BOTTOM" spacing="-1.68655un" src="" srcEdge="BOTTOM"/>
-                            <anchoritem dst="label" dstEdge="LEFT" spacing="2.53731un" src="" srcEdge="LEFT"/>
-                            <anchoritem dst="label" dstEdge="TOP" spacing="18.20896un" src="" srcEdge="TOP"/>
-                            <anchoritem dst="label_1" dstEdge="LEFT" spacing="2.38806un" src="" srcEdge="LEFT"/>
-                            <anchoritem dst="label_1" dstEdge="TOP" spacing="22.98508un" src="" srcEdge="TOP"/>
-                            <anchoritem dst="label_2" dstEdge="LEFT" spacing="2.38806un" src="" srcEdge="LEFT"/>
-                            <anchoritem dst="label_2" dstEdge="TOP" spacing="29.7015un" src="" srcEdge="TOP"/>
                             <anchoritem dst="label_3" dstEdge="TOP" spacing="34.62687un" src="" srcEdge="TOP"/>
                             <anchoritem dst="label_3" dstEdge="RIGHT" spacing="-7.01492un" src="" srcEdge="RIGHT"/>
                             <anchoritem dst="label_4" dstEdge="TOP" spacing="42.2388un" src="" srcEdge="TOP"/>
@@ -151,6 +145,12 @@
                             <anchoritem dst="label_10" dstEdge="RIGHT" spacing="-7.01492un" src="" srcEdge="RIGHT"/>
                             <anchoritem dst="label_11" dstEdge="TOP" spacing="82.38806un" src="" srcEdge="TOP"/>
                             <anchoritem dst="label_11" dstEdge="RIGHT" spacing="-7.01492un" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="label" dstEdge="TOP" spacing="18.20896un" src="" srcEdge="TOP"/>
+                            <anchoritem dst="label" dstEdge="RIGHT" spacing="-7.01492un" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="label_1" dstEdge="TOP" spacing="22.98508un" src="" srcEdge="TOP"/>
+                            <anchoritem dst="label_1" dstEdge="RIGHT" spacing="-7.01492un" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="label_2" dstEdge="TOP" spacing="29.7015un" src="" srcEdge="TOP"/>
+                            <anchoritem dst="label_2" dstEdge="RIGHT" spacing="-7.01492un" src="" srcEdge="RIGHT"/>
                         </layout>
                     </widget>
                     <enums name="verticalScrollBarPolicy" value="ScrollBarAlwaysOn"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deviceupdatesui/deviceupdates/resources/service_conf.xml	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service name="com.nokia.services.MDM"  filepath="must-not-be-empty" >
+  <description>Device Manager service</description>
+  <interface name="devicemanager" version="1.0" capabilities="">
+    <description>Launch DeviceManager</description>
+  </interface>
+</service>
\ No newline at end of file
--- a/deviceupdatesui/deviceupdates/src/deviceupdatemoniter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/deviceupdatemoniter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -26,9 +26,11 @@
     {
     FLOG(_L("CDeviceUpdateMoniter::NewL >>"));    
     CDeviceUpdateMoniter* h=new (ELeave)CDeviceUpdateMoniter;
+    CleanupStack::PushL( h );
     h->iObserver = aObserver;
     h->ConstructL();
     FLOG(_L("CDeviceUpdateMoniter::NewL <<"));
+    CleanupStack::Pop( h );
     return h;
     }
 
--- a/deviceupdatesui/deviceupdates/src/dmadvancedview.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/dmadvancedview.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -654,25 +654,19 @@
         
         // WLAN MAC
         
-        TUint KPhoneWlanSeparator (':');
-        _LIT( KWLanMACDataFormat, "%02x");  
-        // Fetch WLAN MAC address
-        TBuf<KWlanMacAddrLength> address;
-        RProperty::Get( KPSUidWlan, KPSWlanMacAddress, address );   
-        // Format fetched address
-        TBuf<KWlanMacAddrLength> wlanMACAddress;        
-        for ( TInt i( 0 ); i < address.Length(); i++ )
-            {
-            // Set separator
-            if( i > 0 )
-                {
-                wlanMACAddress.Append( KPhoneWlanSeparator );
-                }
-            // Set data
-            TBuf<50> tmp;
-            tmp.Format( KWLanMACDataFormat, address[i] );
-            wlanMACAddress.Append( tmp );
-            } 
+		TBuf8<KWlanMacAddrLength> address;
+		// Fetch WLAN MAC address
+		RProperty::Get(KPSUidWlan,KPSWlanMacAddress,address);
+		TBuf<KWlanMacAddrLength> wlanMACAddress;
+		for ( TInt i = 0; i < address.Length(); i++ )
+			{     
+			TUint16 addbyte = address[i];
+			wlanMACAddress.AppendFormat(_L("%02X:"), addbyte);
+			}
+		if  ( wlanMACAddress.Length() ) // remove trailing ':'
+			{
+			wlanMACAddress.Delete(wlanMACAddress.Length()-1, 1);
+			}			
         liststr.clear();
         item = new QStandardItem();
         val = hbTrId("txt_device_update_dblist_wlan_mac_address");
--- a/deviceupdatesui/deviceupdates/src/dmfotaview.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/dmfotaview.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -22,11 +22,8 @@
 #include <sysutil.h>
 #include <hbscrollarea.h>
 #include <etel.h>
-#include <eikenv.h>
 #include <featmgr.h>
 #include <etelmm.h>
-#include <apgtask.h>
-#include <coemain.h>
 #include <hbnotificationdialog.h>
 #include <centralrepository.h>
 #include <sysversioninfo.h>
@@ -42,13 +39,13 @@
 // DMFotaView::DMFotaView
 // -----------------------------------------------------------------------------
 //
-DMFotaView::DMFotaView(HbMainWindow *mainWindow):
-    mMainWindow(mainWindow),profilesView(NULL),Connected(EFalse)
+DMFotaView::DMFotaView(HbMainWindow *aMainWindow,DMServiceProvider* aService):
+mService(aService),mMainWindow(aMainWindow),mProfilesView(NULL),iConnected(EFalse)
 {
     qDebug("DMFotaView::DMFotaView >>");
-    fotaPortraitView=0;
-    fotaLandscapeView=0;
-    mainDmInfo=0;
+    mFotaPortraitView=NULL;
+    mFotaLandscapeView=NULL;
+    iMainDmInfo=NULL;
     qDebug("DMFotaView::DMFotaView <<");
 }
 
@@ -60,8 +57,8 @@
 DMFotaView::~DMFotaView()
 {
     qDebug("DMFotaView::~DMFotaView >>");
-    if(mainDmInfo)
-        delete mainDmInfo;
+    if(iMainDmInfo)
+        delete iMainDmInfo;
     
     if (iFotaEngine.Handle())
         iFotaEngine.Close();
@@ -86,60 +83,60 @@
         
     bool ok = false;
     QString val,val2;
-    loader.load(":/xml/devman.docml", &ok);
+    mLoader.load(":/xml/devman.docml", &ok);
     ok = false;
-    loader2.load(":/xml/devman.docml", &ok);
+    mLoader2.load(":/xml/devman.docml", &ok);
     // Exit if the file format is invalid
     Q_ASSERT_X(ok, "Device Manager", "Invalid docml file");
     
     ok=false;
-    loader.load(":/xml/devman.docml","Portrait", &ok);
+    mLoader.load(":/xml/devman.docml","Portrait", &ok);
     ok=false;
-    loader2.load(":/xml/devman.docml","Landscape", &ok);
+    mLoader2.load(":/xml/devman.docml","Landscape", &ok);
    
     // Load the view by name from the xml file
-    fotaPortraitView = qobject_cast<HbView*>(loader.findWidget("p:view"));
-    fotaLandscapeView = qobject_cast<HbView*>(loader2.findWidget("l:view"));
+    mFotaPortraitView = qobject_cast<HbView*>(mLoader.findWidget("p:view"));
+    mFotaLandscapeView = qobject_cast<HbView*>(mLoader2.findWidget("l:view"));
 
 
-    HbAction *help = qobject_cast<HbAction*> (loader.findObject("help")); 
+    HbAction *help = qobject_cast<HbAction*> (mLoader.findObject("help")); 
     help->setText(QString("txt_common_menu_help"));
     QObject::connect(help, SIGNAL(triggered()), this, SLOT(OnHelp()));
-    HbAction *exit = qobject_cast<HbAction*> (loader.findObject("exit"));
+    HbAction *exit = qobject_cast<HbAction*> (mLoader.findObject("exit"));
     exit->setText(QString("txt_common_menu_exit"));
     QObject::connect(exit, SIGNAL(triggered()), this, SLOT(OnExit()));
 
-    help = qobject_cast<HbAction*>(loader2.findObject("help"));
+    help = qobject_cast<HbAction*>(mLoader2.findObject("help"));
     help->setText(QString("txt_common_menu_help"));
     QObject::connect(help, SIGNAL(triggered()), this, SLOT(OnHelp()));
-    exit = qobject_cast<HbAction*>( loader2.findObject("exit"));
+    exit = qobject_cast<HbAction*>( mLoader2.findObject("exit"));
     exit->setText(QString("txt_common_menu_exit"));
     QObject::connect(exit, SIGNAL(triggered()), this, SLOT(OnExit()));
     
     mSoftKeyBackAction = new HbAction(Hb::BackNaviAction ,this);
     mSoftKeyBackAction->setText("Back");
-    fotaPortraitView->setNavigationAction(mSoftKeyBackAction);
-	fotaLandscapeView->setNavigationAction(mSoftKeyBackAction);
+    mFotaPortraitView->setNavigationAction(mSoftKeyBackAction);
+	mFotaLandscapeView->setNavigationAction(mSoftKeyBackAction);
     connect(mSoftKeyBackAction, SIGNAL(triggered()), this, SLOT(backtoMainWindow()));
         
     
-    i=0;
+    iCount=0;
     QString str;
     //Setting title text
-    label = qobject_cast<HbLabel*> (loader.findWidget("p:title"));
-    label2 = qobject_cast<HbLabel*> (loader2.findWidget("l:title"));
+    mLabel = qobject_cast<HbLabel*> (mLoader.findWidget("p:title"));
+    mLabel2 = qobject_cast<HbLabel*> (mLoader2.findWidget("l:title"));
     val = hbTrId("txt_device_update_subhead_device_updates");
-    label->setPlainText(val);
-    label2->setPlainText(val);
+    mLabel->setPlainText(val);
+    mLabel2->setPlainText(val);
     
     
     
-    HbScrollArea* area = qobject_cast<HbScrollArea*> (loader.findWidget("scrollArea"));
+    HbScrollArea* area = qobject_cast<HbScrollArea*> (mLoader.findWidget("scrollArea"));
     area->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOn);
     
     
-    list1 << "label" << "label_1" << "label_2" << "label_3" << "label_4" << "label_5" << "label_6"<<"label_7"<<"label_8"<<"label_9"<<"label_10"<<"label_11";
-    list2 << "label_13" << "label_14" << "label_15" << "label_16" << "label_17" << "label_18" << "label_19"<<"label_20"<<"label_21"<<"label_22"<<"label_23"<<"label_24";
+    mList1 << "label" << "label_1" << "label_2" << "label_3" << "label_4" << "label_5" << "label_6"<<"label_7"<<"label_8"<<"label_9"<<"label_10"<<"label_11";
+    mList2 << "label_13" << "label_14" << "label_15" << "label_16" << "label_17" << "label_18" << "label_19"<<"label_20"<<"label_21"<<"label_22"<<"label_23"<<"label_24";
 
 
     //Product Release
@@ -283,8 +280,8 @@
     if(iFotaState == RFotaEngineSession::EDownloadComplete || iFotaState == RFotaEngineSession::EStartingUpdate
             || iFotaState == RFotaEngineSession::EStartingDownload || iFotaState == RFotaEngineSession::EDownloadProgressing)
         {
-        label = qobject_cast<HbLabel*> (loader.findWidget("p:updatelabel"));
-        label2 = qobject_cast<HbLabel*> (loader2.findWidget("l:updatelabel"));
+        mLabel = qobject_cast<HbLabel*> (mLoader.findWidget("p:updatelabel"));
+        mLabel2 = qobject_cast<HbLabel*> (mLoader2.findWidget("l:updatelabel"));
         FotaEngineL().GetCurrentFirmwareDetailsL(Name, Version, Size);
         
         const QString
@@ -310,53 +307,53 @@
             val = hbTrId("txt_device_update_setlabel_the_last_update_1_2_mb").arg(name)
                     .arg(ver).arg(sizeMB);
             }
-        label->setPlainText(val);
-        label2->setPlainText(val);
+        mLabel->setPlainText(val);
+        mLabel2->setPlainText(val);
 		
 		val = hbTrId("txt_device_update_button_resume_update");
     
-        updateButton = qobject_cast<HbPushButton*>(loader.findWidget("p:update"));
-        updateButton->setText(val);
-        QObject::connect(updateButton, SIGNAL(clicked()), this, SLOT(ResumeUpdate()));
-        updateButtonLandscape = qobject_cast<HbPushButton*>(loader2.findWidget("l:update"));
-        updateButtonLandscape->setText(val);
-		QObject::connect(updateButtonLandscape, SIGNAL(clicked()), this, SLOT(ResumeUpdate()));
-		Connected = ETrue;
+        mUpdateButton = qobject_cast<HbPushButton*>(mLoader.findWidget("p:update"));
+        mUpdateButton->setText(val);
+        QObject::connect(mUpdateButton, SIGNAL(clicked()), this, SLOT(ResumeUpdate()));
+        mUpdateButtonLandscape = qobject_cast<HbPushButton*>(mLoader2.findWidget("l:update"));
+        mUpdateButtonLandscape->setText(val);
+		QObject::connect(mUpdateButtonLandscape, SIGNAL(clicked()), this, SLOT(ResumeUpdate()));
+		iConnected = ETrue;
         }
     else
         {
         //Setting help text for update button
-        label = qobject_cast<HbLabel*> (loader.findWidget("p:updatelabel"));
-        label2 = qobject_cast<HbLabel*> (loader2.findWidget("l:updatelabel"));
+        mLabel = qobject_cast<HbLabel*> (mLoader.findWidget("p:updatelabel"));
+        mLabel2 = qobject_cast<HbLabel*> (mLoader2.findWidget("l:updatelabel"));
         val = hbTrId("txt_device_update_setlabel_to_update_your_device_s");
-        label->setPlainText(val);
-        label2->setPlainText(val);
+        mLabel->setPlainText(val);
+        mLabel2->setPlainText(val);
         
         val = hbTrId("txt_device_update_button_update");
-        updateButton = qobject_cast<HbPushButton*>(loader.findWidget("p:update"));
-        updateButton->setText(val);
-        QObject::connect(updateButton, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
-        updateButtonLandscape = qobject_cast<HbPushButton*>(loader2.findWidget("l:update"));
-        updateButtonLandscape->setText(val);
-        QObject::connect(updateButtonLandscape, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
-        Connected = ETrue;
+        mUpdateButton = qobject_cast<HbPushButton*>(mLoader.findWidget("p:update"));
+        mUpdateButton->setText(val);
+        QObject::connect(mUpdateButton, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
+        mUpdateButtonLandscape = qobject_cast<HbPushButton*>(mLoader2.findWidget("l:update"));
+        mUpdateButtonLandscape->setText(val);
+        QObject::connect(mUpdateButtonLandscape, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
+        iConnected = ETrue;
         }
     
     val = hbTrId("txt_device_update_button_advanced");
-    advancedButton = qobject_cast<HbPushButton*>(loader.findWidget("p:advanced")); 
-    advancedButton->setText(val);
-    QObject::connect(advancedButton, SIGNAL(clicked()), this, SLOT(AdvancedDeviceManager()));
-    advancedButtonLandscape = qobject_cast<HbPushButton*>(loader2.findWidget("l:advanced"));
-    advancedButtonLandscape->setText(val);
-    QObject::connect(advancedButtonLandscape, SIGNAL(clicked()), this, SLOT(AdvancedDeviceManager()));
+    mAdvancedButton = qobject_cast<HbPushButton*>(mLoader.findWidget("p:advanced")); 
+    mAdvancedButton->setText(val);
+    QObject::connect(mAdvancedButton, SIGNAL(clicked()), this, SLOT(AdvancedDeviceManager()));
+    mAdvancedButtonLandscape = qobject_cast<HbPushButton*>(mLoader2.findWidget("l:advanced"));
+    mAdvancedButtonLandscape->setText(val);
+    QObject::connect(mAdvancedButtonLandscape, SIGNAL(clicked()), this, SLOT(AdvancedDeviceManager()));
     fotaSupportEnabled();
-    mMainWindow->addView(fotaPortraitView);
-    mMainWindow->addView(fotaLandscapeView);
+    mMainWindow->addView(mFotaPortraitView);
+    mMainWindow->addView(mFotaLandscapeView);
     
     if(mMainWindow->orientation()==Qt::Vertical)
-            mMainWindow->setCurrentView(fotaPortraitView);
+            mMainWindow->setCurrentView(mFotaPortraitView);
         else
-            mMainWindow->setCurrentView(fotaLandscapeView);
+            mMainWindow->setCurrentView(mFotaLandscapeView);
     
     iMoniter = CDeviceUpdateMoniter::NewL(this);
     //iMoniter->StartMoniter();
@@ -375,9 +372,9 @@
     qDebug("omadm DeviceManagerUi::CheckforUpdate >>");
     
     TInt profileId=NULL;
-    if(mainDmInfo==0)
+    if(iMainDmInfo==0)
         {
-        if(!profilesView)
+        if(!mProfilesView)
             {
             bool launchview = false;
             AdvancedDeviceManager(launchview);
@@ -385,9 +382,9 @@
             mainDmInfo->refreshProfileList();*/
             }
        // else 
-        mainDmInfo = profilesView->dminfo;      
+        iMainDmInfo = mProfilesView->dminfo;      
         }
-    if((profileId = mainDmInfo->DefaultFotaProfileIdL())==KErrNotFound)
+    if((profileId = iMainDmInfo->DefaultFotaProfileIdL())==KErrNotFound)
         {
 
         HbNotificationDialog* note = new HbNotificationDialog();
@@ -401,7 +398,7 @@
         }
     else
         {
-        mainDmInfo->sync(profileId);
+        iMainDmInfo->sync(profileId);
         //Connecting note to be displayed
         //Buttons to be disabled
         displayNoteAndDisableButtons();
@@ -438,10 +435,10 @@
 void DMFotaView::displayNoteAndDisableButtons()
     {
     qDebug("DMFotaView::displayNoteAndDisableButtons >>");
-    updateButton->setEnabled(false);
-    advancedButton->setEnabled(false);
-    updateButtonLandscape->setEnabled(false);
-    advancedButtonLandscape->setEnabled(false);
+    mUpdateButton->setEnabled(false);
+    mAdvancedButton->setEnabled(false);
+    mUpdateButtonLandscape->setEnabled(false);
+    mAdvancedButtonLandscape->setEnabled(false);
     HbNotificationDialog* note = new HbNotificationDialog();
     //QString val = hbTrId("txt_device_update_dpophead_device_update");
     note->setTitle(hbTrId("txt_device_update_dpophead_device_update"));
@@ -468,8 +465,8 @@
     if (!value)
         {
         fotaSupportEnabled();
-        advancedButtonLandscape->setEnabled(true);
-        advancedButton->setEnabled(true);
+        mAdvancedButtonLandscape->setEnabled(true);
+        mAdvancedButton->setEnabled(true);
         }
     qDebug("DMFotaView::enableButtons <<");
     }
@@ -482,21 +479,21 @@
 void DMFotaView::AdvancedDeviceManager(bool launchadvanceview)
  { 
     qDebug("omadm DeviceManagerUi::AdvancedDeviceManager");
-    if(!profilesView)
+    if(!mProfilesView)
         {
         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 1");
-        profilesView = new DmAdvancedView(mMainWindow,this,mainDmInfo);
+        mProfilesView = new DmAdvancedView(mMainWindow,this,iMainDmInfo);
         qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 2");
-        bool loadingok = profilesView->displayItems();
+        bool loadingok = mProfilesView->displayItems();
         if(loadingok)
             {
             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 3");
-            mMainWindow->addView(profilesView);
+            mMainWindow->addView(mProfilesView);
             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 4");
-            profilesView->setBackBehavior();  
+            mProfilesView->setBackBehavior();  
             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 5");
             if(launchadvanceview)
-            mMainWindow->setCurrentView(profilesView);
+            mMainWindow->setCurrentView(mProfilesView);
             qDebug("omadm DeviceManagerUi::AdvancedDeviceManager 6");
             }
         else
@@ -507,8 +504,8 @@
         }
     else
         {
-        profilesView->setBackBehavior();                
-        mMainWindow->setCurrentView(profilesView);   
+        mProfilesView->setBackBehavior();                
+        mMainWindow->setCurrentView(mProfilesView);   
         }
     qDebug("DMFotaView::AdvancedDeviceManager <<");
  }
@@ -521,18 +518,18 @@
 void DMFotaView::FormatList(QString val,QString str)
     {
     qDebug("DMFotaView::FormatList >>");
-    label = qobject_cast<HbLabel*> (loader.findWidget(list1[i]));
-    label2 = qobject_cast<HbLabel*> (loader2.findWidget(list2[i++]));         
-    label3 = qobject_cast<HbLabel*> (loader.findWidget(list1[i]));
-    label4 = qobject_cast<HbLabel*> (loader2.findWidget(list2[i++]));
-    label->setPlainText(val);
-    label2->setPlainText(val);
-    label3->setPlainText(str);
-    label4->setPlainText(str);
-    label->setVisible(ETrue);
-    label2->setVisible(ETrue);
-    label3->setVisible(ETrue);
-    label4->setVisible(ETrue);
+    mLabel = qobject_cast<HbLabel*> (mLoader.findWidget(mList1[iCount]));
+    mLabel2 = qobject_cast<HbLabel*> (mLoader2.findWidget(mList2[iCount++]));         
+    mLabel3 = qobject_cast<HbLabel*> (mLoader.findWidget(mList1[iCount]));
+    mLabel4 = qobject_cast<HbLabel*> (mLoader2.findWidget(mList2[iCount++]));
+    mLabel->setPlainText(val);
+    mLabel2->setPlainText(val);
+    mLabel3->setPlainText(str);
+    mLabel4->setPlainText(str);
+    mLabel->setVisible(ETrue);
+    mLabel2->setVisible(ETrue);
+    mLabel3->setVisible(ETrue);
+    mLabel4->setVisible(ETrue);
     qDebug("DMFotaView::FormatList <<");
     }
 
@@ -553,24 +550,15 @@
 void DMFotaView::backtoMainWindow()
     {
     qDebug("DMFotaView::backtoMainWindow >>");
-    QString appName = qApp->applicationName();
-    QString cpAppTitle("Control panel");
-    mMainWindow->removeView(fotaPortraitView);
-    mMainWindow->removeView(fotaLandscapeView);
-    fotaPortraitView->deleteLater();
-    fotaLandscapeView->deleteLater();
-    fotaPortraitView = NULL;
-    fotaLandscapeView = NULL;
-    if (appName == cpAppTitle)
+    if(mService)
         {
-        TApaTaskList taskList(CEikonEnv::Static()->WsSession());
-        TApaTask task = taskList.FindApp(KControlPanelAppUid);
-        if (task.Exists())
-            {
-            task.BringToForeground();
-            }
+        mService->complete();
+        connect(mService, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
         }
-    qApp->quit();
+    else
+        {
+        qApp->quit();
+        }
     qDebug("DMFotaView::backtoMainWindow <<");
     }
 
@@ -597,20 +585,20 @@
 void DMFotaView::readSection( Qt::Orientation orientation )
 {
     qDebug("DMFotaView::readSection >>");
-    if(mMainWindow->currentView() == fotaPortraitView || mMainWindow->currentView() == fotaLandscapeView)
+    if(mMainWindow->currentView() == mFotaPortraitView || mMainWindow->currentView() == mFotaLandscapeView)
         {
         if( orientation == Qt::Vertical ) {
         // reading "portrait" section
-        mMainWindow->setCurrentView(fotaPortraitView);
+        mMainWindow->setCurrentView(mFotaPortraitView);
         }
      else {
         // reading "landscape" section
-        mMainWindow->setCurrentView(fotaLandscapeView);
+        mMainWindow->setCurrentView(mFotaLandscapeView);
          }
         }
-    else if(mMainWindow->currentView()==profilesView)
+    else if(mMainWindow->currentView()==mProfilesView)
         {
-        profilesView->reLayout(orientation);
+        mProfilesView->reLayout(orientation);
         }
     qDebug("DMFotaView::readSection <<");
 
@@ -625,12 +613,12 @@
     if (aVal == 1)
         {
         qDebug("DMFotaView::aVal == 1 >>");
-        if(Connected)
+        if(iConnected)
             {
             qDebug("DMFotaView::Connected >>");
-            QObject::disconnect(updateButton,0,0,0);
-            QObject::disconnect(updateButtonLandscape,0,0,0);
-            Connected = EFalse;
+            QObject::disconnect(mUpdateButton,0,0,0);
+            QObject::disconnect(mUpdateButtonLandscape,0,0,0);
+            iConnected = EFalse;
             }
     
         iFotaState = FotaEngineL().GetState(-1);
@@ -643,12 +631,12 @@
             qDebug("CDeviceUpdateMoniter::Resume >>");
             QString value = hbTrId("txt_device_update_button_resume_update");
             //updateButton = qobject_cast<HbPushButton*>(loader.findWidget("p:update");
-            updateButton->setText(value);
-            QObject::connect(updateButton, SIGNAL(clicked()), this,SLOT(ResumeUpdate()));
+            mUpdateButton->setText(value);
+            QObject::connect(mUpdateButton, SIGNAL(clicked()), this,SLOT(ResumeUpdate()));
             //updateButtonLandscape = qobject_cast<HbPushButton*>(loader2.findWidget("l:update");
-            updateButtonLandscape->setText(value);
-		QObject::connect(updateButtonLandscape, SIGNAL(clicked()), this, SLOT(ResumeUpdate()));
-		Connected = ETrue;
+            mUpdateButtonLandscape->setText(value);
+		QObject::connect(mUpdateButtonLandscape, SIGNAL(clicked()), this, SLOT(ResumeUpdate()));
+		iConnected = ETrue;
 
 		TBuf8<80> Name;
 		TBuf8<80> Version;
@@ -680,53 +668,53 @@
         	            .arg(ver).arg(sizeMB);
 	            }
 	        
-	        label->setPlainText(val);
-	        label2->setPlainText(val);
+	        mLabel->setPlainText(val);
+	        mLabel2->setPlainText(val);
 	    }
         else
 	    {
         qDebug("DMFotaView::Update >>");
         val = hbTrId("txt_device_update_setlabel_to_update_your_device_s");
-	    label->setPlainText(val);
-	    label2->setPlainText(val);
+	    mLabel->setPlainText(val);
+	    mLabel2->setPlainText(val);
 	    val = hbTrId("txt_device_update_button_update");
-	    updateButton = qobject_cast<HbPushButton*>(loader.findWidget("p:update"));
-	    updateButton->setText(val);
-	    QObject::connect(updateButton, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
-	    updateButtonLandscape = qobject_cast<HbPushButton*>(loader2.findWidget("l:update"));
-	    updateButtonLandscape->setText(val);
-	    QObject::connect(updateButtonLandscape, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
-	    Connected = ETrue;
+	    mUpdateButton = qobject_cast<HbPushButton*>(mLoader.findWidget("p:update"));
+	    mUpdateButton->setText(val);
+	    QObject::connect(mUpdateButton, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
+	    mUpdateButtonLandscape = qobject_cast<HbPushButton*>(mLoader2.findWidget("l:update"));
+	    mUpdateButtonLandscape->setText(val);
+	    QObject::connect(mUpdateButtonLandscape, SIGNAL(clicked()), this, SLOT(CheckforUpdate()));
+	    iConnected = ETrue;
 	    }
 	}
     fotaSupportEnabled();
-    if(fotaValue == 1 && aVal == 0)
+    if(iFotaValue == 1 && aVal == 0)
     {
-    	updateButton->setEnabled(aVal);
-      updateButtonLandscape->setEnabled(aVal);
+    	mUpdateButton->setEnabled(aVal);
+    	mUpdateButtonLandscape->setEnabled(aVal);
     }
-    advancedButton->setEnabled(aVal);
-    advancedButtonLandscape->setEnabled(aVal);
+    mAdvancedButton->setEnabled(aVal);
+    mAdvancedButtonLandscape->setEnabled(aVal);
     qDebug("DMFotaView::UpdateDMUI <<");
     qDebug("DMFotaView::UpdateDMUI <<");
 }
 
 void DMFotaView::fotaSupportEnabled()
     { 
-    fotaValue = 1;	
+    iFotaValue = 1;	
     CRepository* centrep( NULL);
     TUid uidValue = {0x101F9A08}; // KCRFotaAdapterEnabled
     TInt err = KErrNone;
     TRAP(err,centrep = CRepository::NewL( uidValue)); 
     if(centrep && err == KErrNone )
     {  
-        centrep->Get( 1 , fotaValue ); // KCRFotaAdapterEnabled     
+        centrep->Get( 1 , iFotaValue ); // KCRFotaAdapterEnabled     
         delete centrep;
     }
-    if(fotaValue == 0 || fotaValue == 1)
+    if(iFotaValue == 0 || iFotaValue == 1)
         {
-        updateButton->setEnabled(fotaValue);
-        updateButtonLandscape->setEnabled(fotaValue);
+        mUpdateButton->setEnabled(iFotaValue);
+        mUpdateButtonLandscape->setEnabled(iFotaValue);
         }
     }
     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deviceupdatesui/deviceupdates/src/dmserviceprovider.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Qt Highway Service Provider for control panel
+*
+*/
+#include <qtranslator.h>
+#include "dmserviceprovider.h"
+#include "nsmldmsyncinternalpskeys.h"
+#include <hbapplication.h>
+#include <qlocale.h>
+#include <nsmldmdef.h>
+#include <e32property.h>
+#include <qdebug.h>
+// -----------------------------------------------------------------------------
+// DMServiceProvider::DMServiceProvider
+// -----------------------------------------------------------------------------
+//
+DMServiceProvider::DMServiceProvider(QObject* parent)
+: XQServiceProvider("com.nokia.services.MDM.devicemanager",parent)
+{
+    publishAll();
+}
+
+// -----------------------------------------------------------------------------
+// DMServiceProvider::~DMServiceProvider
+// -----------------------------------------------------------------------------
+//
+DMServiceProvider::~DMServiceProvider()
+{
+}
+
+// -----------------------------------------------------------------------------
+// DMServiceProvider::complete
+// -----------------------------------------------------------------------------
+//
+void DMServiceProvider::complete()
+{
+    TInt err = RProperty::Delete(KPSUidNSmlDMSyncApp, KDMLaunched);
+    qDebug()<<"dmsrvice error "<<err;
+    completeRequest(requestId,0);
+}
+
+// -----------------------------------------------------------------------------
+// DMServiceProvider::launchDM
+// -----------------------------------------------------------------------------
+//
+void DMServiceProvider::launchDM()
+{
+    TInt err = RProperty::Define(KPSUidNSmlDMSyncApp, KDMLaunched, RProperty::EInt);
+    TInt launched=EDMLaunchedFromCP;
+    RProperty::Set(KPSUidNSmlDMSyncApp, KDMLaunched, launched);
+    requestId = setCurrentRequestAsync();
+}
--- a/deviceupdatesui/deviceupdates/src/main.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/main.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -24,8 +24,6 @@
 int main(int argc, char *argv[])
 {
    HbApplication app(argc, argv);
-   //HbView* newview= new HbView();
-
    QTranslator *translator = new QTranslator();
    QString lang = QLocale::system().name();
    qDebug("OMADM Loading qm file");
@@ -48,7 +46,7 @@
    else
    		qDebug("omadm common translator loading failed");
    
-   if( argc == 2) // Launch via Control Panel
+   if( argc == EQtHighwayLaunch) // Launch via Control Panel
     {    	
     	QTranslator *cptranslator = new QTranslator();
     	fine = cptranslator->load("control_panel_" + lang, path);
@@ -64,11 +62,26 @@
     }  
 
     HbMainWindow window;
-
-    DMFotaView* view = new DMFotaView(&window);
+    DMServiceProvider* service=NULL;
+    DMFotaView* view =NULL;
+    
+    if(argc == EQtHighwayLaunch)
+        {
+        service=new DMServiceProvider();
+        view = new DMFotaView(&window,service);
+        }
+    else
+        {
+        view= new DMFotaView(&window);
+        }
     bool loadingok = view->addFotaView();
-
     window.show();
-    return app.exec();
+    TInt ret = app.exec();
+    if(argc==EQtHighwayLaunch)
+        {
+        delete service;
+        service = NULL;
+        }
+    return ret;
 }
 
--- a/deviceupdatesui/deviceupdates/src/nsmldmsynchandler.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/nsmldmsynchandler.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -234,9 +234,8 @@
 	iSyncError = aError;    
     iCheckUpdate = EFalse;        	
 
-#ifndef NO_UPDATE 
-        CRepository* centrep = NULL;
-        TRAPD( err, centrep = CRepository::NewL( KCRUidNSmlDMSyncApp ) );
+    CRepository* centrep = NULL;
+    TRAPD( err, centrep = CRepository::NewL( KCRUidNSmlDMSyncApp ) );
 	TInt profileId;
 	centrep->Get( KNSmlDMDefaultFotaProfileKey, profileId );
 	//FLOG( "CNSmlDMSyncHandler::SynchronizeCompletedL profileId = %d", profileId );
@@ -270,8 +269,8 @@
         iDialog->setHeadingWidget(new HbLabel(hbTrId("txt_device_update_title_phone_uptodate")));
         iDialog->setContentWidget(new HbLabel(hbTrId("txt_device_update_dpopinfo_your_phone_is_already_u")));
         iPrimaryAction = new HbAction();
-        iPrimaryAction->setText(hbTrId("OK"));
-	    iDialog->setPrimaryAction(iPrimaryAction);
+        iPrimaryAction->setText(hbTrId("txt_common_button_ok_single_dialog"));
+	    iDialog->addAction(iPrimaryAction);
 	    iDialog->setTimeout(HbPopup::NoTimeout);
 	    iDialog->setDismissPolicy(HbPopup::NoDismiss);
 	    iDialog->show();
@@ -279,7 +278,6 @@
             }
 
         }  
-#endif
 
 	iUseFotaProgressNote = EFalse;
     iSyncJob.Close();
--- a/deviceupdatesui/deviceupdates/src/serversettingsview.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdates/src/serversettingsview.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -147,6 +147,10 @@
     if (netauthdata.compare(hbTrId("txt_deviceupdate_setlabel_network_auth_val_yes")))
         netauthval = true;
     //check server name , server id, host addr & usrname        
+    itemlist[0]=itemlist[0].simplified();
+    itemlist[1]=itemlist[1].simplified();
+    itemlist[3]=itemlist[3].simplified();
+    itemlist[4]=itemlist[4].simplified();
     if ((itemlist[0].length() > 0) && (itemlist[1].length() > 0)
             && (itemlist[3].length() > 0) && (itemlist[4].length() > 0))
         {
@@ -174,13 +178,14 @@
                 }
             }
         if(valSet==1)
-            {
-        HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation);
+            {                
+        HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+        note->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No);
+        note->setAttribute( Qt::WA_DeleteOnClose); 
         note->setText(hbTrId(
-                "txt_device_update_dialog_enter_mandatory_field_values"));
-        note->setAttribute( Qt::WA_DeleteOnClose);         
-        note->setTimeout(HbPopup::NoTimeout);
-        note->open();
+                  "txt_device_update_info_mandatory_fields_not_filled"));       
+        note->setTimeout(HbMessageBox::NoTimeout);
+        note->open(this,SLOT(onDialogClosed(int)));
             }
         else
             {
@@ -193,18 +198,28 @@
         
         }        
     }
+void ServerSettingsView::onDialogClosed(int action)
+{
+    if (action == HbMessageBox::Yes)
+    {
+       iMainWindow->setCurrentView(serversView);
+    } 
+}
 
 void ServerSettingsView::checkServerIdvalue()
     {
     QString srvid = serverid->contentWidgetData(QString("text")).toString();
+    if(srvid != NULL)
+    {
     if(serversView->checkServerId(srvid))
         {
     serverid->setContentWidgetData(QString("text"), QString("")); 
     HbMessageBox *note= new HbMessageBox(HbMessageBox::MessageTypeInformation);
-           note->setText(hbTrId("txt_device_update_dialog_invalid_server_id")); 
+           note->setText(hbTrId("txt_device_update_title_duplicate_server_id"));
            note->setAttribute( Qt::WA_DeleteOnClose);                   
            note->setTimeout(HbPopup::NoTimeout);
            note->open();         
+        }
         }          
     }
 
--- a/deviceupdatesui/deviceupdatesplugin/deviceupdatesplugin.pro	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesplugin/deviceupdatesplugin.pro	Fri Oct 15 11:39:02 2010 +0530
@@ -30,7 +30,9 @@
 LIBS += -lcpframework \
 					-lcentralrepository \
 					-lws32 \
-					-lapgrfx
+					-lapgrfx \ 
+					-lapparc -lcone \
+					-lxqservice -lxqserviceutil -lxqutils 
 
 # Input
 HEADERS += deviceupdatesplugin.h \
--- a/deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesdata.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesplugin/inc/deviceupdatesdata.h	Fri Oct 15 11:39:02 2010 +0530
@@ -18,14 +18,19 @@
 #ifndef	DEVICEUPDATESDATA_H_
 #define	DEVICEUPDATESDATA_H_
 
-#include <QtCore/QProcess>
 #include <cpsettingformentryitemdata.h>
+#include <xqappmgr.h>
+#include <xqaiwrequest.h>
 
 _LIT( KDMUIProcess, "\\deviceupdates.exe" );
 _LIT( KDMUIName, "deviceupdates" );
 
 
 const TUid KUidSmlSyncApp = { 0x101F6DE5 };
+const TUint32 KNsmlDmUILaunch = 0x00000009;
+const QString KService("com.nokia.services.MDM"); 
+const QString KInterface("devicemanager"); 
+const QString KMethod("launchDM()");
 
 class DeviceUpdateData : public CpSettingFormEntryItemData
 {
@@ -35,17 +40,19 @@
 												const QString &text = QString(),
 												const QString &description = QString(),
 												const HbIcon &icon = HbIcon(),
-												const HbDataFormModelItem *parent = 0);
+												const HbDataFormModelItem *parent = NULL);
     void LaunchDeviceUpdatesUi();
     void CloseDeviceUpdatesUi();
     virtual ~DeviceUpdateData();
 public slots:
 	void onLaunchView();
+	void handleOk(const QVariant &result);
+	void handleError(int errorCode, const QString& errorMessage);
 private:
 	virtual CpBaseSettingView *createSettingView() const;
 	
 private:
-		QProcess *mproc;
-
+        XQApplicationManager mRequestManager;
+        QPointer<XQAiwRequest> m_currentRequest;
 };
 #endif//	DEVICEUPDATESVIEW_H_
--- a/deviceupdatesui/deviceupdatesplugin/src/deviceupdatesdata.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesplugin/src/deviceupdatesdata.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -14,37 +14,26 @@
 * Description:  Device updates data for control panel
 *
 */
-
-#include <QtCore/QProcess>
-#include <QtCore/QDir>
-#include <QtCore/QLibraryInfo>
 #include <cpsettingformitemdata.h>
 #include <apgtask.h>
 #include "deviceupdatesdata.h"
-
-
+#include <xqserviceutil.h>
 DeviceUpdateData::DeviceUpdateData(CpItemDataHelper &itemDataHelper,
-													   const QString &text /*= QString()*/,
-													   const QString &description /*= QString()*/,
-													   const HbIcon &icon /*= HbIcon()*/,
-													   const HbDataFormModelItem *parent /*= 0*/)
+													   const QString &text,
+													   const QString &description,
+													   const HbIcon &icon,
+													   const HbDataFormModelItem *parent)
 													   : CpSettingFormEntryItemData(itemDataHelper,
 													   text,
 													   description,
 													   icon,
 													   parent)
 {
-	mproc = NULL;
 }
 
 DeviceUpdateData::~DeviceUpdateData()
 {
 	CloseDeviceUpdatesUi();
-	if (mproc)
-	{
-		delete mproc;
-		mproc = NULL;
-	}
 }
 
 // -----------------------------------------------------------------------------
@@ -52,10 +41,10 @@
 // -----------------------------------------------------------------------------
 //
 void DeviceUpdateData::LaunchDeviceUpdatesUi()
-	{	
-		
-		RWsSession ws;
-    User::LeaveIfError( ws.Connect() );
+	{
+    qDebug("DeviceUpdateData::LaunchDeviceUpdatesUi >>");
+    RWsSession ws;
+    qt_symbian_throwIfError( ws.Connect() );
     CleanupClosePushL( ws );
     // Find the task with uid
     TApaTaskList taskList(ws);
@@ -66,40 +55,83 @@
     }
     else
     {
- 				// Create DM UI Process
-    		if(!mproc)
-    			mproc = new QProcess();
-    		if(mproc->state() != QProcess::Running)
-    		{
-    			QString app = QLatin1String("deviceupdates");
-    			QStringList args;
-    			args<< QLatin1String("-cp");
-    			mproc->start(app, args);
-    			mproc->waitForStarted();
-    		}     
-    }
-    CleanupStack::PopAndDestroy();  // ws    		
+        qDebug("DeviceUpdateData::LaunchDeviceUpdatesUi >> embedding");
+        QScopedPointer<XQAiwRequest> requester (mRequestManager.create(KService,KInterface,KMethod,true)); //false for NON-EMBEDDED 
+        qDebug("DeviceUpdateData::LaunchDeviceUpdatesUi >> embed end");
+        connect(requester.data(), SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+        connect(requester.data(), SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
+        if (!(requester.isNull())) 
+            {
+            m_currentRequest = requester.data();
+            requester->setSynchronous(false);
+            bool serviceRequestOk = requester->send();
+            if (serviceRequestOk)
+                {
+                m_currentRequest = requester.take();
+                }
+            else
+                {
+                // On a controlled error Qt Highway should call requestError,
+                // so clean scoped pointer here.
+                requester.take();
+                }
+            }  
+        }
+    CleanupStack::PopAndDestroy();  // ws    
+    qDebug("DeviceUpdateData::LaunchDeviceUpdatesUi >> end");	
 	}
 
 // ---------------------------------------------------------------------------------------------
-// DeviceUpdateData::CloseDmUi
+// DeviceUpdateData::CloseDeviceUpdatesUi
 // closes DM Ui
 // ---------------------------------------------------------------------------------------------	
 void DeviceUpdateData:: CloseDeviceUpdatesUi()
 {
-	if(( mproc )&&(mproc->state() == QProcess::Running))
-  	{
-    			mproc->close();
-    }
-
+    if(m_currentRequest)
+        {
+        delete m_currentRequest;
+        m_currentRequest = NULL;
+        }
 }	
 
+// ---------------------------------------------------------------------------------------------
+// DeviceUpdateData::onLaunchView
+// ---------------------------------------------------------------------------------------------
 void DeviceUpdateData::onLaunchView()
 {
 	LaunchDeviceUpdatesUi();
 }
 
+// ---------------------------------------------------------------------------------------------
+// DeviceUpdateData::createSettingView
+// ---------------------------------------------------------------------------------------------
 CpBaseSettingView *DeviceUpdateData::createSettingView() const
 {
-		return 0;
+		return NULL;
 }
+
+// ---------------------------------------------------------------------------------------------
+// DeviceUpdateData::handleOk
+// Handles when request completes successfully
+// ---------------------------------------------------------------------------------------------
+void DeviceUpdateData::handleOk(const QVariant &returnValue)
+{
+    if(m_currentRequest)
+        {
+        delete m_currentRequest;
+        m_currentRequest = NULL;
+        }
+}
+
+// ---------------------------------------------------------------------------------------------
+// DeviceUpdateData::handleError
+// Handles when request returns with an error
+// ---------------------------------------------------------------------------------------------
+void DeviceUpdateData::handleError(int error, const QString& errorMessage)
+{   
+    if(m_currentRequest)
+        {
+        delete m_currentRequest;
+        m_currentRequest = NULL;
+        }
+}
--- a/deviceupdatesui/deviceupdatesqtsp/deviceupdatesqtsp.pro	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesqtsp/deviceupdatesqtsp.pro	Fri Oct 15 11:39:02 2010 +0530
@@ -50,7 +50,9 @@
 
 LIBS += -lhbcore \
         -lxqservice \
-        -lxqserviceutil
+        -lxqserviceutil \
+        -lapgrfx \ 
+	-lapparc -lcone 
 
 SERVICE.FILE += ./resources/service_conf.xml
 SERVICE.OPTIONS = embeddable
--- a/deviceupdatesui/deviceupdatesqtsp/inc/DmTelServiceHandler.h	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesqtsp/inc/DmTelServiceHandler.h	Fri Oct 15 11:39:02 2010 +0530
@@ -11,7 +11,7 @@
  *
  * Contributors:
  *
- * Description:
+ * Description: Service Handler for dialer launch of DM
  *
  */
  
@@ -24,11 +24,20 @@
 
 _LIT( KDMUIProcess, "\\deviceupdates.exe" );
 
+enum  {
+    EDMLaunchedFromDialer=0,
+    EDMLaunchedFromCP 
+    };
+
+const TUid KControlPanelAppUid ={0x20025fd9};
+const TUid KPSUidNSmlDMSyncApp = {0x101f6de5};
+const TUint32 KDMLaunched = {0x0000000E};
+
 class DmTelServiceHandler : public XQServiceProvider
 {
     Q_OBJECT
 public:
-    DmTelServiceHandler(QObject *parent = 0);
+    DmTelServiceHandler(QObject *parent = NULL);
     ~DmTelServiceHandler();
 
 public slots:
--- a/deviceupdatesui/deviceupdatesqtsp/src/DmTelServiceHandler.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesqtsp/src/DmTelServiceHandler.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -11,12 +11,16 @@
  *
  * Contributors:
  *
- * Description:
+ * Description: Service Handler for dialer launch of DM
  *
  */
 
+#include <hbapplication.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <e32property.h>
+#include <qdebug.h>
 #include "DmTelServiceHandler.h"
-#include <hbapplication.h>
 
 DmTelServiceHandler::DmTelServiceHandler(QObject *parent):
     XQServiceProvider("com.nokia.services.devicemanager", parent)
@@ -29,15 +33,48 @@
 }
 
 void DmTelServiceHandler::showVersionNumber()
-{
-// Create DM UI Process
-RProcess rp;
-TInt err = rp.Create(KDMUIProcess,KNullDesC);
-User::LeaveIfError(err);  
-rp.SetPriority(EPriorityForeground);
-rp.Resume();    // logon OK - start the server
+    {
+    qDebug("DmTelServiceHandler::showVersionNumber >> ");
+    // Create DM UI Process
+    RWsSession ws;
+    User::LeaveIfError(ws.Connect());
+    CleanupClosePushL(ws);
+    // Find the task with uid
+    TApaTaskList taskList(ws);
+    TApaTask task = taskList.FindApp(KPSUidNSmlDMSyncApp);
+    TInt dmLaunch=NULL;
+    TInt err = NULL;
+    RProperty::Get(KPSUidNSmlDMSyncApp, KDMLaunched, dmLaunch);
+    if (task.Exists())
+        {
+        if (dmLaunch == EDMLaunchedFromDialer)
+            {
+            task.BringToForeground();
+            }
+        else if(dmLaunch == EDMLaunchedFromCP)
+            {
+            TApaTask task1 = taskList.FindApp(KControlPanelAppUid);
+            if (task1.Exists())
+                {
+                task1.BringToForeground();
+                }
+            }
+        }
+    else
+        {
+        RProcess rp;
+        err = rp.Create(KDMUIProcess, KNullDesC);
+        qDebug()<<"process creation error "<<err;
+        rp.SetPriority(EPriorityForeground);
+        rp.Resume(); // logon OK - start the server
+        // quit the service provider app.
+        rp.Close();
+        }
+    int requestId = setCurrentRequestAsync();
+    CleanupStack::PopAndDestroy(); //for ws
 
-// quit the service provider app.
-//QCoreApplication::quit();	
-QCoreApplication::exit(0);		  
+    completeRequest(requestId,0);
+    connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+    //QApplication::exit(0);
+	qDebug("DmTelServiceHandler::showVersionNumber >> end");
 }
--- a/deviceupdatesui/deviceupdatesqtsp/src/main.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/deviceupdatesui/deviceupdatesqtsp/src/main.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -20,7 +20,7 @@
 
 int main(int argc, char **argv)
 {
-    HbApplication a( argc, argv );
+    QApplication a( argc, argv, false );
     DmTelServiceHandler srvcHndlr;
     return a.exec();
 }
--- a/omacpadapters/MbxNbrAdapter/Data/WPMbxNbrAdapterResource.rss	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Resource file.
-*
-*/
-
-
-//  INCLUDES
-#include    <badef.rh>
-#include    <mailboxadapter.loc>
-
-//  RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-// Mailbox number adapter title resource.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE LBUF r_mailbox_number_adapter_title
-	{
-	txt = qtn_op_head_mailbox;
-	}
-
-// End of file
--- a/omacpadapters/MbxNbrAdapter/Group/MbxNbrAdapter.mmp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/MbxNbrAdapter/Group/MbxNbrAdapter.mmp	Fri Oct 15 11:39:02 2010 +0530
@@ -37,25 +37,21 @@
 TARGET wpmbxnbradapter.rsc
 END
 
-START RESOURCE WPMbxNbrAdapterResource.rss
-HEADER
-TARGET wpmbxnbradapterresource.rsc
-TARGETPATH RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
 USERINCLUDE     .
 USERINCLUDE     ../Inc
 USERINCLUDE     ../../bld
 
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
 
 LIBRARY         euser.lib
 LIBRARY         provisioningengine.lib
 LIBRARY         CommonEngine.lib
 LIBRARY       	vmbxengine.lib
 LIBRARY 				centralrepository.lib
+LIBRARY       hbcore.lib hbwidgets.lib
 DEBUGLIBRARY    flogger.lib
 
 
--- a/omacpadapters/MbxNbrAdapter/Group/bld.inf	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/MbxNbrAdapter/Group/bld.inf	Fri Oct 15 11:39:02 2010 +0530
@@ -1,2 +1,30 @@
+/*
+* Copyright (c) 2001-2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for MbxNbrAdapter CP adapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
 PRJ_MMPFILES
-MbxNbrAdapter.mmp
\ No newline at end of file
+MbxNbrAdapter.mmp
+
+PRJ_TESTMMPFILES
--- a/omacpadapters/MbxNbrAdapter/Src/MbxNbrAdapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/MbxNbrAdapter/Src/MbxNbrAdapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -20,7 +20,6 @@
 #include    <f32file.h>
 #include    <CWPCharacteristic.h>
 #include    <CWPParameter.h>
-#include    <wpmbxnbradapterresource.rsg>
 #include    <cvoicemailbox.h>
 #include 		<cvoicemailboxentry.h>
 #include    <commonphoneparser.h>
@@ -30,6 +29,7 @@
 #include    "WPAdapterUtil.h"
 #include    "MbxNbrAdapter.h"
 #include    "ProvisioningDebug.h"
+#include <hbtextresolversymbian.h>
 
 // CONSTANTS
 #if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw
@@ -44,6 +44,9 @@
 _LIT( KVideoSupportTypeTrue, "TRUE" );
 _LIT( KVideoSupportTypeFalse, "FALSE" );
 _LIT( KMailboxAppId, "w9027" );        // From OMA provisioning registration document
+_LIT( KMailboxResourceFileName, "deviceupdates_" );	
+_LIT( KMailboxResourceFilePath, "z:/resource/qt/translations/" );
+
 const TInt KSettingsGranularity = 2;
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -68,13 +71,11 @@
     {
     FLOG( _L( "[Provisioning] CMbxNbrAdapter::ConstructL:" ) );
     
-    TFileName fileName;
-    Dll::FileName( fileName );
-    iTitle = WPAdapterUtil::ReadHBufCL( fileName,
-                                        KAdapterName,
-                                        R_MAILBOX_NUMBER_ADAPTER_TITLE );
-                                        
-    FLOG( _L( "[Provisioning] CMbxNbrAdapter::ConstructL: Done" ) );
+    TBool result = HbTextResolverSymbian::Init(KMailboxResourceFileName, KMailboxResourceFilePath );
+    _LIT(KMailboxAdapter, "txt_device_update_dblist_mailbox_settings");
+    iTitle = HbTextResolverSymbian::LoadL(KMailboxAdapter);	                                           
+   
+     FLOG( _L( "[Provisioning] CMbxNbrAdapter::ConstructL: Done " ));
     }
 
 // -----------------------------------------------------------------------------
--- a/omacpadapters/MbxNbrAdapter/loc/MailboxAdapter.loc	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*     This is a localisation file for MediaSettings
-*     A .loc file is the one and only place where the logical strings
-*     to be localised are defined. 
-*
-*/
-
-
-
-// LOCALISATION STRINGS
-
-//d: Summary text for mailbox settings
-//l: popup_info_list_pane_t2/opt1
-//
-#define qtn_op_head_mailbox "Mailbox settings"
-
-// End of File
--- a/omacpadapters/StreamingAdapter/Data/WPStreamingAdapterResource.rss	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Resource file.
-*
-*/
-
-
-//  INCLUDES
-#include    <badef.rh>
-#include    <streamingadapter.loc>
-
-
-RESOURCE LBUF r_streaming_adapter_title
-	{
-	txt = qtn_op_head_streaming;
-	}
-
-// End of file
--- a/omacpadapters/StreamingAdapter/Group/StreamingAdapter.mmp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/StreamingAdapter/Group/StreamingAdapter.mmp	Fri Oct 15 11:39:02 2010 +0530
@@ -37,26 +37,21 @@
 TARGET wpstreamingadapter.rsc
 END
 
-START RESOURCE WPStreamingAdapterResource.rss
-HEADER
-TARGET wpstreamingadapterresource.rsc
-TARGETPATH RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
-
 USERINCLUDE     .
 USERINCLUDE     ../Inc
 USERINCLUDE     ../../bld
 
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
 
 LIBRARY         euser.lib
 LIBRARY         provisioningengine.lib
 LIBRARY         mpsettengine.lib
 LIBRARY         cmmanager.lib
 LIBRARY         commdb.lib
+LIBRARY       hbcore.lib hbwidgets.lib
 DEBUGLIBRARY    flogger.lib
 
 
--- a/omacpadapters/StreamingAdapter/Group/bld.inf	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/StreamingAdapter/Group/bld.inf	Fri Oct 15 11:39:02 2010 +0530
@@ -1,2 +1,30 @@
+/*
+* Copyright (c) 2001-2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for Streaming CP adapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
 PRJ_MMPFILES
-StreamingAdapter.mmp
\ No newline at end of file
+StreamingAdapter.mmp
+
+PRJ_TESTMMPFILES
--- a/omacpadapters/StreamingAdapter/Src/Streamingadapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/StreamingAdapter/Src/Streamingadapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -20,13 +20,15 @@
 #include    <f32file.h>
 #include    <CWPCharacteristic.h>
 #include    <CWPParameter.h>
-#include    <wpstreamingadapterresource.rsg>
 #include    <mpsettingsmodel.h>
 #include    <cmconnectionmethoddef.h>
 #include    <cmmanagerext.h>
 #include    "WPAdapterUtil.h"
 #include    "StreamingAdapter.h"
 #include    "ProvisioningDebug.h"
+#include <hbtextresolversymbian.h>
+_LIT( KStreamingResourceFileName, "deviceupdates_" );	
+_LIT( KStreamingResourceFilePath, "z:/resource/qt/translations/" );
 
 // CONSTANTS
 #if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw
@@ -84,13 +86,9 @@
 void CStreamingAdapter::ConstructL()
     {
     FLOG( _L( "[Provisioning] CStreamingAdapter::ConstructL:" ) );
-    
-    TFileName fileName;
-    Dll::FileName( fileName );
-    iTitle = WPAdapterUtil::ReadHBufCL( fileName,
-                                        KAdapterName,
-                                        R_STREAMING_ADAPTER_TITLE );
-                                        
+    TBool result = HbTextResolverSymbian::Init(KStreamingResourceFileName, KStreamingResourceFilePath );
+    _LIT(KStreamingAdapter, "txt_device_update_dblist_streaming_settings");
+		iTitle = HbTextResolverSymbian::LoadL(KStreamingAdapter);	                                        
     FLOG( _L( "[Provisioning] CStreamingAdapter::ConstructL: Done" ) );
     }
 
--- a/omacpadapters/StreamingAdapter/loc/StreamingAdapter.loc	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*     This is a localisation file for MediaSettings
-*     A .loc file is the one and only place where the logical strings
-*     to be localised are defined. 
-*
-*/
-
-
-
-// LOCALISATION STRINGS
-
-//d: Summary text for streaming settings
-//l: popup_info_list_pane_t2/opt1
-//
-#define qtn_op_head_streaming "Streaming settings"
-
-// End of File
--- a/omacpadapters/WAPAdapter/Data/WPWAPAdapterResource.rss	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2002 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Resource file.
-*
-*/
-
-
-
-//  INCLUDES
-#include <badef.rh>
-#include <provisioning.loc>
-
-// Rich text labels
-
-RESOURCE LBUF r_qtn_op_head_browser
-    { 
-    txt = qtn_op_head_browser; 
-    }
-
-RESOURCE LBUF r_qtn_sm_mms_accesspoints
-    { 
-    txt = qtn_sm_mms_accesspoints; 
-    }
-
-RESOURCE LBUF r_qtn_sm_wapap_name
-    { 
-    txt = qtn_sm_wapap_name; 
-    }
-
-RESOURCE LBUF r_qtn_sm_bookmark_name
-    { 
-    txt = qtn_sm_bookmark_name; 
-    }
-
-RESOURCE LBUF r_qtn_sm_bookmarks
-    { 
-    txt = qtn_sm_bookmarks;
-    }
--- a/omacpadapters/WAPAdapter/Group/WPWAPAdapter.mmp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Group/WPWAPAdapter.mmp	Fri Oct 15 11:39:02 2010 +0530
@@ -45,17 +45,12 @@
 TARGET wpwapadapter.rsc
 END
 
-START RESOURCE WPWAPAdapterResource.rss
-HEADER
-TARGET wpwapadapterresource.rsc
-TARGETPATH RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
 USERINCLUDE     ../Inc ../Group ../../bld
 
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
 
 LIBRARY         euser.lib 
 LIBRARY         provisioningengine.lib
@@ -64,7 +59,7 @@
 LIBRARY         commdb.lib
 LIBRARY         CommonEngine.lib
 LIBRARY         centralrepository.lib
-
+LIBRARY       hbcore.lib hbwidgets.lib
 DEBUGLIBRARY    flogger.lib
 
 #ifdef __MESSAGING_API_V2__
--- a/omacpadapters/WAPAdapter/Group/bld.inf	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Group/bld.inf	Fri Oct 15 11:39:02 2010 +0530
@@ -1,2 +1,30 @@
+/*
+* Copyright (c) 2001-2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for WAPAdapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
 PRJ_MMPFILES
-WPWAPAdapter.mmp
\ No newline at end of file
+WPWAPAdapter.mmp
+
+PRJ_TESTMMPFILES
--- a/omacpadapters/WAPAdapter/Src/CWPWAPAdapterBase.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Src/CWPWAPAdapterBase.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -25,7 +25,6 @@
 #include <CWPAdapter.h>
 #include <CWPCharacteristic.h>
 #include <CWPParameter.h>
-#include <wpwapadapterresource.rsg>
 #include "CWPWAPItemBAse.h"
 #include "CWPWAPAdapterBase.h"
 #include "WPWAPDebug.h"
--- a/omacpadapters/WAPAdapter/Src/CWPWAPBookmarkItem.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Src/CWPWAPBookmarkItem.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -21,7 +21,6 @@
 #include <e32base.h>
 #include <CWPCharacteristic.h>
 #include <CWPParameter.h>
-#include <wpwapadapterresource.rsg>
 #include <CWPAdapter.h>
 #include "CWPWAPBookmarkItem.h"
 #include "WPWAPUtil.h"
--- a/omacpadapters/WAPAdapter/Src/CWPWAPBrowserAdapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Src/CWPWAPBrowserAdapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -29,9 +29,11 @@
 #include "WPWAPItemFactory.h"
 #include "WPWAPUtil.h"
 #include "WPWAPDebug.h"
-
+#include <hbtextresolversymbian.h>
 // CONSTANTS
 _LIT( KBrowserAppID, "w2" );
+_LIT( KBrowserResourceFileName, "deviceupdates_" );	
+_LIT( KBrowserResourceFilePath, "z:/resource/qt/translations/" );
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -54,11 +56,21 @@
     {
     BaseConstructL();
 
-    iTitle = WPWAPUtil::ReadHBufCL( R_QTN_OP_HEAD_BROWSER );
-    iBookmarkTitle = WPWAPUtil::ReadHBufCL( R_QTN_SM_BOOKMARKS );
-    iDefaultName = WPWAPUtil::ReadHBufCL( R_QTN_SM_WAPAP_NAME );
-    iDefaultBookmarkName = WPWAPUtil::ReadHBufCL( R_QTN_SM_BOOKMARK_NAME );
-    }
+    TBool result = HbTextResolverSymbian::Init(KBrowserResourceFileName, KBrowserResourceFilePath );
+    
+    _LIT(KBrowserAdapter, "txt_device_update_dblist_browser_settings");
+    iTitle = HbTextResolverSymbian::LoadL(KBrowserAdapter);
+
+    _LIT(KBookmarkTitle, "txt_device_update_dblist_bookmark");
+    iBookmarkTitle = HbTextResolverSymbian::LoadL(KBookmarkTitle);
+    
+     _LIT(KDefaultName, "txt_device_update_dblist_wap_access_point");
+    iDefaultName = HbTextResolverSymbian::LoadL(KDefaultName);
+    
+     _LIT(KDefaultBookmarkName, "txt_device_update_dblist_wap_access_point");
+    iDefaultBookmarkName = HbTextResolverSymbian::LoadL(KDefaultBookmarkName);
+
+     }
 
 // -----------------------------------------------------------------------------
 // CWPWAPBrowserAdapter::NewL
--- a/omacpadapters/WAPAdapter/Src/CWPWAPItemBAse.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Src/CWPWAPItemBAse.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -214,7 +214,10 @@
     if( !iCmManager )
         {
         iCmManager = new RCmManagerExt;
-        iCmManager->OpenL();
+        if( !iCmManager )
+        	User::Leave( KErrNoMemory );
+        else	
+        	iCmManager->OpenL();        
         }
     }
 
--- a/omacpadapters/WAPAdapter/Src/CWPWAPMMSAdapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/WAPAdapter/Src/CWPWAPMMSAdapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -23,13 +23,15 @@
 #include <CWPAdapter.h>
 #include <CWPCharacteristic.h>
 #include <CWPParameter.h>
-#include <wpwapadapterresource.rsg>
 #include "MWPWAPItemBase.h"
 #include "WPWAPUtil.h"
 #include "WPWAPItemFactory.h"
+#include <hbtextresolversymbian.h>
 
 // CONSTANTS
 _LIT( KMMSAppID, "w4" );
+_LIT( KMMSResourceFileName, "deviceupdates_" );	
+_LIT( KMMSResourceFilePath, "z:/resource/qt/translations/" );
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -51,9 +53,14 @@
 void CWPWAPMMSAdapter::ConstructL()
     {
     BaseConstructL();
+    
+    TBool result = HbTextResolverSymbian::Init(KMMSResourceFileName, KMMSResourceFilePath);
+    _LIT(MMSAdapter, "txt_device_update_dblist_multimedia_access_pts");
+    iTitle = HbTextResolverSymbian::LoadL(MMSAdapter);	
+		
+    _LIT(MMSDefaultAdapter, "txt_device_update_dblist_wap_access_point");
+    iTitle = HbTextResolverSymbian::LoadL(MMSDefaultAdapter);
 
-    iTitle = WPWAPUtil::ReadHBufCL( R_QTN_SM_MMS_ACCESSPOINTS );
-    iDefaultName = WPWAPUtil::ReadHBufCL( R_QTN_SM_WAPAP_NAME );
     }
 
 // -----------------------------------------------------------------------------
--- a/omacpadapters/accesspointadapter/Src/CWPAPAdapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/accesspointadapter/Src/CWPAPAdapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -23,7 +23,6 @@
 
 #include <CWPCharacteristic.h>
 #include <commdb.h>
-#include <wpapadapterresource.rsg>
 #include <featmgr.h>					// Feature manager
 #include "WPAPUtil.h"
 #include "CWPAPAccesspointItem.h"
@@ -36,6 +35,11 @@
 #include <cmmanagerext.h>
 #include <cmconnectionmethodext.h>
 #include <WPAdapterUtil.h>
+#include <hbtextresolversymbian.h>
+
+_LIT( KAPResourceFileName, "deviceupdates_" );	
+_LIT( KAPResourceFilePath, "z:/resource/qt/translations/" );
+
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -61,8 +65,13 @@
 	{
 	FLOG( _L( "[AccesspointAdapter] CWPAPAdapter::ConstructL:" ) );
 	
-	iTitle = WPAPUtil::ReadHBufCL( R_QTN_SM_WML_ACCESSPOINTS );
-	iDefaultName = WPAPUtil::ReadHBufCL( R_QTN_SM_WAPAP_NAME );
+	TBool result = HbTextResolverSymbian::Init(KAPResourceFileName, KAPResourceFilePath );
+	
+  _LIT(KAPAdapter, "txt_device_update_dblist_access_points");
+	iTitle = HbTextResolverSymbian::LoadL(KAPAdapter);	                                        
+    
+  _LIT(KWAPDefaultAdapter, "txt_device_update_dblist_wap_access_point");
+	iDefaultName = HbTextResolverSymbian::LoadL(KWAPDefaultAdapter);
 
 	FeatureManager::InitializeLibL();
 	
--- a/omacpadapters/accesspointadapter/Src/CWPAPNapdef.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/accesspointadapter/Src/CWPAPNapdef.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -23,7 +23,6 @@
 #include "CWPAPNapdef.h"
 #include <CWPCharacteristic.h>
 #include <CWPParameter.h>
-#include <wpapadapterresource.rsg>
 #include <featmgr.h>
 #include <WPAdapterUtil.h>
 #include "CWPAPAccesspointItem.h"
@@ -612,16 +611,20 @@
 			    if(aCharacteristic.Name().Compare( KEAP ) == 0)
 			        {
                     CEapTypeElement* newEap = new (ELeave) CEapTypeElement;
+                    CleanupStack::PushL( newEap );
                     newEap->iEAPSettings = new (ELeave) EAPSettings;
                	    newEap->iCertificate = new (ELeave) EapCertificateEntry;
                     iEapTypeArray.AppendL(newEap);
+                    CleanupStack::Pop(newEap);
 			        }
 			    else if(aCharacteristic.Name().Compare( SECSSID ) == 0)
 			        {
                     SECssID* newsecSSID = new (ELeave) SECssID;
+                    CleanupStack::PushL( newsecSSID );
                     newsecSSID->iSSSID = NULL;
                     newsecSSID->iSUSSID = NULL;
                     iSecSSID.AppendL(newsecSSID);
+                    CleanupStack::Pop(newsecSSID);
 			        }
     
 			    aCharacteristic.AcceptL( *this );
--- a/omacpadapters/accesspointadapter/group/WPAPAdapter.mmp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/accesspointadapter/group/WPAPAdapter.mmp	Fri Oct 15 11:39:02 2010 +0530
@@ -48,18 +48,12 @@
 TARGET WPAPAdapter.rsc
 END
 
-START RESOURCE WPAPAdapterResource.rss
-HEADER
-TARGET WPAPAdapterResource.rsc
-TARGETPATH RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END  
-
-
 USERINCLUDE     ../Inc
 USERINCLUDE     ../../bld
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
 
 LIBRARY         euser.lib
 LIBRARY         ProvisioningEngine.lib
@@ -70,6 +64,7 @@
 LIBRARY		cmmanager.lib
 LIBRARY		eaptools.lib
 
+LIBRARY       hbcore.lib hbwidgets.lib
 DEBUGLIBRARY    flogger.lib     // Only in debug builds
 
 // End of File
--- a/omacpadapters/accesspointadapter/group/bld.inf	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/accesspointadapter/group/bld.inf	Fri Oct 15 11:39:02 2010 +0530
@@ -26,9 +26,6 @@
 //../rom/WPAPAdapter.iby	CORE_MW_LAYER_IBY_EXPORT_PATH(WPAPAdapter.iby) 
 //../rom/WPAPAdapterResources.iby	LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(WPAPAdapterResources.iby) 
 
-// export localised loc file
-../loc/WPAPAdapter.loc        MW_LAYER_LOC_EXPORT_PATH(wpapadapter.loc)
-
 PRJ_MMPFILES
 WPAPAdapter.mmp
 
--- a/omacpadapters/accesspointadapter/loc/WPAPAdapter.loc	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   This is a localisation file for AccesspointAdapter
-*
-*/
-
-
-
-
-// LOCALISATION STRINGS
-
-//d: Summary text for access points
-//l: popup_info_list_pane_t2/opt1
-//r: 5.0 
-
-#define qtn_sm_wml_accesspoints "Access points:"
-
-//d:This is the default name for new WAP access point. 
-//l:query_popup_data_pane_t1/opt4
-//r: 5.0
-
-#define qtn_sm_wapap_name "WAP access point"
-
-// End of File
--- a/omacpadapters/bld/bld.inf	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/bld/bld.inf	Fri Oct 15 11:39:02 2010 +0530
@@ -19,14 +19,10 @@
 DEFAULT   
 PRJ_EXPORTS
 ../rom/ProvisioningAdapter.iby			CORE_APP_LAYER_IBY_EXPORT_PATH(provisioningAdapter.iby)
-../rom/ProvisioningAdapterResources.iby		LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(provisioningAdapterresources.iby)
-
-../MbxNbrAdapter/loc/MailboxAdapter.loc		MW_LAYER_LOC_EXPORT_PATH(mailboxadapter.loc)
-../accesspointadapter/loc/WPAPAdapter.loc	MW_LAYER_LOC_EXPORT_PATH(WPAPAdapter.loc)
-../StreamingAdapter/loc/StreamingAdapter.loc	MW_LAYER_LOC_EXPORT_PATH(streamingadapter.loc)
 
 
 #include "../accesspointadapter/group/bld.inf"
 #include "../MbxNbrAdapter/Group/bld.inf"
 #include "../StreamingAdapter/Group/bld.inf"
-#include "../WAPAdapter/Group/bld.inf"
\ No newline at end of file
+#include "../WAPAdapter/Group/bld.inf"
+#include "../cpdestinationnwadapter/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/data/2000b4af.rss	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource definitions for project wpdestinationnwadapter
+*
+*/
+
+
+
+#include <registryinfov2.rh>
+#include "wpdestinationnwadapteruids.h"
+
+// ---------------------------------------------------------------------------
+// theInfo
+// Resource defining the Destination network adapter plugin.
+// ---------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2;
+    dll_uid = KDestinationNetworkAdapterDllUid3;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KProvisioningAdapterInterface;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KDestinationNetworkAdapterUid;
+                    version_no = 1;
+                    display_name = "Destination Network Provisioning Adapter||Copyright © 2007 Nokia Corporation.";
+                    default_data = "";
+                    opaque_data = "10";
+                    rom_only = 1;
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/group/bld.inf	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2001-2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for CP Destination Adapter
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+wpdestinationnwadapter.mmp
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/group/wpdestinationnwadapter.mmp	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2007-2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   This file provides the information required for building the
+*                whole of cwpdestinationnwadapter.dll.
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          wpdestinationnwadapter.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x2000B4AF
+
+OPTION GCC  -save-temps
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          cwpdestinationnwadapter.cpp
+SOURCE          cwpdestinationnwitem.cpp
+SOURCE          wpdestinationnwadaptergroupproxy.cpp
+
+SOURCEPATH      ../data
+
+START RESOURCE 2000b4af.rss
+TARGET wpdestinationnwadapter.rsc
+END
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../inc
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbwidgets
+SYSTEMINCLUDE 	/epoc32/include/mw/hb/hbcore
+
+LIBRARY         euser.lib
+LIBRARY         provisioningengine.lib
+LIBRARY         charconv.lib
+LIBRARY         commdb.lib
+LIBRARY         cmmanager.lib
+LIBRARY       hbcore.lib hbwidgets.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/inc/cwpdestinationnwadapter.h	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2007-2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Handles destination network provisioning.
+*
+*/
+
+
+
+#ifndef CWPDESTINATIONNWADAPTER_H
+#define CWPDESTINATIONNWADAPTER_H
+
+#include <CWPAdapter.h>
+#include <MWPContextExtension.h>
+
+#include "cwpdestinationnwitem.h"
+
+class CWPCharacteristic;
+
+/**
+ *  Realizes destination network provisioning adapter.
+ *
+ *  Destination network adapter handles destination network provisioning and
+ *  stores them via Connection Method Manager API.
+ *
+ *  @lib cwpdestinationnwadapter.lib
+ *  @since S60 v3.2.
+ */
+class CWPDestinationNwAdapter : public CWPAdapter, public MWPContextExtension
+    {
+    /**
+     * Friend class for unit testing - uncomment when running tests.
+     */
+    //friend class UT_wpdestinationnwadapter;
+
+public:
+
+    static CWPDestinationNwAdapter* NewL();
+
+    virtual ~CWPDestinationNwAdapter();
+
+    /**
+     * Converts given 8-bit descriptor to TUint32.
+     *
+     * @since S60 v3.2.
+     * @param aDes Descriptor to be converted.
+     * @return Unsigned 32-bit integer.
+     */
+    TUint32 CWPDestinationNwAdapter::Des8ToUint32L( const TDesC8& aDes );
+
+// from base class CWPAdapter
+
+    /**
+     * From CWPAdapter.
+     * Checks the number of settings items.
+     *
+     * @since S60 v3.2.
+     * @return Quantity of items (always one).
+     */
+    TInt ItemCount() const;
+
+    /**
+     * From CWPAdapter.
+     * Getter for the summary title of Destination network settings. The text
+     * is shown to the user in an opened configuration message.
+     *
+     * @since S60 v3.2.
+     * @param aIndex Location of the settings item. Not used.
+     * @return Summary title.
+     */
+    const TDesC16& SummaryTitle( TInt aIndex ) const;
+
+    /**
+     * From CWPAdapter.
+     * Getter for the summary text of Destination network settings. The text
+     * is shown to the user in opened configuration message.
+     *
+     * @since S60 v3.2.
+     * @param aIndex Location of the settings item.
+     * @return Summary text.
+     */
+    const TDesC16& SummaryText( TInt aIndex ) const;
+
+    /**
+     * From CWPAdapter.
+     * Saves a destination network.
+     *
+     * @since S60 v3.2.
+     * @param aIndex Location of the settings item.
+     */
+    void SaveL( TInt aIndex );
+
+    /**
+     * From CWPAdapter.
+     * Returns EFalse since a destination cannot be set as default.
+     *
+     * @since S60 v3.2.
+     * @param aIndex Location of the settings item to be queried. Not used.
+     * @return Information whether these settings can be set as default.
+     */
+    TBool CanSetAsDefault( TInt /*aIndex*/ ) const;
+
+    /**
+     * From CWPAdapter.
+     * Adapter sets the settings as default. Not supported.
+     *
+     * @since S60 v3.2.
+     * @param aIndex Location of the settings item to be set as default.
+     */
+    inline void SetAsDefaultL( TInt /*aIndex*/ );
+
+    /**
+     * From CWPAdapter.
+     * Query for detailed information about the destination network.
+     * This is not supported feature as in other adapters in the framework.
+     * Always returns KErrNotSupported.
+     *
+     * @since S60 v3.2.
+     * @param aItem Not used but here because of inheritance.
+     * @param aVisitor Object for retrieveing details of a setting entry.
+     *                 Not used.
+     * @return KErrNotSupported if not supported.
+     */
+    TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
+
+    /**
+     * From CWPAdapter.
+     * Visit method. Visits the adapter. Adapter checks from 
+     * aCharacteristic if the data is targeted to it and acts according to
+     * that.
+     *
+     * @since S60 v3.2.
+     * @param aCharacteristic The characteristic found.
+     */
+    void VisitL( CWPCharacteristic& aCharacteristic );        
+
+    /**
+     * From CWPAdapter.
+     * Visit method. Visits the adapter. Method sets parameter values to
+     * destination network settings item.
+     *
+     * @since S60 v3.2.
+     * @param aParameter The parameter found.
+     */
+    void VisitL( CWPParameter& aParameter );        
+
+    /**
+     * From CWPAdapter.
+     * Visit method. Used for linking settings to NAPDEF definition.
+     *
+     * @since S60 v3.2.
+     * @param aLink Link to the characteristic.
+     */
+    void VisitLinkL( CWPCharacteristic& aLink );
+
+    /**
+     * From CWPAdapter.
+     * Gets the saving information from the adapter that has saved settings.
+     *
+     * @since S60 v3.2.
+     * @param aIndex Index of the previously saved item.
+     * @param aSavingInfo Saving info.
+     */
+    void GetSavingInfoL( TInt aIndex, RPointerArray<HBufC8>& aSavingInfo );
+
+    /**
+     * From CWPAdapter.
+     * Informs the adapters of the saved settings.
+     * Not used.
+     *
+     * @since S60 v3.2.
+     * @param aAppIdOfSavingItem UID of the adapter component. 
+     * @param aAppRef APPREF of the saved settings.
+     * @param aStorageIdValue Value that identifies the settings in its
+     *        storage.
+     */
+    inline void SettingsSavedL( const TDesC8& /*aAppIdOfSavingItem*/,
+        const TDesC8& /*aAppRef*/, const TDesC8& /*aStorageIdValue*/ );
+
+    /**
+     * From CWPAdapter.
+     * Lets the adapters know when the saving has been finalized in 
+     * viewpoint of the provisioning framework. The adapters can make 
+     * finalization of saving the settings after receiving this call.
+     * Not used.
+     *
+     * @since S60 v3.2.
+     */
+    inline void SavingFinalizedL();
+
+// from base class MWPContextExtension
+
+    /**
+     * From MWPContextExtension.
+     * Returns a pointer to a context extension.
+     *
+     * @since S60 v3.2.
+     * @param aExtension Contains a pointer to MWPContextExtension if
+     *                   supported.
+     * @return KErrNotSupported if not supported, otherwise KErrNone.
+     */
+    TInt ContextExtension( MWPContextExtension*& aExtension );
+
+    /**
+     * From MWPContextExtension.
+     * Returns the data used for saving.
+     *
+     * @since S60 v3.2.
+     * @param aIndex The index of the data.
+     * @return The data; ownership is transferred.
+     */
+    const TDesC8& SaveDataL( TInt aIndex ) const;
+
+    /**
+     * From MWPContextExtension.
+     * Deletes a saved destination network.
+     *
+     * @since S60 v3.2.
+     * @param aSaveData The data used for saving.
+     */
+    void DeleteL( const TDesC8& aSaveData );
+
+    /**
+     * From MWPContextExtension.
+     * Returns the UID of the adapter.
+     *
+     * @since S60 v3.2.
+     * @return UID of the adapter.
+     */
+    TUint32 Uid() const;
+
+private:
+
+    CWPDestinationNwAdapter();
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Application ID of the current characteristic.
+     */
+    TPtrC iAppId;
+
+    /**
+     * Title for destination network. Value read from the resource file 
+     * in initiation phase.
+     * Own.
+     */
+    HBufC16* iDefaultTitle;
+
+    /**
+     * Name for destination network. Value read from the resource file 
+     * in initiation phase.
+     * Own.
+     */
+    HBufC16* iDefaultName;
+
+    /**
+     * Destination network item.
+     * Own.
+     */
+    CWPDestinationNwItem* iCurrentItem;
+
+    /**
+     * Destination Network items.
+     */
+    RPointerArray<CWPDestinationNwItem> iItems;
+    };
+
+#include "cwpdestinationnwadapter.inl"
+
+#endif // CWPDESTINATIONNWADAPTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/inc/cwpdestinationnwadapter.inl	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   cwpdestinationnwadapter.h inline functions.
+*
+*/
+
+
+
+// -----------------------------------------------------------------------------
+// CWPDestinationNwAdapter::SetAsDefaultL
+// -----------------------------------------------------------------------------
+//
+inline void CWPDestinationNwAdapter::SetAsDefaultL( TInt /*aIndex*/ )
+    {
+    };
+
+// -----------------------------------------------------------------------------
+// CWPDestinationNwAdapter::SettingsSavedL
+// -----------------------------------------------------------------------------
+//
+inline void CWPDestinationNwAdapter::SettingsSavedL( 
+    const TDesC8& /*aAppIdOfSavingItem*/, const TDesC8& /*aAppRef*/, 
+    const TDesC8& /*aStorageIdValue*/ )
+    {
+    };    
+
+// -----------------------------------------------------------------------------
+// CWPDestinationNwAdapter::SavingFinalizedL
+// -----------------------------------------------------------------------------
+//
+inline void CWPDestinationNwAdapter::SavingFinalizedL()
+    {
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/inc/cwpdestinationnwitem.h	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Settings item for one destination network. Also handles
+*                saving destination networks to permanent storage.
+*
+*/
+
+
+
+#ifndef CWPDESTINATIONNWITEM_H
+#define CWPDESTINATIONNWITEM_H
+
+#include <e32base.h>
+#include <cmmanagerext.h>
+
+class CWPCharacteristic;
+
+/**
+ *  Destination network settings item.
+ *
+ *  Destination network item handles saving destination networks via
+ *  Connection Method Manager API.
+ *
+ *  @lib cwpdestinationnwadapter.lib
+ *  @since S60 v3.2.
+ */
+class CWPDestinationNwItem : public CBase
+    {
+    /**
+     * Friend classes for unit testing - uncomment when running tests.
+     */
+    //friend class UT_wpdestinationnwadapter;
+
+public:
+
+    static CWPDestinationNwItem* NewL();
+
+    virtual ~CWPDestinationNwItem();
+
+    /**
+     * Setter for APPREF.
+     * @since S60 v3.2.
+     * @param aAPPREF.
+     */
+    void SetAppRefL( const TDesC8& aAppRef );
+
+    /**
+     * Setter for user viewable name of the setting.
+     * @since S60 v3.2.
+     * @param aNAME. Value is TCP or UDP.
+     */
+    void SetSettingsNameL( const TDesC& aSettingsName );
+
+    /**
+     * Setter for NAPDEF (IAP settings).
+     * @since S60 v3.2.
+     * @param aNapDef.
+     */
+    void AddNapDefL( CWPCharacteristic* aNapDef );
+
+    /**
+     * Getter for APPREF value.
+     * @since S60 v3.2.
+     * @return APPREF.
+     */
+    const TDesC8& AppRef() const;
+
+    /**
+     * Getter for user viewable name of Destination network.
+     * @since S60 v3.2.
+     * @return Settings name.
+     */
+    const TDesC& SettingsName() const;
+
+    /**
+     * Saves the destination network settings.
+     * @since S60 v3.2.
+     */
+    void SaveL();
+
+    /**
+     * Return destination network ID.
+     * @since S60 v3.2.
+     * @return ID of the destination network.
+     */
+    const TDesC8& SaveData() const;
+
+private:
+
+    /**
+     * Creates a network destination.
+     * @since S60 v3.2.
+     * @param aCmManager Connection Method Manager handle.
+     * @return Network destination.
+     */
+    RCmDestinationExt CreateDestinationL( RCmManagerExt& aCmManager );
+
+		/**
+     * Returnes the Iap id that matches the given Wap id.
+     * @since S60 v3.2.3
+     * @param aWapId IAP's Wap Id.
+     * @return Iap Id.
+     */
+		TUint32 IapIdFromWapIdL( TUint32 aWapId );
+		
+private:
+
+    void ConstructL();
+    CWPDestinationNwItem();
+
+private: // data
+
+    /**
+     * Destination network reference identity in provisioning document.
+     * Own.
+     */
+    HBufC8* iAppRef;
+
+    /**
+     * Name of destination network visible to user when viewing the
+     * provisioning message.
+     * Own.
+     */
+    HBufC* iSettingsName;
+
+    /**
+     * Array of NAPDEFs, IAP settings.
+     * Not own. (Contained pointers are deleted by ProvisioningEngine.)
+     */
+    RPointerArray<CWPCharacteristic> iNapDefs;
+
+    /**
+     * ID value of the referred IAP.
+     */
+    TUint32 iIAPId;
+
+    /** 
+     * Destination network ID as a descriptor to be returned by the
+     * SaveData method to the framework via adapters SaveDataL.
+     * Own.
+     */
+    HBufC8* iSavedProfileId;
+
+    };
+
+#endif // CWPDESTINATIONNWITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/inc/wpdestinationnwadapteruids.h	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Destination network adapter UIDs.
+*
+*/
+
+
+
+#ifndef WPDESTINATIONNWADAPTERUIDS_H
+#define WPDESTINATIONNWADAPTERUIDS_H
+
+// MACROS
+ 
+// ECOM plugin
+#define KECOMUid2 0x10009D8D
+
+// UID2 for the Destination Network adapter. ECOM plug-in.
+#define KDestinationNetworkAdapterDllUid2 KECOMUid2
+
+// UID3 for the Destination Network adapter DLL.
+#define KDestinationNetworkAdapterDllUid3 0x2000B4AF
+
+// Implementation UID for the Destination Network adapter.
+#define KDestinationNetworkAdapterUid 0x2000B4AE
+
+// Interface UID from Client Provisioning adapter base class.
+#define KProvisioningAdapterInterface 0x101F84D5
+
+#endif //  WPDESTINATIONNWADAPTERUIDS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/inc/wpdestinationnwdebug.h	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Enables and disables debug prints.
+*
+*/
+
+
+
+#ifndef WPDESTINATIONNWDEBUG_H
+#define WPDESTINATIONNWDEBUG_H
+
+#include <e32debug.h>
+
+#ifdef _DEBUG
+#define DBG_PRINT( p )          RDebug::Print( _L( p ) )
+#define DBG_PRINT_2( p, i )     RDebug::Print( _L( p ), i )
+#define DBG_PRINT_3( p, i, u )  RDebug::Print( _L( p ), i, u )
+#else
+#define DBG_PRINT( p )
+#define DBG_PRINT_2( p, i )
+#define DBG_PRINT_3( p, i, u )
+#endif // _DEBUG
+
+
+#endif // WPDESTINATIONNWDEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/rom/wpdestinationnwadapter.iby	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   wpdestinationnwadapter iby file
+*
+*/
+
+
+#ifndef WPDESTINATIONNWADAPTER_IBY
+#define WPDESTINATIONNWADAPTER_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( wpdestinationnwadapter.dll, 2000b4af.rsc )
+
+#endif // WPDESTINATIONNWADAPTER_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/rom/wpdestinationnwadapter_resources.iby	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   wpdestinationnwadapter resource iby file
+*
+*/
+
+
+#ifndef __WPDESTINATIONNWADAPTER_RESOURCES_IBY__
+#define __WPDESTINATIONNWADAPTER_RESOURCES_IBY__
+
+
+//Client Provisioning Destination network adapter resources
+data=DATAZ_\RESOURCE_FILES_DIR\wpdestinationnwadapter.rsc   RESOURCE_FILES_DIR\wpdestinationnwadapter.rsc
+
+
+#endif // __WPDESTINATIONNWADAPTER_RESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/src/cwpdestinationnwadapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2007-2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Receives and stores Destination network settings.
+*
+*/
+
+
+
+
+#include <e32base.h>
+#include <CWPAdapter.h>
+#include <CWPCharacteristic.h>
+#include <CWPParameter.h>
+#include <e32des8.h>
+#include <WPAdapterUtil.h> // Adapter utils
+#include <utf.h> // Unicode conversion
+#include <cmmanagerext.h>
+#include <cmdestinationext.h>
+#include <cmconnectionmethodext.h>
+#include <cmmanagerdef.h>
+
+#include "cwpdestinationnwadapter.h"
+#include "wpdestinationnwdebug.h"
+#include <hbtextresolversymbian.h>
+
+_LIT( KDestinationNwAdapterName, "WPDestinationNwAdapter");
+_LIT( KDestinationNwAppID,       "w904C" ); // OMA CP registration document.
+_LIT8( KDestinationNwAppID8,     "w904C" ); // OMA CP registration document.
+_LIT( KCWPDestinationAdapterFileName, "deviceupdates_" );	
+_LIT( KCWPDestinationAdapterFilePath, "z:/resource/qt/translations/" );
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::CWPDestinationNwAdapter
+// ---------------------------------------------------------------------------
+//
+CWPDestinationNwAdapter::CWPDestinationNwAdapter() : CWPAdapter()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::ConstructL()
+    {
+    DBG_PRINT( "CWPDestinationNwAdapter::ConstructL - begin" );
+    
+    TBool result = HbTextResolverSymbian::Init(KCWPDestinationAdapterFileName, KCWPDestinationAdapterFilePath );
+    
+    _LIT(KCWPDestinationAdapter, "txt_device_update_dblist_destination_networks");
+    iDefaultTitle = HbTextResolverSymbian::LoadL(KCWPDestinationAdapter);
+    iDefaultName = HbTextResolverSymbian::LoadL(KCWPDestinationAdapter);
+    		
+    DBG_PRINT( "CWPDestinationNwAdapter::ConstructL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::NewL
+// ---------------------------------------------------------------------------
+//
+CWPDestinationNwAdapter* CWPDestinationNwAdapter::NewL()
+    {
+    CWPDestinationNwAdapter* self = new (ELeave) 
+        CWPDestinationNwAdapter;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::~CWPDestinationNwAdapter
+// ---------------------------------------------------------------------------
+//
+CWPDestinationNwAdapter::~CWPDestinationNwAdapter()
+    {
+    DBG_PRINT( "CWPDestinationNwAdapter::~CWPDestinationNwAdapter - begin" );
+    delete iDefaultTitle;
+    delete iDefaultName;
+    iItems.ResetAndDestroy();
+    iItems.Close();
+    DBG_PRINT( "CWPDestinationNwAdapter::~CWPDestinationNwAdapter - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::Des8ToUint32L()
+// Converts an 8 bit descriptor to TUint32.
+// ---------------------------------------------------------------------------
+//
+TUint32 CWPDestinationNwAdapter::Des8ToUint32L( const TDesC8& aDes )
+    {
+    TLex8 lex( aDes );
+    TUint32 value( 0 );
+    User::LeaveIfError( lex.Val( value, EDecimal ) );
+    return value;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::ItemCount
+// From class CWPAdapter.
+// Checks the number of settings items.
+// ---------------------------------------------------------------------------
+//
+TInt CWPDestinationNwAdapter::ItemCount() const
+    {
+    return iItems.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CWPAdapter.
+// CWPDestinationNwAdapter::SummaryTitle
+// Returns the summary title.
+// ---------------------------------------------------------------------------
+//
+const TDesC16& CWPDestinationNwAdapter::SummaryTitle( TInt /*aIndex*/ ) const
+    {
+    return *iDefaultTitle;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::SummaryText
+// From class CWPAdapter.
+// Returns the summary text of a destination network.
+// ---------------------------------------------------------------------------
+//
+const TDesC16& CWPDestinationNwAdapter::SummaryText( TInt aIndex ) const
+    {
+    if ( !iItems[aIndex]->SettingsName().Length() )
+        {
+        return *iDefaultName;
+        }
+    return iItems[aIndex]->SettingsName();
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::SaveL
+// From class CWPAdapter.
+// Calls settings items saving method.
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::SaveL( TInt aIndex )
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iItems.Count(),
+        User::Leave( KErrArgument ) );
+
+    iItems[aIndex]->SaveL();
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::CanSetAsDefault
+// From class CWPAdapter.
+// Not supported; always return EFalse.
+// ---------------------------------------------------------------------------
+//
+TBool CWPDestinationNwAdapter::CanSetAsDefault( TInt /*aIndex*/ ) const
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::DetailsL
+// From class CWPAdapter.
+// Not supported.
+// ---------------------------------------------------------------------------
+//
+TInt CWPDestinationNwAdapter::DetailsL( TInt /*aItem*/, 
+    MWPPairVisitor& /*aVisitor */ )
+    {
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::VisitL
+// From class CWPAdapter.
+// OMA CP characteristics are handled in this method.
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::VisitL( 
+    CWPCharacteristic& aCharacteristic )
+    {
+    DBG_PRINT( "CWPDestinationNwAdapter::VisitL( characteristic ) - begin" );
+    switch ( aCharacteristic.Type() )
+        {
+        // This adapter only handles APPLICATION characteristic.
+        case KWPApplication:
+            {
+            iCurrentItem = CWPDestinationNwItem::NewL();
+            // Set default name for destination - replaced later if a name
+            // has been provisioned.
+            iCurrentItem->SetSettingsNameL( iDefaultName->Des() );
+            aCharacteristic.AcceptL( *this );
+
+            // Settings are for Destination network - append current item to
+            // item array to be saved later.
+            if ( 0 == iAppId.Compare( KDestinationNwAppID() ) )
+                {
+                iItems.AppendL( iCurrentItem );
+                }
+            // Settings are not for Destination network.
+            else
+                {
+                delete iCurrentItem;
+                iCurrentItem = NULL;
+                }
+            break;
+            }
+        // All other than APPLICATION are ignored.
+        default:
+            break;
+        }
+    DBG_PRINT( "CWPDestinationNwAdapter::VisitL( characteristic ) - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::VisitL
+// From class CWPAdapter.
+// Destination network parameters are handled in this method.
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::VisitL( CWPParameter& aParameter )
+    {
+    DBG_PRINT( "CWPDestinationNwAdapter::VisitL( parameter ) - begin" );
+    // tmpValue holds the value converted from Unicode to UTF8.
+    HBufC8* tmpValue = HBufC8::NewLC( aParameter.Value().Length() ); // CS:1
+    TPtr8 ptrTmpValue( tmpValue->Des() );
+    CnvUtfConverter::ConvertFromUnicodeToUtf8( ptrTmpValue,
+        aParameter.Value() );
+
+    switch ( aParameter.ID() )
+        {
+        // APPLICATION/APPID
+        case EWPParameterAppID:
+            {
+            iAppId.Set( aParameter.Value() );
+            break;
+            }
+
+        // APPLICATION/NAME
+        case EWPParameterName:
+            {
+            if ( iCurrentItem )
+                {
+                iCurrentItem->SetSettingsNameL( aParameter.Value() );
+                }
+            break;
+            }
+
+        // APPLICATION/APPREF
+        case EWPParameterAppRef:
+            {
+            if ( iCurrentItem )
+                {
+                iCurrentItem->SetAppRefL( tmpValue->Des() );
+                }
+            break;
+            }
+
+        // Other settings are ignored.
+        default:
+            {
+            break;
+            }
+        }
+    CleanupStack::PopAndDestroy( tmpValue ); // CS:0
+    DBG_PRINT( "CWPDestinationNwAdapter::VisitL( parameter ) - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::VisitLinkL
+//
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::VisitLinkL( CWPCharacteristic& aLink )
+    {
+    if ( KWPNapDef == aLink.Type() && iCurrentItem )
+        {
+        iCurrentItem->AddNapDefL( &aLink );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::GetSavingInfoL
+// APPID is set to [0], APPREF to [1] and saving info (storage ID) to [2].
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::GetSavingInfoL( TInt aIndex, 
+    RPointerArray<HBufC8>& aSavingInfo )
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iItems.Count(),
+        User::Leave( KErrArgument ) );
+
+    aSavingInfo.AppendL( KDestinationNwAppID8().AllocL() );
+    aSavingInfo.AppendL( iItems[aIndex]->AppRef().AllocL() );
+    aSavingInfo.AppendL( iItems[aIndex]->SaveData().AllocL() );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::ContextExtension
+// From class MWPContextExtension.
+// Returns a pointer to context extension.
+// ---------------------------------------------------------------------------
+//
+TInt CWPDestinationNwAdapter::ContextExtension( 
+    MWPContextExtension*& aExtension )
+    {
+    aExtension = this;
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::SaveDataL
+// From class MWPContextExtension.
+// Returns ID of saved data.
+// ---------------------------------------------------------------------------
+//
+const TDesC8& CWPDestinationNwAdapter::SaveDataL( TInt aIndex ) const
+    {
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iItems.Count(),
+        User::Leave( KErrArgument ) );
+
+    return iItems[aIndex]->SaveData();
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::DeleteL
+// From class MWPContextExtension.
+// Deletes a Destination network.
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwAdapter::DeleteL( const TDesC8& aSaveData )
+    {
+    DBG_PRINT( "CWPDestinationNwAdapter::DeleteL - begin" );
+    RCmManagerExt cmManager;
+    cmManager.OpenL();
+    CleanupClosePushL( cmManager ); // CS:1
+    TUint32 destinationId = Des8ToUint32L( aSaveData );
+    RCmDestinationExt destination = cmManager.DestinationL( destinationId );
+    CleanupClosePushL( destination ); // CS:2
+    const TInt cmCount = destination.ConnectionMethodCount();
+    // First remove IAPs from destination network because this adapter must
+    // not delete IAPs.
+    for ( TInt counter = 0; counter < cmCount; counter++ )
+        {
+        destination.RemoveConnectionMethodL( 
+            destination.ConnectionMethodL( 0 ) );
+        destination.UpdateL();
+        }
+    CleanupStack::Pop( &destination ); // CS:1
+    destination.DeleteLD();
+    CleanupStack::PopAndDestroy( &cmManager ); // CS:0
+    DBG_PRINT( "CWPDestinationNwAdapter::DeleteL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwAdapter::Uid
+// From class MWPContextExtension.
+// Returns the UID of this adapter.
+// ---------------------------------------------------------------------------
+//
+TUint32 CWPDestinationNwAdapter::Uid() const
+    {
+    return iDtor_ID_Key.iUid;
+    }
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/src/cwpdestinationnwitem.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,345 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Settings item for one destination network. Also handles
+*                saving destination networks to permanent storage.
+*
+*/
+
+
+
+
+
+#include <charconv.h>
+#include <CWPCharacteristic.h>
+#include <cmmanagerext.h>
+#include <cmdestinationext.h>
+#include <cmconnectionmethodext.h>
+#include <cmconnectionmethoddef.h>
+#include <cmpluginwlandef.h> // For WLAN plugin UID, i.e. bearer type.
+
+#include "cwpdestinationnwitem.h"
+#include "wpdestinationnwdebug.h"
+
+const TInt KMaxCharsInTUint32 = 10;
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::NewL
+//
+// ---------------------------------------------------------------------------
+//
+CWPDestinationNwItem* CWPDestinationNwItem::NewL()
+    {
+    CWPDestinationNwItem* self = new ( ELeave ) CWPDestinationNwItem();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::CWPDestinationNwItem
+//
+// ---------------------------------------------------------------------------
+//
+CWPDestinationNwItem::CWPDestinationNwItem()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::~CWPDestinationNwItem
+//
+// ---------------------------------------------------------------------------
+//
+CWPDestinationNwItem::~CWPDestinationNwItem()
+    {
+    DBG_PRINT( "CWPDestinationNwItem::~CWPDestinationNwItem - begin" );
+    delete iAppRef;
+    delete iSettingsName;
+    iNapDefs.Close();
+    delete iSavedProfileId;
+    DBG_PRINT( "CWPDestinationNwItem::~CWPDestinationNwItem - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::ConstructL
+//
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwItem::ConstructL()
+    { 
+    DBG_PRINT( "CWPDestinationNwItem::ConstructL - begin" );
+    iAppRef         = HBufC8::NewL( 0 );
+    iSettingsName   = HBufC::NewL( 0 );
+    iSavedProfileId = HBufC8::NewL( KMaxCharsInTUint32 );
+    DBG_PRINT( "CWPDestinationNwItem::ConstructL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::SetAppRefL
+//
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwItem::SetAppRefL( const TDesC8& aAppRef )
+    {
+    delete iAppRef;
+    iAppRef = NULL;
+    iAppRef = aAppRef.AllocL();
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::SetSettingsNameL
+//
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwItem::SetSettingsNameL( const TDesC& aSettingsName )
+    {
+    delete iSettingsName;
+    iSettingsName = NULL;
+    iSettingsName = aSettingsName.AllocL();
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::AddNapDefL
+//
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwItem::AddNapDefL( CWPCharacteristic* aNapDef )
+    {
+    iNapDefs.AppendL( aNapDef );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::AppRef
+//
+// ---------------------------------------------------------------------------
+//
+const TDesC8& CWPDestinationNwItem::AppRef() const
+    {
+    return *iAppRef;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::SettingsName
+//
+// ---------------------------------------------------------------------------
+//
+const TDesC& CWPDestinationNwItem::SettingsName() const
+    {
+    return *iSettingsName;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::SaveL()
+// Saves the Destination network using Extended connection settings API. 
+// ---------------------------------------------------------------------------
+//
+void CWPDestinationNwItem::SaveL()
+    {
+    DBG_PRINT( "CWPDestinationNwItem::SaveL - begin" );
+    // Number of IAPs that have been linked to this destination.
+    const TInt iapCount( iNapDefs.Count() );
+    RCmManagerExt cmManager;
+    cmManager.OpenL();
+    CleanupClosePushL( cmManager ); // CS:1
+    RCmDestinationExt destination = CreateDestinationL( cmManager );
+    CleanupClosePushL( destination ); // CS:2
+    RCmConnectionMethodExt tempconn;
+    
+    // Add linked IAPs to destination.    
+    for ( TInt counter = 0; counter < iapCount; counter++ )
+        {
+        TPckgBuf<TUint32> apUid;
+        apUid.Copy( iNapDefs[counter]->Data( 0 ) );
+        // The stored id is the wap id. Convert it into the iap id
+        
+        TUint32 iapId = IapIdFromWapIdL( apUid() );
+        
+        apUid = NULL;
+        RCmConnectionMethodExt connection = 
+            cmManager.ConnectionMethodL( iapId );
+        CleanupClosePushL( connection ); // CS:5
+
+        RArray<TUint32> destinationIds;        
+        cmManager.AllDestinationsL( destinationIds );
+        CleanupClosePushL( destinationIds );
+        
+        TInt counter2(0);        
+        for ( counter2 = 0; counter2 < destinationIds.Count(); counter2++ )
+            {
+            RCmDestinationExt tempdest = cmManager.DestinationL( 
+                        destinationIds[counter2] );            
+            
+            TRAPD( err, tempconn = tempdest.ConnectionMethodByIDL( iapId ));
+                        
+            tempconn.Close();
+            tempdest.Close();
+            
+            if ( err != KErrNotFound )
+                {
+                // Found from other destination                  
+                break;                
+                }           
+            }                
+        if ( counter2 == destinationIds.Count() )
+            {
+            // Not found in any other destination
+            destination.AddConnectionMethodL( connection );            
+            }
+        else
+            {            
+            // Found in some other destination -> create copy
+            destination.AddConnectionMethodL( tempconn = connection.CreateCopyL() );
+            tempconn.Close();            
+            }
+        CleanupStack::PopAndDestroy( &destinationIds );
+
+        // Change seamlessness level for linked WLAN IAPs.
+        TUint32 bearerType = connection.GetIntAttributeL( 
+            CMManager::ECmBearerType );
+        if ( KUidWlanBearerType == bearerType )
+            {
+            connection.SetIntAttributeL( CMManager::ECmSeamlessnessLevel, 
+                CMManager::ESeamlessnessShowprogress );
+            connection.UpdateL();
+            }
+
+        destination.UpdateL();
+        CleanupStack::PopAndDestroy( &connection ); // CS:4
+        }    
+    destination.UpdateL(); // In case there were no IAP linkages.
+    // Destination ID is needed as a descriptor (used in linking settings).
+    TUint32 destinationId = destination.Id();
+    iSavedProfileId->Des().Num( destinationId, EDecimal );
+    // Pop destination & cmManager.
+    CleanupStack::PopAndDestroy( 2, &cmManager ); // CS:0
+    DBG_PRINT( "CWPDestinationNwItem::SaveL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::SaveData
+//
+// ---------------------------------------------------------------------------
+//
+const TDesC8& CWPDestinationNwItem::SaveData() const
+    {
+    return *iSavedProfileId;
+    }
+
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::CreateDestinationL
+// Checks that settings name if unique, renames if necessary, and creates
+// a destination network.
+// ---------------------------------------------------------------------------
+//
+RCmDestinationExt CWPDestinationNwItem::CreateDestinationL( 
+    RCmManagerExt& aCmManager )
+    {
+    DBG_PRINT( "CWPDestinationNwItem::CreateDestinationL - begin" );
+    RArray<TUint32> destinationIds;
+    // Get destination ID's for checking if name to be set is reserved.
+    CleanupClosePushL( destinationIds ); // CS:1
+    aCmManager.AllDestinationsL( destinationIds );
+    const TInt destinationCount = destinationIds.Count();
+    // Destination's name to actually be used.
+    HBufC* newName = HBufC::NewLC( 
+        iSettingsName->Des().Length() + KMaxCharsInTUint32 ); // CS:2
+    newName->Des().Copy( iSettingsName->Des() );
+
+    // Check names from all existing destinations.
+    for ( TInt counter = 0; counter < destinationCount; counter++ )
+        {
+        RCmDestinationExt destination = aCmManager.DestinationL( 
+            destinationIds[counter] );
+        CleanupClosePushL( destination ); // CS:3
+        HBufC* settingsName = destination.NameLC(); // CS:4
+        // If destination exists, return it.
+        if ( 0 == newName->Des().Compare( settingsName->Des() ) )
+            {
+            // Pop settingsName & destination & newName
+            CleanupStack::PopAndDestroy( 3, &destination ); // CS:1
+            
+            RCmDestinationExt dest2 = aCmManager.DestinationL( 
+                    destinationIds[counter] );
+            
+            CleanupStack::PopAndDestroy( &destinationIds ); // CS:0
+            DBG_PRINT( "CWPDestinationNwItem::CreateDestinationL - end" );
+            return dest2;
+            }
+        // Pop settingsName & destination.
+        CleanupStack::PopAndDestroy( 2, &destination ); // CS:2
+        }
+   
+    // Create new a destination and return it.
+    RCmDestinationExt destination = aCmManager.CreateDestinationL( *newName );
+    // Pop newName & destinationIds
+    CleanupStack::PopAndDestroy( 2, &destinationIds ); // CS:0
+    DBG_PRINT( "CWPDestinationNwItem::CreateDestinationL - end" );
+    return destination;
+    }
+    
+// ---------------------------------------------------------------------------
+// CWPDestinationNwItem::IapIdFromWapId
+// Returns IAP ID from WAP ID.
+// ---------------------------------------------------------------------------
+//
+TUint32 CWPDestinationNwItem::IapIdFromWapIdL( TUint32 aWapId )
+    {
+    RCmManagerExt cmManager;
+    cmManager.OpenLC(); // CS:1
+    RArray<TUint32> iapIds;
+    TUint32 iapId( 0 );
+
+    // First get all free IAP ID's.
+    cmManager.ConnectionMethodL( iapIds );
+    CleanupClosePushL( iapIds ); // CS:2
+
+    // Then get IAP ID's from all destinations.
+    RArray<TUint32> destIds;
+    cmManager.AllDestinationsL( destIds );
+    CleanupClosePushL( destIds ); // CS:3
+    TInt destCount = destIds.Count();
+    for ( TInt destIndex = 0; destIndex < destCount; destIndex++ )
+        {
+        RCmDestinationExt dest = cmManager.DestinationL( 
+            destIds[destIndex] );
+        CleanupClosePushL( dest ); // CS:4
+        TInt cmCount = dest.ConnectionMethodCount();
+        for ( TInt cmIndex = 0; cmIndex < cmCount; cmIndex++ )
+            {
+            TUint32 apId = dest.ConnectionMethodL( 
+                cmIndex ).GetIntAttributeL( CMManager::ECmIapId );
+            iapIds.AppendL( apId );
+            }
+        CleanupStack::PopAndDestroy( &dest ); // CS:3
+        }
+    // Finally, go through all connection methods and find correct IAP ID.
+    const TInt cmCount = iapIds.Count();
+    for ( TInt counter = 0; counter < cmCount; counter++ )
+        {
+        TUint32 id = cmManager.GetConnectionMethodInfoIntL( 
+            iapIds[counter], CMManager::ECmWapId );
+        if ( id == aWapId )
+            {
+            iapId = iapIds[counter];
+            // No need to go through rest of IAPs.
+            break;
+            }
+        }
+    // PopAndDestroy destIds, iapIds, cmManager.
+    CleanupStack::PopAndDestroy( 3, &cmManager ); // CS:0
+    return iapId;
+    }
+
+
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omacpadapters/cpdestinationnwadapter/src/wpdestinationnwadaptergroupproxy.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Destination network adapter implementation group proxy
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <implementationproxy.h>
+#include "wpdestinationnwadapteruids.h"
+#include "cwpdestinationnwadapter.h"
+
+// CONSTANTS
+const TImplementationProxy KImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( KDestinationNetworkAdapterUid, 
+                                CWPDestinationNwAdapter::NewL )
+    };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Returns: TImplementationProxy*: pointer to TImplementationProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( KImplementationTable ) / 
+        sizeof( TImplementationProxy );
+    return KImplementationTable;
+    }
+
+// End of file.
--- a/omacpadapters/rom/ProvisioningAdapter.iby	Fri Sep 17 19:58:05 2010 +0530
+++ b/omacpadapters/rom/ProvisioningAdapter.iby	Fri Oct 15 11:39:02 2010 +0530
@@ -23,5 +23,6 @@
 ECOM_PLUGIN(WPStreamingAdapter.dll,101F85CB.rsc)
 ECOM_PLUGIN(WPAPAdapter.dll, WPAPAdapter.rsc)
 ECOM_PLUGIN(WPMbxNbrAdapter.dll,10207281.rsc)
+ECOM_PLUGIN( wpdestinationnwadapter.dll, 2000b4af.rsc )
 
 #endif
\ No newline at end of file
--- a/omacpadapters/rom/ProvisioningAdapterResources.iby	Fri Sep 17 19:58:05 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2002-2006 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Image description file for the Provisioning Resources
-*
-*/
-
-
-#ifndef __PROVISIONINGADAPTERRESOURCES_IBY__
-#define __PROVISIONINGADAPTERRESOURCES_IBY__
-
-
-data=DATAZ_\RESOURCE_FILES_DIR\WPWAPAdapterResource.rsc                        RESOURCE_FILES_DIR\WPWAPAdapter.rsc
-data=DATAZ_\RESOURCE_FILES_DIR\WpstreamingadapterResource.rsc                   RESOURCE_FILES_DIR\Wpstreamingadapter.rsc
-data=DATAZ_\RESOURCE_FILES_DIR\WPMbxNbrAdapterResource.rsc                      RESOURCE_FILES_DIR\WPMbxNbrAdapter.rsc
-data=DATAZ_\RESOURCE_FILES_DIR\WPAPAdapterResource.rsc                          RESOURCE_FILES_DIR\WPAPAdapterResource.rsc
-
-#endif
\ No newline at end of file
--- a/omadmadapters/connmoadapter/src/AddBuffer.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omadmadapters/connmoadapter/src/AddBuffer.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -112,14 +112,14 @@
     OstTraceExt1( TRACE_NORMAL, CADDBUFFER_ADDNODETOBUFFERL_ENTRY, "ENTRY: CAddBuffer::AddNodeToBufferL;aUri=%s", aUri );
     
     CConnMoNodeElement* newNode = new (ELeave) CConnMoNodeElement();
-    
+    CleanupStack::PushL( newNode );
     newNode->iUri.Copy( aUri );
     newNode->iParentLUID.Copy( aParentLUID );
     newNode->iStatusRef = aStatusRef;
     newNode->iProcessed = EFalse;
-    newNode->iLeaf = EFalse;
-    
+    newNode->iLeaf = EFalse;    
     iBuffer.AppendL( newNode );
+    CleanupStack::Pop(newNode);
     OstTrace0( TRACE_NORMAL, CADDBUFFER_ADDNODETOBUFFERL_EXIT, "EXIT: CAddBuffer::AddNodeToBufferL");
     }
 
@@ -134,15 +134,15 @@
     OstTraceExt1( TRACE_NORMAL, CADDBUFFER_ADDNODETOBUFFERL_LEAF_ENTRY, "ENTRY: CAddBuffer::AddNodeToBufferL;aUri=%s", aUri );
     
     CConnMoNodeElement* newNode = new (ELeave) CConnMoNodeElement();
-    
+    CleanupStack::PushL( newNode );
     newNode->iUri.Copy( aUri );
     newNode->iParentLUID.Copy( aLUID );
     newNode->iObject.Copy( aObject );
     newNode->iStatusRef = aStatusRef;
     newNode->iProcessed = EFalse;
-    newNode->iLeaf = ETrue;
-    
+    newNode->iLeaf = ETrue;    
     iBuffer.AppendL( newNode );
+    CleanupStack::Pop(newNode);
     OstTrace0( TRACE_NORMAL, CADDBUFFER_ADDNODETOBUFFERL_LEAF_EXIT, "EXIT: CAddBuffer::AddNodeToBufferL");
     }
 
--- a/omadmadapters/connmoadapter/src/ProxyBranch.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omadmadapters/connmoadapter/src/ProxyBranch.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -147,12 +147,13 @@
                 conRef.Append( _L("NAP/") );
                 CUtils::AppendFirstURISeg( napChildList, conRef );
                 HBufC8* napLuid = iCallback->GetLuidAllocL( conRef );
+                CleanupStack::PushL(napLuid) ;
                 if ( cmId == CUtils::IntLUID( *napLuid ) )
                     {
                     status = CSmlDmAdapter::EOk;
                     aLeafObject.InsertL( 0, conRef );
                     }
-                delete napLuid;
+                CleanupStack::PopAndDestroy( napLuid );
                 conRef.Delete( 0, conRef.Length() );
                 }
             }
--- a/omadmadapters/fota/src/nsmldmfotaadapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omadmadapters/fota/src/nsmldmfotaadapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -285,7 +285,7 @@
     User::LeaveIfError( session.Connect() );
     CleanupClosePushL(session);
 
-    CBufBase* acl=CBufFlat::NewL(10);
+    CBufBase* acl=CBufFlat::NewL(12);
     CleanupStack::PushL( acl );
     TInt err = session.GetAclL( KNSmlDMFotaNode,*acl,EFalse );
 		if ( err == KErrNone)
--- a/omadmadapters/nsmldminternet/src/NSmlInternetAdapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omadmadapters/nsmldminternet/src/NSmlInternetAdapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -5200,8 +5200,7 @@
         TPtrC qDB = TPtrC(COMMDB_ID);
 
         //Check if URI is /AP/*/NAPDef/* then it should be check IAP ID in DB not IAPService
-        if ((iIAPId >= 0)
-                && ((aURI.Match(_L8("AP/*/NAPDef/*")) != KErrNotFound)
+        if (((aURI.Match(_L8("AP/*/NAPDef/*")) != KErrNotFound)
                         || (aURI.Match(_L8("AP/*/NAPDef/*/Bearer/*"))
                                 != KErrNotFound) || (aURI.Match(_L8("AP/*"))
                         != KErrNotFound) || (aURI.Match(_L8("AP/*/NAPDef"))
--- a/omadmadapters/nsmldminternet/src/NSmlWLanAdapter.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omadmadapters/nsmldminternet/src/NSmlWLanAdapter.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -3029,7 +3029,7 @@
         {
         TBuf<KCommsDbSvrMaxFieldLength> serviceType;
         TUint32 serviceId(NULL);
-        TUint32 lValue;
+        TUint32 lValue = 0;
         CCommsDbTableView* napdefView = iDatabase.OpenViewMatchingUintLC(
                 TPtrC(IAP), TPtrC(COMMDB_ID), DesToInt(aParentLUID));
         TInt errorCode = napdefView->GotoFirstRecord();
--- a/omadmadapters/nsmldminternet/src/NSmlWlanSettings.cpp	Fri Sep 17 19:58:05 2010 +0530
+++ b/omadmadapters/nsmldminternet/src/NSmlWlanSettings.cpp	Fri Oct 15 11:39:02 2010 +0530
@@ -880,7 +880,7 @@
             TInt enError = KErrNone;
             TInt lockError = KErrNone;
             TRAP(lockError, enError = PerformLockWLANTablesL(ETrue));
-            if (iSecondaryView != NULL)
+            if (apEnforce)
                 {
                 ((CCommsDbProtectTableView*) iSecondaryView)->ProtectRecord();
                 }