201039 PDK_4.0.a
authorhgs
Mon, 04 Oct 2010 10:09:02 +0300
changeset 53 819e59dfc032
parent 52 36d60d12b4af
child 55 2d9cac8919d3
201039
debugapps/appregexec/group/.cproject
debugapps/appregexec/group/.project
debugapps/appregexec/group/AppRegExec.mmp
debugapps/appregexec/group/bld.inf
debugapps/appregexec/inc/AppRegExec.h
debugapps/appregexec/inc/NotifyChange.h
debugapps/appregexec/rom/AppRegExec.iby
debugapps/appregexec/sis/AppRegExec.pkg
debugapps/appregexec/src/AppRegExec.cpp
debugapps/appregexec/src/NotifyChange.cpp
debugapps/appregexec/tsrc/.cproject
debugapps/appregexec/tsrc/.project
debugapps/appregexec/tsrc/Bmarm/AppRegister_testU.DEF
debugapps/appregexec/tsrc/Bwins/AppRegister_testU.DEF
debugapps/appregexec/tsrc/EABI/AppRegExec_testu.def
debugapps/appregexec/tsrc/EABI/AppRegister_testU.def
debugapps/appregexec/tsrc/conf/AppRegExec_test.cfg
debugapps/appregexec/tsrc/data/AppRegExec.exe
debugapps/appregexec/tsrc/data/AppUnRegister.exe
debugapps/appregexec/tsrc/data/hello3.exe
debugapps/appregexec/tsrc/data/hello3.rsc
debugapps/appregexec/tsrc/data/hello3_reg.rsc
debugapps/appregexec/tsrc/group/AppRegExec_test.pkg
debugapps/appregexec/tsrc/group/AppRegExec_test_nrm.mmp
debugapps/appregexec/tsrc/group/Bld.inf
debugapps/appregexec/tsrc/inc/AppRegExec_test.h
debugapps/appregexec/tsrc/init/testframework_AppRegExec.ini
debugapps/appregexec/tsrc/src/AppRegExec_test.cpp
debugapps/appregexec/tsrc/src/AppRegExec_testBlocks.cpp
layers.sysdef.xml
loadgen/ui/hb/src/notifications.cpp
loadgen/ui/hb/src/settingsview.cpp
package_definition.xml
perfapps/memspyui/data/memspyui.rss
perfapps/memspyui/ui/avkon/group/memspyui.mmp
perfapps/memspyui/ui/avkon/inc/MemSpyAsyncTracker.h
perfapps/memspyui/ui/avkon/inc/MemSpySettings.h
perfapps/memspyui/ui/avkon/inc/MemSpyUiUtils.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewHeapTracking.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelContainers.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelHeap.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewProcesses.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewServerList.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h
perfapps/memspyui/ui/avkon/inc/MemSpyViewThreads.h
perfapps/memspyui/ui/avkon/src/MemSpyAsyncTracker.cpp
perfapps/memspyui/ui/avkon/src/MemSpyDeviceWideOperationDialog.cpp
perfapps/memspyui/ui/avkon/src/MemSpySettings.cpp
perfapps/memspyui/ui/avkon/src/MemSpyUiUtils.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewHeapTracking.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewProcesses.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewServerList.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp
perfapps/memspyui/ui/avkon/src/MemSpyViewThreads.cpp
perfapps/memspyui/ui/hb/src/memspyview.cpp
perfapps/perfmon/data/perfmon.rss
perfapps/perfmon/engine/src/perfmon_engine.cpp
perfapps/perfmon/group/ReleaseNotes_PerfMon.txt
perfapps/perfmon/group/bld.inf
perfapps/perfmon/group/bld_generic.inf
perfapps/perfmon/ui/hb/app/app.pro
perfapps/perfmon/ui/hb/app/inc/datapopup.h
perfapps/perfmon/ui/hb/app/src/datapopup.cpp
perfapps/perfmon/ui/hb/app/src/main.cpp
perfapps/perfmon/ui/hb/app/src/mainview.cpp
perfapps/perfmon/ui/hb/app/src/settingsview.cpp
perfapps/perfmon/ui/hb/datapopup/inc/perfmondatapopupdialog_p.h
perfapps/perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/group/.cproject	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="1" concurrentBuildJobs="4" defaultMMPChangedAction="0" extraSBSv2Args="" infBuildComponents="" infFileLocation="bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="true" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Phone Debug (armv5_udeb) [TB10.1_wk30]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (armv5_udeb) [TB10.1_wk30]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (armv5_udeb) [TB10.1_wk30]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+<SBSV2_DATA_ID CONFIG_BASE_PLATFORM="ARMV5" CONFIG_TARGET="UDEB" SBSV2_BUILD_ALIAS="armv5_udeb" SBSV2_CONFIG_DISPLAY_STRING="Phone Debug (armv5_udeb) [TB10.1_wk30]"/>
+</storageModule>
+<storageModule filesCache="M:\AppRegister_LaunchAPP\group\AppRegister.mmp;M:\AppRegister_LaunchAPP\group\bld.inf;" includesCache="M:/AppRegister_LaunchAPP/inc[LOCAL];M:/epoc32/include;M:/epoc32/include/mw;M:/epoc32/include/platform/mw;M:/epoc32/include/platform;M:/epoc32/include/app;M:/epoc32/include/platform/app;M:/epoc32/include/platform/loc;M:/epoc32/include/platform/mw/loc;M:/epoc32/include/platform/app/loc;M:/epoc32/include/platform/loc/sc;M:/epoc32/include/platform/mw/loc/sc;M:/epoc32/include/platform/app/loc/sc;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__ARMCC_2__;__EPOC32__;__GENERIC_MARM__;SBSV2;__EABI__;_DEBUG;" moduleId="configDataCache" sourcesCache="" timestampCache="1282654159405" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (armv5_urel) [TB10.1_wk30]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (armv5_urel) [TB10.1_wk30]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (armv5_urel) [TB10.1_wk30]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+<SBSV2_DATA_ID CONFIG_BASE_PLATFORM="ARMV5" CONFIG_TARGET="UREL" SBSV2_BUILD_ALIAS="armv5_urel" SBSV2_CONFIG_DISPLAY_STRING="Phone Release (armv5_urel) [TB10.1_wk30]"/>
+</storageModule>
+<storageModule filesCache="M:\AppRegister_LaunchAPP\group\AppRegister.mmp;M:\AppRegister_LaunchAPP\group\bld.inf;" includesCache="M:/AppRegister_LaunchAPP/inc[LOCAL];M:/epoc32/include;M:/epoc32/include/mw;M:/epoc32/include/platform/mw;M:/epoc32/include/platform;M:/epoc32/include/app;M:/epoc32/include/platform/app;M:/epoc32/include/platform/loc;M:/epoc32/include/platform/mw/loc;M:/epoc32/include/platform/app/loc;M:/epoc32/include/platform/loc/sc;M:/epoc32/include/platform/mw/loc/sc;M:/epoc32/include/platform/app/loc/sc;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__ARMCC_2__;__EPOC32__;__GENERIC_MARM__;SBSV2;__EABI__;" moduleId="configDataCache" sourcesCache="" timestampCache="1282654159546" useMmpMacrosCache="true"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/group/.project	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>AppRegister</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+		<nature>com.nokia.carbide.cdt.builder.carbideSBSv2BuilderNature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/group/AppRegExec.mmp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* 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:    
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET		  AppRegExec.exe
+TARGETTYPE	  exe
+UID			 0 0x20031EA3
+CAPABILITY      ALL
+
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE	 ../inc
+
+SOURCEPATH	  ../src
+SOURCE		  AppRegExec.cpp NotifyChange.cpp
+
+LIBRARY		 euser.lib
+LIBRARY		 efsrv.lib
+LIBRARY		sisregistryclient.lib
+
+SMPSAFE
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/group/bld.inf	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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:    
+*
+*/
+
+
+
+PRJ_PLATFORMS
+ARMV5
+
+PRJ_EXPORTS
+../rom/AppRegExec.iby CORE_IBY_EXPORT_PATH(tools,AppRegExec.iby)
+
+PRJ_MMPFILES
+AppRegExec.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/inc/AppRegExec.h	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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:    
+*
+*/
+
+
+
+
+#ifndef APPREGISTER_H_
+#define APPREGISTER_H_
+//  Include Files
+
+#include <e32base.h>
+
+//  Function Prototypes
+
+GLDEF_C TInt E32Main();
+
+#endif /* APPREGISTER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/inc/NotifyChange.h	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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:    
+*
+*/
+
+
+
+
+#ifndef NOTIFYCHANGE_H_
+#define NOTIFYCHANGE_H_
+
+//System Includes
+#include <e32base.h>
+#include <f32file.h>
+#include <opensystemtrace.h>
+
+/*
+ * This Class raise a NotifyRequest for a particular path
+ * & startes monitor file system with RFs::NotifyChange. 
+ * It receives notifications when a change occurs,
+ * it will try to list all the files from that path in ESortByDate order.
+ *  
+ */
+
+class CNotifyChange : public CActive
+    {
+ 
+public:
+    // Wrapper function to invoke the constructor
+    static CNotifyChange* NewL(const TChar aDriveLetter);
+    
+    /*
+     * wil issue a Notify Change request to FileSystem for particular path
+     */
+    
+    void StartFilesystemMonitor();
+    // Destructor;
+    ~CNotifyChange();
+
+protected:
+    // Constructor
+    CNotifyChange();
+    // 2-Phase Constructor
+    void ConstructL(const TChar aDriveLetter);
+    /*
+     *will List the  registration resources from a specified path.
+     */
+    void GetFilesFromDirL();
+    /*
+     * will register the resource with APPARC using SWI API's
+     */
+    void RegisterwithApparc(TDesC& aFileName);
+   
+    // Inherited from CActive.
+    virtual void RunL();            
+    virtual void DoCancel();
+    virtual TInt RunError(TInt aError);
+    
+private:
+    RFs iFs;
+    HBufC* iPath;
+    };
+#endif /* NOTIFYCHANGE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/rom/AppRegExec.iby	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 - 2011 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:     
+*
+*/
+
+
+
+
+
+
+
+
+/*
+-----------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    AppRegExec.iby file specifies needed components for ROM image
+
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __APPREGISTER_IBY__
+#define __APPREGISTER_IBY__
+
+file=ABI_DIR\BUILD_DIR\AppRegExec.exe                 Sys\bin\AppRegExec.exe
+
+#endif
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/sis/AppRegExec.pkg	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:    
+;
+
+;
+; UID is the exe's UID
+;
+#{"AppRegister EXE"},(0x20031EA3),1,0,0
+
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+"$(EPOCROOT)Epoc32\release\armv5\urel\AppRegExec.exe"		  -"!:\sys\bin\AppRegExec.exe"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/src/AppRegExec.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* 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:    
+*
+*/
+
+
+//  Include Files  
+
+
+#include <e32base.h>
+#include <e32std.h>
+#include <f32file.h>
+#include "AppRegExec.h"
+#include "NotifyChange.h"
+
+//  Constants
+//  Global Variables
+//  Local Functions
+
+LOCAL_C void MainL()
+    {
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+    TInt driveNumber=EDriveA; 
+    TChar driveLetter; 
+    TDriveList drivelist; 
+    User::LeaveIfError(fs.DriveList(drivelist));
+    TInt count = 0; 
+    CNotifyChange* notify;
+    for (driveNumber=EDriveA; driveNumber<=EDriveZ;driveNumber++)
+        {
+        // if drive-list entry non-zero, drive is available
+        if (drivelist[driveNumber]) 
+            {
+            User::LeaveIfError(fs.DriveToChar(driveNumber,driveLetter));
+            notify = CNotifyChange::NewL(driveLetter);
+            CleanupStack::PushL(notify);
+            count ++;
+            notify->StartFilesystemMonitor();
+            }
+        }
+    CActiveScheduler::Start();
+    fs.Close();
+    CleanupStack::PopAndDestroy(count);
+    CleanupStack::PopAndDestroy(&fs);
+    }
+
+LOCAL_C void DoStartL()
+    {
+    // Create active scheduler (to run active objects)
+    CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
+
+    MainL();
+
+    // Delete active scheduler
+    CleanupStack::PopAndDestroy(scheduler);
+    }
+
+//  Global Functions
+
+GLDEF_C TInt E32Main()
+    {
+    // Create cleanup stack
+    __UHEAP_MARK;
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    // Run application code inside TRAP harness, wait keypress when terminated
+    TRAPD(mainError, DoStartL());
+    if(mainError != KErrNone)
+        {
+        OstTrace1( TRACE_FATAL, __E32MAIN_DOSTARTL_FAIL, "AppRegExec::E32Main - DoStartL failed;mainError=%d", mainError );
+        }
+    delete cleanup;
+    __UHEAP_MARKEND;
+    return mainError;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/src/NotifyChange.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,166 @@
+/*
+* 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:    
+*
+*/
+
+
+// System includes
+#include <swi/sisregistrysession.h>
+#include <bautils.h>
+//User Includes
+#include "NotifyChange.h"
+
+// Assuming that the path of registration resources will be @ c:\private\10003a3f\imports\apps
+_LIT(KDirPath,":\\private\\10003a3f\\import\\apps\\");
+// Wildcard to get only registration resources from above Path
+_LIT(KWildName,"*_reg.rsc");
+
+/*
+ *NewL- Wrapper funtion to invoke the constructor of CNotifyChange class. 
+ */
+CNotifyChange* CNotifyChange::NewL(TChar aDriveLetter)
+    {
+    CNotifyChange* self=new (ELeave) CNotifyChange();
+    CleanupStack::PushL(self);
+    self->ConstructL(aDriveLetter);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+/*
+ * Second Phase Constructor 
+ */
+void CNotifyChange::ConstructL(TChar aDriveLetter) // second-phase constructor
+    {
+    User::LeaveIfError(iFs.Connect());
+    TBuf<KMaxFileName> aPath;
+    aPath.Append(aDriveLetter);
+    aPath.Append(KDirPath);
+    iPath = aPath.AllocL();
+    }
+
+/*
+ * Constructor
+ */
+CNotifyChange::CNotifyChange():CActive(EPriorityStandard)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+/*
+ * StartFilesystemMonitor is used for issuing a Notify Change request to FileSystem for particular path
+ */
+void CNotifyChange::StartFilesystemMonitor()
+    {
+    TRequestStatus status;
+    iFs.NotifyChange(ENotifyWrite,status,*iPath);
+    SetActive();
+    RDebug::Print(_L("*********** Isuued Notify Change Request ************ "));
+    OstTrace0( TRACE_NORMAL, __STARTFILESYSTEMMONITOR, "AppRegExec::StartFilesystemMonitor - Isuued Notify Change Request");
+    }
+
+/*
+ * RunL - Override function of CActive Class . will be invoked once FileSystem completes the request.
+ */
+void CNotifyChange::RunL()
+    {
+    TInt status = iStatus.Int();
+    if ( status == KErrCancel )
+        {
+        OstTrace1( TRACE_FATAL, __RUNL, "AppRegExec::RunL - Cancelled;status=%d",status);
+        return;
+        }
+    
+    GetFilesFromDirL();
+    // Issue notify Request Again
+    StartFilesystemMonitor();
+    }
+
+/*
+ * DoCancel - Override function of CAtive to Cancel any out standing request.
+ */
+void CNotifyChange::DoCancel()
+    {
+    // Cancel the outstanding file system request.
+    iFs.NotifyChangeCancel(iStatus);
+    }
+
+/*
+ * RunError- Override function of CActive class will be used to handle the error if any occurs in RunL .
+ */
+TInt CNotifyChange::RunError(TInt aError)
+    { 
+    OstTrace1( TRACE_FATAL, __RUNERROR, "AppRegExec::RunError;aError=%d",aError);
+    return (KErrNone);                 // Error has been handled.
+    }
+ 
+/*
+ * Destructor
+ */
+CNotifyChange::~CNotifyChange()
+    {
+    Cancel();
+    if(iPath)
+        {
+        delete iPath;
+        }
+    iFs.Close();
+    }
+
+/*
+ * GetFileFromDir- will be used to get the list of registration resources from a specified path.
+ */
+void CNotifyChange::GetFilesFromDirL()
+    {
+    iFs.SetSessionPath(iPath->Des());
+    CDir* fileList;
+    User::LeaveIfError(iFs.GetDir(KWildName,KEntryAttNormal,ESortByDate,fileList));
+    TInt count = fileList->Count();
+    if(count > 0)
+        {
+        TEntry entry = (*fileList)[count -1];
+        TPtrC filename = entry.iName;
+        TBuf<KMaxFileName> buf;
+        buf.Append(iPath->Des());
+        buf.Append(filename);
+        TBool ret = iFs.IsValidName(buf);
+        if(ret)
+            {
+            OstTrace0( TRACE_NORMAL, __GETFILESFROMDIR, "AppRegExec::GetFilesFromDir - Registrating Resources ...");
+            RegisterwithApparc(buf);
+            }
+        else
+            {
+            OstTrace1( TRACE_FATAL, __GETFILESFROMDIR_NOTVALID, "AppRegister::GetFilesFromDir - File doesn't Exist;ret=%d",ret);
+            }
+        }
+    }
+
+/*
+ * RegisterwithApparc - will be used to register the resource with APPARC using SWI API's
+ */
+void CNotifyChange::RegisterwithApparc(TDesC& aFileName)
+    {
+    Swi::RSisRegistrySession rServer;
+    TInt ret = rServer.Connect();
+    OstTrace1( TRACE_FATAL, __REGISTERWITHAPPARC_CONNECTION, "AppRegExec::RegisterwithApparc - Connection status;ret=%d",ret);
+    CleanupClosePushL( rServer );
+    TRAP(ret, rServer.AddAppRegInfoL(aFileName));
+    RDebug::Print(aFileName);
+    OstTrace1( TRACE_FATAL, __REGISTERWITHAPPARC_REGITERED, "AppRegExec::RegisterwithApparc - Registered Resource;ret= %d",ret);
+    CleanupStack::PopAndDestroy(); //rServer*/
+         
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/.cproject	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="1" concurrentBuildJobs="4" defaultMMPChangedAction="0" extraSBSv2Args="" infBuildComponents="" infFileLocation="group\bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="true" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Phone Debug (armv5_udeb) [TB10.1_wk30]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (armv5_udeb) [TB10.1_wk30]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (armv5_udeb) [TB10.1_wk30]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+<SBSV2_DATA_ID CONFIG_BASE_PLATFORM="ARMV5" CONFIG_TARGET="UDEB" SBSV2_BUILD_ALIAS="armv5_udeb" SBSV2_CONFIG_DISPLAY_STRING="Phone Debug (armv5_udeb) [TB10.1_wk30]"/>
+</storageModule>
+<storageModule filesCache="M:\AppRegExec\tsrc\group\AppRegExec_test_nrm.mmp;M:\AppRegExec\tsrc\group\Bld.inf;M:\epoc32\include\platform_paths.hrh;" includesCache="M:/AppRegExec/tsrc/inc[LOCAL];M:/epoc32/include;M:/epoc32/include/mw;M:/epoc32/include/platform/mw;M:/epoc32/include/platform;M:/epoc32/include/app;M:/epoc32/include/platform/app;M:/epoc32/include/platform/loc;M:/epoc32/include/platform/mw/loc;M:/epoc32/include/platform/app/loc;M:/epoc32/include/platform/loc/sc;M:/epoc32/include/platform/mw/loc/sc;M:/epoc32/include/platform/app/loc/sc;" macrosCache="__DLL__;_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__ARMCC_2__;__EPOC32__;__GENERIC_MARM__;SBSV2;__EABI__;_DEBUG;" moduleId="configDataCache" sourcesCache="/tsrc/inc;/tsrc/src;" timestampCache="1283855340673" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (armv5_urel) [TB10.1_wk30]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (armv5_urel) [TB10.1_wk30]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (armv5_urel) [TB10.1_wk30]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+<SBSV2_DATA_ID CONFIG_BASE_PLATFORM="ARMV5" CONFIG_TARGET="UREL" SBSV2_BUILD_ALIAS="armv5_urel" SBSV2_CONFIG_DISPLAY_STRING="Phone Release (armv5_urel) [TB10.1_wk30]"/>
+</storageModule>
+<storageModule filesCache="M:\AppRegExec\tsrc\group\AppRegExec_test_nrm.mmp;M:\AppRegExec\tsrc\group\Bld.inf;M:\epoc32\include\platform_paths.hrh;" includesCache="M:/AppRegExec/tsrc/inc[LOCAL];M:/epoc32/include;M:/epoc32/include/mw;M:/epoc32/include/platform/mw;M:/epoc32/include/platform;M:/epoc32/include/app;M:/epoc32/include/platform/app;M:/epoc32/include/platform/loc;M:/epoc32/include/platform/mw/loc;M:/epoc32/include/platform/app/loc;M:/epoc32/include/platform/loc/sc;M:/epoc32/include/platform/mw/loc/sc;M:/epoc32/include/platform/app/loc/sc;" macrosCache="__DLL__;_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__ARMCC_2__;__EPOC32__;__GENERIC_MARM__;SBSV2;__EABI__;" moduleId="configDataCache" sourcesCache="/tsrc/inc;/tsrc/src;" timestampCache="1283855340830" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/.project	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>tsrc</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+		<nature>com.nokia.carbide.cdt.builder.carbideSBSv2BuilderNature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/Bmarm/AppRegister_testU.DEF	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/Bwins/AppRegister_testU.DEF	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/EABI/AppRegExec_testu.def	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/EABI/AppRegister_testU.def	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/conf/AppRegExec_test.cfg	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,22 @@
+[Test]
+title Positive_TestCase
+create AppRegExec_test foobar
+foobar Positive_TestCase
+delete foobar
+[Endtest] 
+
+[Test]
+title Negative_TestCase
+create AppRegExec_test foobar
+foobar Negative_TestCase
+delete foobar
+[Endtest] 
+
+[Test]
+title StartBackRoundApp
+create AppRegExec_test foobar
+foobar StartBackRoundApp
+delete foobar
+[Endtest]
+
+
Binary file debugapps/appregexec/tsrc/data/AppRegExec.exe has changed
Binary file debugapps/appregexec/tsrc/data/AppUnRegister.exe has changed
Binary file debugapps/appregexec/tsrc/data/hello3.exe has changed
Binary file debugapps/appregexec/tsrc/data/hello3.rsc has changed
Binary file debugapps/appregexec/tsrc/data/hello3_reg.rsc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/group/AppRegExec_test.pkg	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,74 @@
+;
+; 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:    
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"TestAppregister"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"/epoc32/release/armv5/urel/AppRegExec_test.dll"   -   "!:/Sys/Bin/AppRegExec_test.dll"
+
+;TestData Binaries
+"../data/Hello3.exe"	-	"c:/Sys/Bin/Hello3.exe"
+"../data/Hello3.RSC"	-	"c:/resource/apps/Hello3.RSC"
+"../data/Hello3_reg.RSC" - "c:/data/Hello3_reg.RSC"
+
+;exe
+"../data/AppRegExec.exe"	-"c:/Sys/Bin/AppRegExec.exe"
+"../data/AppUnRegister.exe" -"c:/Sys/Bin/AppUnRegister.exe"
+
+;init file
+"../init/testframework_AppRegExec.ini"	-	"C:/TestFramework/TestFramework_AppRegExec.ini"
+
+;cfg file
+"../conf/AppRegExec_test.cfg"	-	"C:/Testframework/AppRegExec_test.cfg"
+
+  
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/group/AppRegExec_test_nrm.mmp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,52 @@
+/*TYPE TESTCLASS*//*
+* 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:    
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          AppRegExec_test.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+VENDORID     0x101FB657  // Nokia VID
+
+DEFFILE         AppRegExec_test.def
+
+USERINCLUDE     ../inc 
+
+
+APP_LAYER_SYSTEMINCLUDE
+OS_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          AppRegExec_test.cpp AppRegExec_testBlocks.cpp
+
+LIBRARY         euser.lib
+LIBRARY         StifTestInterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY			efsrv.lib 
+
+LIBRARY			bafl.lib
+
+LANG            SC
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/group/Bld.inf	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* 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:    
+*
+*/
+
+
+PRJ_PLATFORMS
+ARMV5
+
+PRJ_TESTEXPORTS
+
+PRJ_EXPORTS
+
+//PRJ_TESTMMPFILES
+
+
+
+PRJ_MMPFILES
+AppRegExec_test_nrm.mmp
+
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/inc/AppRegExec_test.h	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,172 @@
+/*
+* 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:    
+*
+*/
+
+
+#ifndef APPREGEXEC_TEST_H
+#define APPREGEXEC_TEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <e32std.h> 
+#include <f32file.h> 
+#include <bautils.h>
+
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KAppRegister_testLogPath, "\\logs\\testframework\\AppRegExec_test\\" ); 
+// Log file
+_LIT( KAppRegister_testLogFile, "AppRegExec_test.txt" ); 
+_LIT( KAppRegister_testLogFileWithTitle, "AppRegExec_test_[%S].txt" );
+
+_LIT(KMatchName,"AppRegExec.exe"); 
+_LIT( KAppRegisterEXE,"C:\\Sys\\Bin\\AppRegExec.exe");
+
+_LIT( KAppUnRegisterEXE,"C:\\Sys\\Bin\\AppUnRegister.exe");
+_LIT( KTestDataEXE,"C:\\Sys\\Bin\\Hello3.exe");
+_LIT( KTestDataRSC_SRC,"C:\\data\\Hello3_reg.RSC");
+_LIT( KTestDataRSC_DST,"c:\\private\\10003a3f\\import\\apps\\Hello3_reg.RSC");
+
+_LIT(KTestDataSessionPath,"C:\\logs\\");
+_LIT(KTestDataFile,"stopmodetestdata.txt");
+_LIT(KResourceSessionPath,"c:\\private\\10003a3f\\import\\apps\\");
+_LIT(KResRegFile,"Hello3_reg.RSC");  
+
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CAppRegExec_test;
+
+
+/**
+*  CAppRegExec_test test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CAppRegExec_test) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAppRegExec_test* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAppRegExec_test();
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAppRegExec_test( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /*
+         * Positive Test Method: This Test Case we assume that 
+         * the console App is running in backround and will try to 
+         * copy GUI app resource registration file . 
+         * So the GUI app corresponding to this resource should launch successfully.
+         */
+        virtual TInt Positive(CStifItemParser& aItem);
+        /*
+         * Negative Test Method: This Test Case checks whether the console App is not running in backround if yes, will shutdown it.
+         * Then it Will try to copy resource registration file . 
+         * So the GUI app corresponding to this resource should not launch.
+         */
+        virtual TInt Negative(CStifItemParser& aItem);
+        /*
+         * StartBackRoundApp Test mothod: This Test cases should be used to launch the Backround process
+         * which actually registers the GUI app.& which was shut down by Negative Test Case.
+         */         
+        virtual TInt StartBackRoundApp(CStifItemParser& aItem);
+        /*
+         * StartProcess - wil be used to launch any application.
+         */
+        TInt StartProcess(const TDesC16& aFileName,TBool wait);
+        /*
+         * FindProcess - This function searches the given process . 
+         * it will shutdown the process if running in backround & return true else False.
+         */
+        TBool FindProcess(const TDesC16& aPath);
+        /*
+         * CheckAndDeleteL- will takes dirPath & Filename.
+         * will check whether the provided file is Valid or not. If valid then delete it.
+         */
+        void CheckAndDeleteL(const TDesC16& aPath,const TDesC16& aFile);
+        /*
+         * IsExist - will takes dirPath & Filename.
+         * return True if valid file else False.
+         */
+        TBool IsExist(const TDesC16& aPath,const TDesC16& aFile);
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+    private:
+        RFs iFsSession;
+    };
+
+#endif      // APPREGEXEC_TEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/init/testframework_AppRegExec.ini	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,179 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#   - Set Test Reporting mode. TestReportMode's possible values are:
+#       + 'Summary': Summary of the tested test cases.
+#       + 'Environment': Hardware and software info.
+#       + 'TestCases': Test case report.
+#       + 'FullReport': Set of all above ones.
+#       + Example 'TestReportMode= Summary TestCases'
+#
+#   - CreateTestReport setting controls report creation mode
+#       + YES, Test report will created.
+#       + NO, No Test report.
+#
+#   - File path indicates the base path of the test report.
+#   - File name indicates the name of the test report.
+#
+#   - File format indicates the type of the test report.
+#       + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#       + HTML, Test report will be html type, for example 'TestReport.html'.
+#
+#   - File output indicates output source of the test report.
+#       + FILE, Test report logging to file.
+#       + RDEBUG, Test report logging to using rdebug.
+#
+#   - File Creation Mode indicates test report overwriting if file exist.
+#       + OVERWRITE, Overwrites if the Test report file exist.
+#       + APPEND, Continue logging after the old Test report information if
+#                 report exist.
+#   - Sets a device reset module's dll name(Reboot).
+#       + If Nokia specific reset module is not available or it is not correct one
+#         StifHWResetStub module may use as a template for user specific reset
+#         module.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport      # Possible values are: 'Empty', 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES           # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT           # Possible values: TXT or HTML
+TestReportOutput= FILE          # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE       # Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll   # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+Timeout= 0 
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags.
+# Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+#[New_Module]
+#ModuleName= Demomodule
+#[End_Module]
+
+[New_Module]
+ModuleName= TestScripter
+TestCaseFile= c:\Testframework\AppRegExec_test.cfg
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testscripter
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\epos_omasuplpostestercfg.cfg
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+#   Hardware and emulator environment logging path and styles can
+#   be configured from here to overwrite the Logger's implemented values.
+#
+#   Settings description:
+#   - Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#       + YES, Create log directory/directories if not allready exist.
+#       + NO, Log directory/directories not created. Only created one is used.
+#
+#   - Overwrite emulator path setting.
+#       + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
+#                  Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#                  will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#   - Overwrite emulator's logging format.
+#       + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#       + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#   - Overwrited emulator logging output source.
+#       + FILE, Logging to file(s).
+#       + RDEBUG, Logging to using rdebug(s).
+#
+#   - Overwrite hardware path setting (Same description as above in emulator path).
+#   - Overwrite hardware's logging format(Same description as above in emulator format).
+#   - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#   - File Creation Mode indicates file overwriting if file exist.
+#       + OVERWRITE, Overwrites if file(s) exist.
+#       + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#   - Will thread id include to the log filename.
+#       + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#       + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#   - Will time stamps include the to log file.
+#       + YES, Time stamp added to each line in log file(s). Time stamp is
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#       + NO, No time stamp(s).
+#
+#   - Will line breaks include to the log file.
+#       + YES, Each logging event includes line break and next log event is in own line.
+#       + NO, No line break(s).
+#
+#   - Will event ranking include to the log file.
+#       + YES, Event ranking number added to each line in log file(s). Ranking number
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#       + NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+
+CreateLogDirectories= YES       # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= TXT            # Possible values: TXT or HTML
+#EmulatorOutput= FILE           # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= TXT            # Possible values: TXT or HTML
+#HardwareOutput= FILE           # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE    # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES         # Possible values: YES or NO
+#WithTimeStamp= YES             # Possible values: YES or NO
+#WithLineBreak= YES             # Possible values: YES or NO
+#WithEventRanking= YES          # Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/src/AppRegExec_test.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,154 @@
+/*
+* 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:    
+*
+*/
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "AppRegExec_test.h"
+#include <SettingServerClient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CAppRegExec_test::CAppRegExec_test
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CAppRegExec_test::CAppRegExec_test(CTestModuleIf& aTestModuleIf):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CAppRegister_test::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CAppRegExec_test::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    ret = iFsSession.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KAppRegister_testLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KAppRegister_testLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KAppRegister_testLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CAppRegister_test::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAppRegExec_test* CAppRegExec_test::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CAppRegExec_test* self = new (ELeave) CAppRegExec_test( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CAppRegExec_test::~CAppRegExec_test()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+    iFsSession.Close();
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CAppRegExec_test::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CAppRegExec_test::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("AppRegister_test.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CAppRegExec_test::NewL( aTestModuleIf );
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debugapps/appregexec/tsrc/src/AppRegExec_testBlocks.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,273 @@
+/*
+* 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:    
+*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include <swi/sisregistrysession.h>
+#include "AppRegExec_test.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CAppRegExec_test::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CAppRegExec_test::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CAppRegExec_test::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CAppRegExec_test::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "Positive_TestCase", CAppRegExec_test::Positive ),
+        ENTRY( "Negative_TestCase", CAppRegExec_test::Negative ),
+        ENTRY( "StartBackRoundApp",CAppRegExec_test::StartBackRoundApp),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+
+/*
+ * In this Test Case we assume that the console App is running in backround and will try to copy GUI app resource 
+ * registration file . So the GUI app corresponding to this resource should launch successfully.
+ */
+TInt CAppRegExec_test::Positive(CStifItemParser& /*aItem*/)
+    {
+    TInt err = KErrNone;
+    
+    // delete Test data from C:\logs\stopmodetestdata.txt
+    CheckAndDeleteL(KTestDataSessionPath,KTestDataFile);
+    
+    // Start unRegistration Process & wait till it get exit/terminated.
+    StartProcess(KAppUnRegisterEXE,ETrue);
+        
+    // delete Resource Registration files
+    CheckAndDeleteL(KResourceSessionPath,KResRegFile);
+    
+    //Transfer the Resource Registration files
+    TInt ret = BaflUtils::CopyFile(iFsSession,KTestDataRSC_SRC,KTestDataRSC_DST);
+    
+    // wait some time till this resource get registered by background process
+    User::After(5000000);
+    
+    // Start GUI app under test which will write some testdata in filesystem and exit.
+    StartProcess(KTestDataEXE,ETrue);
+  
+    // check whether the test data written by GUI app exist .If exist then assuming that the GUI app launched 
+    // Successfully else not launched.
+    TBool isPresent = IsExist(KTestDataSessionPath,KTestDataFile);
+    if(!isPresent)
+        {
+        _LIT( KLogStr02, "Has not launched Hello.exe" );
+        iLog->Log( KLogStr02 );
+        RDebug::Print(KLogStr02);
+        return KErrGeneral;
+        }
+    return err;
+    }
+
+/*
+ * In this Test Case,the console App is not running in backround.Will try to copy resource 
+ * registration file . So the GUI app corresponding to this resource should not launch successfully.
+ */
+TInt CAppRegExec_test::Negative(CStifItemParser& /*aItem*/)
+    {
+    TInt err = KErrNone;
+    
+    // delete Test data from C:\logs\stopmodetestdata.txt
+    CheckAndDeleteL(KTestDataSessionPath,KTestDataFile);
+    
+    // Start unRegistration Process & wait till it get exit/terminated.
+    StartProcess(KAppUnRegisterEXE,ETrue);
+    
+    // delete Resource Registration files
+    CheckAndDeleteL(KResourceSessionPath,KResRegFile);
+    
+        
+    // Find the Backround Process & shut down if it is already running 
+    TBool found = FindProcess(KMatchName);
+    // If not found then there is no need to proceed with negative testing
+    // Simply returning KErrNotFound
+    if(!found)
+        {
+        return KErrNotFound;
+        }
+    
+    //Transfer the Resource Registration files
+    TInt ret = BaflUtils::CopyFile(iFsSession,KTestDataRSC_SRC,KTestDataRSC_DST);
+    
+    // Start GUI app under test which will write some testdata in filesystem and exit.
+    StartProcess(KTestDataEXE,ETrue);
+    
+    // check whether the test data written by GUI app exist .If exist then assuming that the GUI app launched 
+    // Successfully else not launched.
+    TBool isPresent = IsExist(KTestDataSessionPath,KTestDataFile);
+    
+    if(isPresent)
+        {
+        _LIT( KLogStr03, "Has launched Hello.exe" );
+        iLog->Log( KLogStr03 );
+        RDebug::Print(KLogStr03);
+        return KErrGeneral;
+        }
+    
+    return err;
+    }
+
+/*
+ * StartBackRoundApp: This Test cases should be used to launch the Backround process
+ * which actually registers the GUI app.& which was shut down by Negative Test Case.
+ * 
+ */
+TInt CAppRegExec_test::StartBackRoundApp(CStifItemParser& /*aItem*/)
+    {
+    return StartProcess(KAppRegisterEXE,EFalse);
+    }
+
+/*
+ * CheckAndDeleteL- will takes dirPath & Filename.
+ * will check whether the provided file is Valid or not. If valid then delete it.
+ */
+void CAppRegExec_test::CheckAndDeleteL(const TDesC16& aPath,const TDesC16& aFile)
+    {
+    TBuf<256> abuf;
+    abuf.Copy(aPath);
+    abuf.Append(aFile);
+    
+    TBool ret = BaflUtils::FileExists(iFsSession,abuf);
+    if(ret)
+        {
+        _LIT( KLogStr01, "CAppRegExec_test:: File deleted" );
+        iLog->Log( KLogStr01 );
+        RDebug::Print(KLogStr01);
+        iFsSession.Delete(abuf);
+        }
+    
+    }
+
+/*
+ * IsExist - will takes dirPath & Filename.
+ * return True if valid file else False.
+ */
+TBool CAppRegExec_test::IsExist(const TDesC16& aPath,const TDesC16& aFile)
+    {
+    TBuf<256> abuf;
+    abuf.Copy(aPath);
+    abuf.Append(aFile);
+    
+    TBool ret = BaflUtils::FileExists(iFsSession,abuf);
+    _LIT( KLogStr04, "CAppRegExec_test:: IsExist -FileExists bool = %d" );
+    RDebug::Print(KLogStr04,ret);
+    iLog->Log(KLogStr04,ret); 
+    return ret;
+    }
+
+
+/*
+ * StartProcess - wil be used to launch any application.
+ */
+TInt CAppRegExec_test::StartProcess(const TDesC16& aFileName,TBool wait)  // Filename with drive and path
+    {
+    RProcess proc;
+    TInt err = KErrNone;
+    err = proc.Create(aFileName, KNullDesC);
+    
+    if(wait)
+        {
+        TRequestStatus stat;
+        proc.Logon(stat);
+        proc.Resume(); 
+        // Thread is executing. Can add code here to run in parallel... 
+        // blocks here while process is running
+        User::WaitForRequest(stat);
+        // Process is ended, you can use proc.ExitType()
+        proc.Close();
+        }
+    else{
+        proc.Resume();
+        proc.Close();
+        }
+    return err;
+    }
+
+/*
+ * FindProcess - This function searches the given process . 
+ * it will shutdown the process if running in backround.
+ */
+TBool CAppRegExec_test::FindProcess(const TDesC16& aPath)
+    {
+    RProcess procHandle;
+    TFindProcess procFinder;
+    TFullName result;
+    TBool found = EFalse;
+    while(procFinder.Next(result)== KErrNone)
+        {
+        //Checking for AppRegExec.exe process with its length(14). 
+        //Since the TFindProcess conatins the process Name + some orbitary values
+        //associated with it.something like <ProcessName>[0X234567]
+
+        if(result.Left(14) == aPath)
+            {
+            
+            RDebug::Print(_L("**** Found the Process ****"));
+            RDebug::Print(result);
+            TInt err = procHandle.Open(procFinder,EOwnerThread);
+            if(err == KErrNone)
+                {
+                procHandle.Kill(0);
+                found = ETrue;
+                break;
+                }
+            }
+        }
+    procHandle.Close();
+    return found;
+    }
+
+
+
+
+//  [End of File] - Do not remove
+
+// End of File
--- a/layers.sysdef.xml	Fri Sep 17 14:22:55 2010 +0300
+++ b/layers.sysdef.xml	Mon Oct 04 10:09:02 2010 +0300
@@ -30,6 +30,9 @@
 			<module name="piprofilerui">
 				<unit unitID="tools.piprofilerui" mrp="" bldFile="&layer_real_source_path;/perfapps/piprofilerui" name="piprofilerui" proFile="piprofilerui.pro" />
 			</module>
+			<module name="appregexec">
+				<unit unitID="tools.appregexec" mrp="" bldFile="&layer_real_source_path;/debugapps/appregexec/group" name="appregexec" />
+			</module>
     </layer>
   </systemModel>
 </SystemDefinition>
\ No newline at end of file
--- a/loadgen/ui/hb/src/notifications.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/loadgen/ui/hb/src/notifications.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -27,7 +27,7 @@
 void Notifications::about()
 {
     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-    messageBox->setText("Version 1.5.1 - August 27th 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+    messageBox->setText("Version 1.5.2 - September 23rd 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
     HbLabel *header = new HbLabel("About LoadGen", messageBox);
     messageBox->setHeadingWidget(header);
     messageBox->setAttribute(Qt::WA_DeleteOnClose);
--- a/loadgen/ui/hb/src/settingsview.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/loadgen/ui/hb/src/settingsview.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -103,7 +103,7 @@
     connect(actionOk, SIGNAL(triggered()), this, SLOT(okExit()));
 	connect(actionCancel, SIGNAL(triggered()), this, SLOT(cancelled()));
 	connect(this, SIGNAL(aboutToClose()), this, SLOT(backButtonPressed()));
-	connect(mSettingForm, SIGNAL(activated(const QModelIndex)), this, SLOT(dataItemDisplayed(const QModelIndex)));  
+	//connect(mSettingForm, SIGNAL(activated(const QModelIndex)), this, SLOT(dataItemDisplayed(const QModelIndex)));
 	show();
 }
 
@@ -181,6 +181,7 @@
 									  mLoadSettings);
 	mType->setContentWidgetData(QString("items"), CPULOADTYPES);
 
+	mSettingForm->addConnection(mType,SIGNAL(itemSelected(int)),this,SLOT(selectionChanged(int)));
 }
 
 // ---------------------------------------------------------------------------
@@ -227,6 +228,8 @@
 										   mLoadSettings);
 	mRandomVar->setContentWidgetData("maximum" , 100);
 	mRandomVar->setContentWidgetData("minimum", 0);	
+	
+	mSettingForm->addConnection(mType,SIGNAL(itemSelected(int)),this,SLOT(selectionChanged(int)));
 }	
 
 // ---------------------------------------------------------------------------
--- a/package_definition.xml	Fri Sep 17 14:22:55 2010 +0300
+++ b/package_definition.xml	Mon Oct 04 10:09:02 2010 +0300
@@ -41,5 +41,10 @@
 		    <unit bldFile="screengrabber" qt:proFile="screengrabber.pro"/>
       </component>
     </collection>
+    <collection id="debugapps" name="Debug Applications" level="generic">
+			<component id="appregexec" filter="s60" name="AppRegExec" purpose="development" target="device" class="tool">
+				<unit bldFile="debugapps/appregexec/group" />
+			</component>    
+    </collection>    
   </package>
 </SystemDefinition>
\ No newline at end of file
--- a/perfapps/memspyui/data/memspyui.rss	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/data/memspyui.rss	Mon Oct 04 10:09:02 2010 +0300
@@ -1019,7 +1019,7 @@
             id = EAknMessageQueryContentId;
             control = AVKON_MESSAGE_QUERY
 				{
-                message = "Version 2.2.1 - 7th September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
+                message = "Version 2.2.2 - 21st September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
 				};
 			}
 		};
@@ -1131,3 +1131,26 @@
         };
     }
 
+
+RESOURCE DIALOG r_memspy_wait_note
+    {
+	flags = EAknWaitNoteFlags;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EGeneralNote; 	//EWaitNoteId;
+            control = AVKON_NOTE 
+                { 
+				layout = EWaitLayout;
+                singular_label = "Please wait...";     
+                imagefile       = AVKON_ICON_FILE;
+                imageid         = EMbmAvkonQgn_note_progress;
+                imagemask       = EMbmAvkonQgn_note_progress_mask;
+                animation       = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
--- a/perfapps/memspyui/ui/avkon/group/memspyui.mmp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/group/memspyui.mmp	Mon Oct 04 10:09:02 2010 +0300
@@ -40,6 +40,7 @@
 source          MemSpyExportBitmapsToMemoryCardDialog.cpp
 source          MemSpyUiUtils.cpp
 source          MemSpySettings.cpp
+source			MemSpyAsyncTracker.cpp
 //
 source          MemSpyViewBase.cpp
 source          MemSpyViewMainMenu.cpp
@@ -75,9 +76,9 @@
 source          MemSpyViewThreadInfoItemGeneralInfo.cpp
 
 source          MemSpyViewHeapTracking.cpp
-source          MemSpyViewHeapTrackingResults.cpp
-source          MemSpyViewHeapTrackingSettings.cpp
+source          MemSpyViewHeapTrackingSettings.cpp 
 /*
+source          MemSpyViewHeapTrackingResults.cpp //removed 
 source			MemSpyViewThreadInfoItemMemoryTracking.cpp
 source			MemSpyViewMemoryTrackingAutoStartConfig.cpp
 source			MemSpyViewWindowGroups.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyAsyncTracker.h	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 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:
+* 
+*/
+
+#ifndef MEMSPYASYNCTRACKER_H_
+#define MEMSPYASYNCTRACKER_H_
+
+#include <e32base.h>
+#include <aknwaitdialog.h> 
+#include <memspysession.h>
+
+
+class CMemSpyWaitNote : public CBase, public MProgressDialogCallback
+	{
+public:
+	
+	~CMemSpyWaitNote();
+	
+	void StartWaitNoteL();
+	
+	void DialogDismissedL (TInt aButtonId);
+	 
+private:
+	CAknWaitDialog* iWaitDialog;
+	};
+
+
+class CMemSpyAsyncTracker : public CActive
+{	
+public:
+
+    ~CMemSpyAsyncTracker();
+    
+	CMemSpyAsyncTracker(RMemSpySession& aSession, void (RMemSpySession::*function)(TRequestStatus&));	
+	
+	void StartL();	
+	
+	virtual void RunL();
+	
+	virtual void DoCancel();
+	
+	virtual TInt RunError(TInt aError);
+		
+private:
+	
+	CMemSpyWaitNote* iWaitNote;
+	
+	void (RMemSpySession::*iFunction)(TRequestStatus&);
+	
+	RMemSpySession& iSession;
+};
+
+
+
+
+
+
+
+class CMemSpySwmtDumpTracker : public CMemSpyAsyncTracker
+{
+public:
+	CMemSpySwmtDumpTracker(RMemSpySession& aSession) : 
+		CMemSpyAsyncTracker(aSession, &RMemSpySession::ForceSwmtUpdate)
+	{}
+};
+
+
+
+
+class CMemSpySwmtStartTimerTracker : public CMemSpyAsyncTracker
+{
+public:
+	CMemSpySwmtStartTimerTracker(RMemSpySession& aSession) : 
+		CMemSpyAsyncTracker( aSession, &RMemSpySession::StartSwmtTimer )
+	{}
+};
+
+
+#endif /* MEMSPYASYNCTRACKER_H_ */
--- a/perfapps/memspyui/ui/avkon/inc/MemSpySettings.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpySettings.h	Mon Oct 04 10:09:02 2010 +0300
@@ -57,6 +57,10 @@
     void GetSettingsFileNameL( TDes& aFileName );
     void GetSettingsPathL( TDes& aPath );
     RFile SettingsFileLC( TBool aReplace = EFalse );
+    
+    //new methods according to new architecture
+    void GetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
+    void SetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig );  
 
 private: // Data members
     RFs& iFsSession;    
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyUiUtils.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyUiUtils.h	Mon Oct 04 10:09:02 2010 +0300
@@ -79,7 +79,7 @@
 public:
     static void Format( TDes& aBuf, TInt aResourceId, ...);
     static void GetErrorText( TDes& aBuf, TInt aError );
-    static HBufC* FormatItem( const TDesC& aCaption );
+    static HBufC* FormatItemLC( const TDesC& aCaption );
     static TDesC& ThreadInfoItemNameByType( TMemSpyThreadInfoItemType aType );
     static void AppendPriority( TDes& aDes, TProcessPriority aPriority );
     static void AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  );
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewHeapTracking.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewHeapTracking.h	Mon Oct 04 10:09:02 2010 +0300
@@ -28,6 +28,7 @@
 #include <memspy/engine/memspyenginehelpersysmemtrackerobserver.h>
 
 // User includes
+#include "MemSpyAsyncTracker.h"
 #include "MemSpyViewBase.h"
 
 // Classes referenced
@@ -59,12 +60,14 @@
     void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
     
 private: // Internal methods
-    TInt IndexByViewType( TMemSpyViewType aType );
+    TInt IndexByViewTypeL( TMemSpyViewType aType );
     void SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode aMode, TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
     TInt AsyncStopTimerCallback();
-    void GetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
-    void SetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
-
+    void GetSwmtConfigL( TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
+    void SetSwmtConfigL( TMemSpyEngineHelperSysMemTrackerConfig& aConfig );    	
+	void DumpNowL();
+	void StartSwmtTimerL();
+    
 private: // Enum
     enum TMemSpyViewHeapTrackingState
         {
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelContainers.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelContainers.h	Mon Oct 04 10:09:02 2010 +0300
@@ -23,6 +23,7 @@
 #include <coecntrl.h>
 #include <aknlists.h>
 #include <BADESCA.H>
+#include <aknwaitdialog.h>
 
 // User includes
 #include "MemSpyViewBase.h"
@@ -66,6 +67,8 @@
 private: // Data members
     //CMemSpyEngineGenericKernelObjectContainer* iModel;
     RArray<CMemSpyApiKernelObject*> iKernelObjects; //array of raw items data
+    
+    CAknWaitDialog* iWaitDialog;
     };
 
 
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelHeap.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelHeap.h	Mon Oct 04 10:09:02 2010 +0300
@@ -58,15 +58,15 @@
 
 private: // Internal methods
     //CDesCArrayFlat* FormatModel( RArray<CMemSpyApiHeap*> &aHeap );
-    CDesCArrayFlat* FormatModel( CMemSpyApiHeap* aHeap );
-    HBufC* FormatItem( const TDesC& aCaption, const TDesC& aValue );
-    HBufC* FormatItem( const TDesC& aCaption, TInt aValue );
-    HBufC* FormatItem( const TDesC& aCaption, TUint aValue );
-    HBufC* FormatItem( const TDesC& aCaption, const TInt64& aValue );
-    HBufC* FormatItem( const TDesC& aCaption, TAny* aValue );
-    HBufC* FormatItem( const TDesC& aCaption, TUint* aValue );
-    HBufC* FormatItem( const TDesC& aCaption, TUint8* aValue );
-    HBufC* FormatPercentageItem( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue );
+    CDesCArrayFlat* FormatModelLC( CMemSpyApiHeap* aHeap );
+    HBufC* FormatItemLC( const TDesC& aCaption, const TDesC& aValue );
+    HBufC* FormatItemLC( const TDesC& aCaption, TInt aValue );
+    HBufC* FormatItemLC( const TDesC& aCaption, TUint aValue );
+    HBufC* FormatItemLC( const TDesC& aCaption, const TInt64& aValue );
+    HBufC* FormatItemLC( const TDesC& aCaption, TAny* aValue );
+    HBufC* FormatItemLC( const TDesC& aCaption, TUint* aValue );
+    HBufC* FormatItemLC( const TDesC& aCaption, TUint8* aValue );
+    HBufC* FormatPercentageItemLC( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue );
 
 private: // Data members
     };
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h	Mon Oct 04 10:09:02 2010 +0300
@@ -91,6 +91,8 @@
     TInt iCurrItemIndex;
     CDesCArrayFlat* iModel;
     RArray<CMemSpyApiKernelObjectItem*> iKernelObjectItems;
+    
+    CAknWaitDialog* iWaitDialog;
     };
 
 #endif
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewProcesses.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewProcesses.h	Mon Oct 04 10:09:02 2010 +0300
@@ -96,7 +96,7 @@
 private: // Internal methods
     void SelectListBoxItemByFindTextL();
     
-    CDesCArrayFlat* FormatModel( RArray<CMemSpyApiProcess*> aProcesses );
+    CDesCArrayFlat* FormatModelLC( const RArray<CMemSpyApiProcess*> &aProcesses );
     void AppendPriority( TDes& aDes, TProcessPriority aPriority );
     void AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  );
     void AppendExitType( TDes& aDes, TExitType aType );
@@ -106,7 +106,7 @@
     TProcessId iCurrentProcessId;
     CAknSearchField* iSearchField;
     HBufC* iMatcherBuffer;
-    RArray<CMemSpyApiProcess*> iProcesses;  //cigasto
+    RPointerArray<CMemSpyApiProcess> iProcesses;
     CDesCArrayFlat* iModel;
     CDesCArrayFlat* model;
     };
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewServerList.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewServerList.h	Mon Oct 04 10:09:02 2010 +0300
@@ -67,8 +67,7 @@
     CMemSpyEngineServerList* iList;
     const CMemSpyEngineServerEntry* iActionedItem;
     TInt iActionedItemIndex;
-    RArray<CMemSpyApiServer*> iServers;
-    CDesCArrayFlat* iModel;  
+    RPointerArray<CMemSpyApiServer> iServers;
     TSortType iSort;
     };
 
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h	Mon Oct 04 10:09:02 2010 +0300
@@ -78,9 +78,6 @@
 private: // Member data
     CAknWaitDialog* iWaitNote;
     CPeriodic* iWaitConstructionChecker;
-    
-    RArray<CMemSpyApiThreadInfoItem*> iThreadInfoItems;  //cigasto
-    CDesCArrayFlat* iModel;
     TThreadId iThreadId;
     TProcessId iParentProcessId;
     TMemSpyThreadInfoItemType iType;
--- a/perfapps/memspyui/ui/avkon/inc/MemSpyViewThreads.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/inc/MemSpyViewThreads.h	Mon Oct 04 10:09:02 2010 +0300
@@ -78,8 +78,7 @@
     TThreadId iCurrentThreadId;
     TProcessId iParentProcessId;
     
-    RArray<CMemSpyApiThread*> iThreads;
-    CDesCArrayFlat* iModel;
+    RPointerArray<CMemSpyApiThread> iThreads;
     };
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyAsyncTracker.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 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:
+*
+*/
+#include <memspyui.rsg>
+
+#include "MemSpyAsyncTracker.h"
+
+CMemSpyAsyncTracker::CMemSpyAsyncTracker(RMemSpySession& aSession, void (RMemSpySession::*function)(TRequestStatus&)) :
+	CActive(EPriorityIdle), 
+	iFunction(function),
+	iSession(aSession)
+    {
+	CActiveScheduler::Add(this);
+    }
+
+CMemSpyAsyncTracker::~CMemSpyAsyncTracker()
+    {
+    delete iWaitNote;
+    }
+
+void CMemSpyAsyncTracker::RunL()
+    { 
+    // If an error occurred handle it in RunError().
+    User::LeaveIfError(iStatus.Int());
+ 
+    // Operation has finished successfully 
+    iWaitNote->DialogDismissedL(0);        
+    
+    delete this;
+    }
+
+void CMemSpyAsyncTracker::DoCancel()
+    {
+	// nothing to do here
+    }
+
+TInt CMemSpyAsyncTracker::RunError(TInt aError)
+	{ 	
+	return KErrNone;
+	}
+
+void CMemSpyAsyncTracker::StartL()
+	{
+	(iSession.*iFunction)(iStatus);
+	
+	SetActive();
+	
+	iWaitNote = new (ELeave) CMemSpyWaitNote;
+		
+	iWaitNote->StartWaitNoteL();
+	}
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyWaitNote::~CMemSpyWaitNote()
+	{
+	delete iWaitDialog;
+	}
+
+void CMemSpyWaitNote::StartWaitNoteL()
+	{
+	iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**, &iWaitDialog)), ETrue);
+	iWaitDialog->PrepareLC( R_MEMSPY_WAIT_NOTE );
+	iWaitDialog->SetCallback(this);
+	iWaitDialog->RunLD();
+	}
+
+void CMemSpyWaitNote::DialogDismissedL(TInt aButtonId)
+	{		
+	iWaitDialog->ProcessFinishedL();
+	}
--- a/perfapps/memspyui/ui/avkon/src/MemSpyDeviceWideOperationDialog.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyDeviceWideOperationDialog.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -244,6 +244,7 @@
 	iProgressDialog->SetCallback( this );
 	iProgressDialog->SetGloballyCapturing( ETrue );
 	iProgressInfo = iProgressDialog->GetProgressInfoL();	
+	iProgressInfo->SetFinalValue( 100 );	
 	
 	iSession.NotifyDeviceWideOperationProgress( iProgress, iStatus );
 	
--- a/perfapps/memspyui/ui/avkon/src/MemSpySettings.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpySettings.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -142,21 +142,15 @@
     
     // Verion info
     stream.WriteInt32L( KMemSpySettingsFileFormatVersion );
-    
+        
+    iMemSpySession.GetOutputSink( iSinkType );
     stream.WriteUint8L( iSinkType );
-    
+        
+    // Get SWMT config    
+    GetSwmtConfig( iSwmtConfig );
     
-    // Get SWMT config
-    //CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    //TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
-    //swmt.GetConfig( swmtConfig );
-
-    // Write SWMT settings
-    //stream.WriteInt32L( swmtConfig.TimerPeriod().Int() );
-    //stream.WriteUint8L( swmtConfig.DumpData() );
-    
-    stream.WriteInt32L( iSwmtConfig.TimerPeriod().Int() );
-    stream.WriteUint8L( iSwmtConfig.DumpData() );
+    stream.WriteInt32L( iSwmtConfig.iTimerPeriod.Int() );
+    stream.WriteUint8L( iSwmtConfig.iDumpData );
     
     // Write memory tracking auto-start process list
     /*
@@ -168,32 +162,14 @@
         TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - process tracker uid[%02d]: 0x%08x", i, uid.iUid ) );
         stream << uid;
         }
-    */    
-    stream.WriteInt32L( iUidList.Count() );
-    for( TInt i = 0; i < iUidList.Count(); i++ )
-    	{
-		const TUid uid = iUidList[ i ];
-		TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - process tracker uid[%02d]: 0x%08x", i, uid.iUid ) );
-		stream << uid;
-    	}
+    */        
     
-    // Write memory tracking categories
-    //stream.WriteInt32L( swmtConfig.iEnabledCategories );
+    // Write memory tracking categories    
     stream.WriteInt32L( iSwmtConfig.iEnabledCategories );
     
-    // Write heap tracking thread name filter
-    //stream.WriteInt32L( swmtConfig.iThreadNameFilter.Length() );
+    // Write heap tracking thread name filter    
     stream.WriteInt32L( iSwmtConfig.iThreadNameFilter.Length() );
-    
-    /*
-    if ( swmtConfig.iThreadNameFilter.Length() > 0 )
-        {
-        stream.WriteL( swmtConfig.iThreadNameFilter, swmtConfig.iThreadNameFilter.Length() );
-        }
-    
-    // Write mode
-    stream.WriteInt32L( swmtConfig.iMode );
-    */
+        
     if ( iSwmtConfig.iThreadNameFilter.Length() > 0 )
     	{
 		stream.WriteL( iSwmtConfig.iThreadNameFilter, iSwmtConfig.iThreadNameFilter.Length() );
@@ -220,9 +196,8 @@
     // Engine settings
     TMemSpySinkType type = static_cast< TMemSpySinkType >( stream.ReadUint8L() );
     TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - read sinkType: %d", type ) );
-       
-    //iEngine.InstallSinkL( type );
-    //iMemSpySession.SwitchOutputSink( type ); //TODO: to argue to set stuf in engine from here
+           
+    iMemSpySession.SwitchOutputSinkL( type ); //set value in engine
     
     // Set SWMT config
     TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
@@ -241,13 +216,14 @@
     // Restore memory tracking auto-start process uids if file format supports it...
     if ( version >= 2 )
         {
+		/*
         RArray<TUid> list;		
         CleanupClosePushL( list );
         //
         const TInt count = stream.ReadInt32L();
         
-        //CArrayFixFlat<TUid>* list = new(ELeave)CArrayFixFlat<TUid>(count);
-        //CleanupStack::PushL(list );               
+        CArrayFixFlat<TUid>* list = new(ELeave)CArrayFixFlat<TUid>(count);
+        CleanupStack::PushL(list );               
         
         for( TInt i=0; i<count; i++ )
             {
@@ -264,6 +240,7 @@
         iUidList = list; 	//TODO: to get it into the engine
         
         CleanupStack::PopAndDestroy( &list );
+        */
         }
     
     // Restore memory tracking categories 
@@ -276,10 +253,10 @@
     if ( version > 4 )
         {
         TInt len = stream.ReadInt32L();
-        if ( len > 0 )
-            {
+        if ( len > 0 && len < KMaxName )
+            {			
             stream.ReadL( swmtConfig.iThreadNameFilter, len );
-            }
+            }        
         }
 
     // Write mode
@@ -287,14 +264,42 @@
         {
         swmtConfig.iMode = (TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode)stream.ReadInt32L();
         }
+        
+    iSwmtConfig = swmtConfig;
     
-    //CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    //swmt.SetConfigL( swmtConfig );
-    //iMemSpySession.SetSwmtConfig( swmtConfig );
-    
-    iSwmtConfig = swmtConfig; 	//TODO: to get it into the engine
+    SetSwmtConfig( iSwmtConfig ); //set values in engine
     
     CleanupStack::PopAndDestroy( &stream ); // Closes file    
     }
 
+void CMemSpySettings::GetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
+	{
+	TInt categories = 0;
+	iMemSpySession.GetSwmtCategoriesL( categories );
+	aConfig.iEnabledCategories = categories;
+		
+	TInt timerPeriod = 0;
+	iMemSpySession.GetSwmtTimerIntervalL( timerPeriod );
+	aConfig.iTimerPeriod = timerPeriod;
+		
+	TBool dumpData = EFalse;
+	iMemSpySession.GetSwmtHeapDumpsEnabledL( dumpData );
+	aConfig.iDumpData = dumpData;
+			     
+	TName threadNameFilter;
+	iMemSpySession.GetSwmtFilter( threadNameFilter );
+	aConfig.iThreadNameFilter = threadNameFilter;
+			
+	TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode mode;
+	iMemSpySession.GetSwmtMode( mode );
+	aConfig.iMode = mode;	    
+	}
 
+void CMemSpySettings::SetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
+	{
+	iMemSpySession.SetSwmtMode( aConfig.iMode );
+	iMemSpySession.SetSwmtCategoriesL( aConfig.iEnabledCategories );
+	iMemSpySession.SetSwmtTimerIntervalL( aConfig.iTimerPeriod.Int() );
+	iMemSpySession.SetSwmtHeapDumpsEnabledL( aConfig.iDumpData );
+	iMemSpySession.SetSwmtFilter( aConfig.iThreadNameFilter );
+	}
--- a/perfapps/memspyui/ui/avkon/src/MemSpyUiUtils.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyUiUtils.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -63,9 +63,9 @@
         }
     }
 
-HBufC* MemSpyUiUtils::FormatItem( const TDesC& aCaption )
+HBufC* MemSpyUiUtils::FormatItemLC( const TDesC& aCaption )
 	{
-	HBufC* retBuf = HBufC::NewL( 32 );
+	HBufC* retBuf = HBufC::NewLC( 32 );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	pRetBuf.Append( _L("\t") );
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewHeapTracking.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewHeapTracking.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -1,4 +1,4 @@
-/*
+/*	
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
@@ -52,8 +52,7 @@
 
 CMemSpyViewHeapTracking::~CMemSpyViewHeapTracking()
     {
-    delete iStopTimerCallBack;
-    //iEngine.HelperSysMemTracker().RemoveObserver( this );
+    delete iStopTimerCallBack;        
     }
 
 
@@ -67,7 +66,7 @@
     // Backup current config because it may be overwritten with Basic/Full mode settings.       
     TMemSpyEngineHelperSysMemTrackerConfig config;
 
-    GetSwmtConfig( config );
+    GetSwmtConfigL( config );
     
     iOriginalConfig = config;     
         
@@ -82,7 +81,7 @@
     if  ( aSelectionRune != NULL )
         {
         const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
-        index = IndexByViewType( viewType );
+        index = IndexByViewTypeL( viewType );
         }
     iListBox->SetCurrentItemIndex( index );
     HandleListBoxItemSelectedL( index );       
@@ -130,7 +129,7 @@
     // Get current config    
     TMemSpyEngineHelperSysMemTrackerConfig config;    
     
-    GetSwmtConfig( config );
+    GetSwmtConfigL( config );
     
     //
     if  ( index == 0 )
@@ -142,10 +141,7 @@
        // if  ( !iEngine.HelperSysMemTracker().IsActive() )
         if  ( !iMemSpySession.IsSwmtRunningL() )
             {
-            iState = EMemSpyViewHeapTrackingStateSingleOn;
-            // Setting observer to be able to stop SWMT after first cycle is completed            
-            //iEngine.HelperSysMemTracker().SetObserver( this );
-            iMemSpySession.ForceSwmtUpdateL();
+			DumpNowL();            
             }
 
         // Redraw listbox 
@@ -165,8 +161,9 @@
             }
         else if ( iState == EMemSpyViewHeapTrackingStateIdle )
             {
-            iState = EMemSpyViewHeapTrackingStateTimerOn;            
-            iMemSpySession.StartSwmtTimerL();
+			iState = EMemSpyViewHeapTrackingStateTimerOn;
+			RefreshL();
+            StartSwmtTimerL();
             }
 
         // Redraw listbox 
@@ -205,15 +202,7 @@
         if ( config.iMode == TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
             {
             child = new(ELeave) CMemSpyViewHeapTrackingSettings( iMemSpySession, iObserver );
-            }
-        else
-            {
-            child = new(ELeave) CMemSpyViewHeapTrackingResults( iMemSpySession, iObserver );
-            }
-        }
-    else if ( index == 4 )
-        {
-        child = new(ELeave) CMemSpyViewHeapTrackingResults( iMemSpySession, iObserver );
+            }       
         }
     if  ( child )
         {
@@ -237,7 +226,7 @@
     // Get current config    
     TMemSpyEngineHelperSysMemTrackerConfig config;       
     
-    GetSwmtConfig( config );
+    GetSwmtConfigL( config );
 
     // 1st item
     _LIT( KItem1FormatEnable, "\tGet dump now" );
@@ -246,7 +235,7 @@
     
     // 1st item
     //if  ( iEngine.HelperSysMemTracker().IsActive() && iState == EMemSpyViewHeapTrackingStateTimerOn )
-    if  ( iMemSpySession.IsSwmtRunningL() && iState == EMemSpyViewHeapTrackingStateTimerOn )
+    if ( iState == EMemSpyViewHeapTrackingStateTimerOn ) //iMemSpySession.IsSwmtRunningL() &&
         {
         _LIT( KItem1FormatEnable, "\tStop timer\t\t%d (sec)" );
         TName item;
@@ -316,23 +305,7 @@
             break;
             }
         default: break;
-        }
-    
-    // 4th item        
-    TInt cycleCount = iMemSpySession.GetSwmtCyclesCount();    
-    
-    if ( cycleCount > 0 )
-        {
-        _LIT( KItem2Format, "\tResults\t\t%d cycles" );
-        TFullName item;
-        item.Format( KItem2Format, cycleCount );
-        model->AppendL( item );
-        }
-    else
-        {
-        _LIT( KItem2Format, "\tResults\t\tNo results" );
-        model->AppendL( KItem2Format );
-        }      
+        }         
 
     // Set up list box
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
@@ -355,17 +328,17 @@
     {
     // Stopping SWMT does not work directly from this function.
     // It has to be made asynchronously.
-   // iStopTimerCallBack = new (ELeave) CAsyncCallBack( TCallBack( CMemSpyViewHeapTracking::AsyncStopTimerCallback, this ), CActive::EPriorityStandard );
-   // iStopTimerCallBack->CallBack();
+    iStopTimerCallBack = new (ELeave) CAsyncCallBack( TCallBack( CMemSpyViewHeapTracking::AsyncStopTimerCallback, this ), CActive::EPriorityStandard );
+    iStopTimerCallBack->CallBack();
     }
 
 
-TInt CMemSpyViewHeapTracking::IndexByViewType( TMemSpyViewType aType )
+TInt CMemSpyViewHeapTracking::IndexByViewTypeL( TMemSpyViewType aType )
     {
     // Get current config	
     TMemSpyEngineHelperSysMemTrackerConfig config;    
     
-    GetSwmtConfig( config );
+    GetSwmtConfigL( config );
     
     TInt index = 0;
     //
@@ -426,7 +399,7 @@
         default: User::Leave( KErrArgument );
         }
     // Push changes to SWMT
-    SetSwmtConfig( aConfig );
+    SetSwmtConfigL( aConfig );
     Settings().StoreSettingsL();
     }
 
@@ -451,7 +424,7 @@
     return KErrNone;
     }
 
-void CMemSpyViewHeapTracking::GetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
+void CMemSpyViewHeapTracking::GetSwmtConfigL( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
 	{
 	TInt categories = 0;
 	iMemSpySession.GetSwmtCategoriesL( categories );
@@ -474,7 +447,7 @@
 	aConfig.iMode = mode;	     	
 	}
 
-void CMemSpyViewHeapTracking::SetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
+void CMemSpyViewHeapTracking::SetSwmtConfigL( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
 	{
 	iMemSpySession.SetSwmtMode( aConfig.iMode );
 	iMemSpySession.SetSwmtCategoriesL( aConfig.iEnabledCategories );
@@ -483,4 +456,18 @@
 	iMemSpySession.SetSwmtFilter( aConfig.iThreadNameFilter );
 	}
 
+void CMemSpyViewHeapTracking::DumpNowL()
+	{
+	iState = EMemSpyViewHeapTrackingStateSingleOn;	            	
+		
+	CMemSpySwmtDumpTracker* tracker = new (ELeave) CMemSpySwmtDumpTracker( iMemSpySession );		
+	
+	tracker->StartL();		
+	}
 
+void CMemSpyViewHeapTracking::StartSwmtTimerL()
+	{
+	CMemSpySwmtStartTimerTracker* tracker = new (ELeave) CMemSpySwmtStartTimerTracker( iMemSpySession );
+	
+	tracker->StartL();
+	}
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -48,17 +48,29 @@
 
 CMemSpyViewKernelContainers::~CMemSpyViewKernelContainers()
     {
-	iKernelObjects.Reset();	
-    //delete iModel;
+    for (TInt i=0; i<iKernelObjects.Count(); i++)
+        {
+        delete iKernelObjects[i];
+        }
+    iKernelObjects.Close();
+    
+    if( iWaitDialog )    	
+		delete iWaitDialog;    
     }
 
 
 void CMemSpyViewKernelContainers::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
     {
+	iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**, &iWaitDialog)), ETrue);
+	iWaitDialog->PrepareLC( R_MEMSPY_WAIT_NOTE );	
+	iWaitDialog->RunLD();
+	
     _LIT( KTitle, "Kernel Objects" );
     SetTitleL( KTitle );
     //    
     CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    
+    iWaitDialog->ProcessFinishedL();
     }
 
 
@@ -99,9 +111,14 @@
 
 
 void CMemSpyViewKernelContainers::SetListBoxModelL()
-    {	
+    {
+    for (TInt i=0; i<iKernelObjects.Count(); i++)
+        {
+        delete iKernelObjects[i];
+        }
 	iMemSpySession.GetKernelObjects( iKernelObjects );
 		
+	
 	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iKernelObjects.Count() ); //array for formated items
 	
 	for( TInt i=0 ; i<iKernelObjects.Count() ; i++ )
@@ -137,7 +154,7 @@
 	
 	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );	
 	listbox->Model()->SetItemTextArray( model );
-	listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+	listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
     }
 
 
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -98,16 +98,18 @@
 
 void CMemSpyViewKernelHeap::SetListBoxModelL()
     {	
-	CMemSpyApiHeap* iHeap;
-	iHeap = iMemSpySession.GetHeap( );
+	CMemSpyApiHeap* heap = iMemSpySession.GetHeap();
+	User::LeaveIfNull( heap );
+	CleanupStack::PushL( heap );
 		
-	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( 22 );
-		
-	model = FormatModel( iHeap );	
+	CDesCArrayFlat* model = FormatModelLC( heap );	
 				
 	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
 	listbox->Model()->SetItemTextArray( model );
-	listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );			
+	listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+	
+	CleanupStack::Pop( model );
+	CleanupStack::PopAndDestroy( heap );
 	}
 
 
@@ -137,9 +139,10 @@
 
 
 //CDesCArrayFlat* CMemSpyViewKernelHeap::FormatModel( RArray<CMemSpyApiHeap*> &aHeap )
-CDesCArrayFlat* CMemSpyViewKernelHeap::FormatModel( CMemSpyApiHeap* aHeap )
+CDesCArrayFlat* CMemSpyViewKernelHeap::FormatModelLC( CMemSpyApiHeap* aHeap )
 	{
 	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( 2 );
+	CleanupStack::PushL( model );
 	
 	if (aHeap) 
 	    {
@@ -166,140 +169,163 @@
         _LIT( KItem11, "Max. length" );
         _LIT( KItem12, "Debug Allocator Library" );
          
-        HBufC* hItem = FormatItem( KItem0, aHeap->Type() );
+        HBufC* hItem = FormatItemLC( KItem0, aHeap->Type() );
         TPtr pItem(hItem->Des());
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();	
         
-        hItem = FormatItem( KItem1, aHeap->Size() );
+        hItem = FormatItemLC( KItem1, aHeap->Size() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();	
         
         TUint address( aHeap->BaseAddress() );	
-        hItem = FormatItem( KItem8b, address );
+        hItem = FormatItemLC( KItem8b, address );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
         if(aHeap->Shared()) //Yes / No value formatting		
-            hItem = FormatItem( KItem1b, KMemSpyCaptionYes );		
+            hItem = FormatItemLC( KItem1b, KMemSpyCaptionYes );		
         else		
-            hItem = FormatItem( KItem1b, KMemSpyCaptionNo );	
+            hItem = FormatItemLC( KItem1b, KMemSpyCaptionNo );	
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem2, aHeap->ChunkSize() );
+        hItem = FormatItemLC( KItem2, aHeap->ChunkSize() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem3, aHeap->AllocationsCount() );
+        hItem = FormatItemLC( KItem3, aHeap->AllocationsCount() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem4, aHeap->FreeCount() );
+        hItem = FormatItemLC( KItem4, aHeap->FreeCount() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem5, aHeap->BiggestAllocation() );
+        hItem = FormatItemLC( KItem5, aHeap->BiggestAllocation() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem6, aHeap->BiggestFree() );
+        hItem = FormatItemLC( KItem6, aHeap->BiggestFree() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem6a, aHeap->TotalAllocations() );
+        hItem = FormatItemLC( KItem6a, aHeap->TotalAllocations() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem6b, aHeap->TotalFree() );
+        hItem = FormatItemLC( KItem6b, aHeap->TotalFree() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem7, aHeap->SlackFreeSpace() );
+        hItem = FormatItemLC( KItem7, aHeap->SlackFreeSpace() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
         TReal iOneHundred( aHeap->Size() );
         TReal iValue( aHeap->Fragmentation() );	
-        hItem = FormatPercentageItem( KItem8a, iOneHundred, iValue );
+        hItem = FormatPercentageItemLC( KItem8a, iOneHundred, iValue );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem13, aHeap->HeaderSizeA() );
+        hItem = FormatItemLC( KItem13, aHeap->HeaderSizeA() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem14, aHeap->HeaderSizeF() );
+        hItem = FormatItemLC( KItem14, aHeap->HeaderSizeF() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem9a, aHeap->AllocationOverhead() );
+        hItem = FormatItemLC( KItem9a, aHeap->AllocationOverhead() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem9b, aHeap->FreeOverhead() );
+        hItem = FormatItemLC( KItem9b, aHeap->FreeOverhead() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem9c, aHeap->TotalOverhead() );
+        hItem = FormatItemLC( KItem9c, aHeap->TotalOverhead() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
         TReal iOverhead( aHeap->Overhead() );	
-        hItem = FormatPercentageItem( KItem9d, iOneHundred, iOverhead );	
+        hItem = FormatPercentageItemLC( KItem9d, iOneHundred, iOverhead );	
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
-        hItem = FormatItem( KItem10, aHeap->MinLength() );
+        hItem = FormatItemLC( KItem10, aHeap->MinLength() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
             
-        hItem = FormatItem( KItem11, aHeap->MaxLength() );
+        hItem = FormatItemLC( KItem11, aHeap->MaxLength() );
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
         
         if( aHeap->DebugAllocatorLibrary() )		
-            hItem = FormatItem( KItem12, KMemSpyCaptionYes );		
+            hItem = FormatItemLC( KItem12, KMemSpyCaptionYes );		
         else
-            hItem = FormatItem( KItem12, KMemSpyCaptionNo );	
+            hItem = FormatItemLC( KItem12, KMemSpyCaptionNo );	
         pItem = hItem->Des();
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();
 	    }
 	else
 	    {
-        HBufC* hItem = FormatItem( _L("Not Found"), _L("") );
+        HBufC* hItem = FormatItemLC( _L("Not Found"), _L("") );
         TPtr pItem(hItem->Des());
         model->AppendL( pItem );
+        CleanupStack::PopAndDestroy( hItem );
         pItem.Zero();	    
 	    }
 	
 	return model;
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, const TDesC& aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, const TDesC& aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	pRetBuf.Append( _L("\t") );
@@ -309,9 +335,9 @@
 	return retBuf;
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TInt aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, TInt aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
     
@@ -326,9 +352,9 @@
 	return retBuf;
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, TUint aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
     
@@ -344,9 +370,9 @@
 	return retBuf;	
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, const TInt64& aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, const TInt64& aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	    
@@ -361,9 +387,9 @@
 	return retBuf;	
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TAny* aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, TAny* aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 		    
@@ -378,9 +404,9 @@
 	return retBuf;	
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint* aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, TUint* aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 		    
@@ -395,9 +421,9 @@
 	return retBuf;	
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint8* aValue )
+HBufC* CMemSpyViewKernelHeap::FormatItemLC( const TDesC& aCaption, TUint8* aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );
+	HBufC* retBuf = HBufC::NewLC( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 		    
@@ -412,9 +438,9 @@
 	return retBuf;	
 	}
 
-HBufC* CMemSpyViewKernelHeap::FormatPercentageItem( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue )
+HBufC* CMemSpyViewKernelHeap::FormatPercentageItemLC( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( KMaxName );	//buffer for formatted item
+	HBufC* retBuf = HBufC::NewLC( KMaxName );	//buffer for formatted item
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -26,6 +26,7 @@
 #include <aknnotewrappers.h>
 #include <apgwgnam.h>
 #include <aknmessagequerydialog.h>
+#include <aknwaitdialog.h>
 
 // Engine includes
 #include <memspy/engine/memspyengine.h>
@@ -71,20 +72,35 @@
         iNavContainer->Pop( iNavDecorator );
         delete iNavDecorator;
         }
-    delete iModel;
     delete iItems;
     delete iObjectList;
+    
+    if( iWaitDialog )
+    	delete iWaitDialog;
+    
+    for (TInt i=0; i<iKernelObjectItems.Count(); i++)
+        {
+        delete iKernelObjectItems[i];
+    }
+
+    iKernelObjectItems.Close();
     }
 
 
 void CMemSpyViewKernelObjects::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
     {
+	iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**, &iWaitDialog)), ETrue);
+	iWaitDialog->PrepareLC( R_MEMSPY_WAIT_NOTE );	
+	iWaitDialog->RunLD();
+	
     _LIT( KTitle, "Kernel Objects" );
     SetTitleL( KTitle );
     iItems = new(ELeave) CDesCArrayFlat(5);
     //
     CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
     CreateTabsL();
+    
+    iWaitDialog->ProcessFinishedL(); 
     }
 
 
@@ -107,9 +123,9 @@
 
 
 void CMemSpyViewKernelObjects::RefreshL()
-    {
+    {	
     SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
+    CMemSpyViewBase::RefreshL();               
     }
 
 
@@ -168,9 +184,14 @@
     //_LIT( KLineFormatSpec, "\t%S" );
     _LIT( KTab, "\t" );
        
+    for (TInt i=0; i<iKernelObjectItems.Count(); i++)
+        {
+        delete iKernelObjectItems[i];
+        }
     iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );    
     
-    iModel = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() + 1 ); //array for formated items, +1 added there for 0 case - creating 0-sized array panics
+    CDesC16ArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() + 1 ); //array for formated items, +1 added there for 0 case - creating 0-sized array panics
+    CleanupStack::PushL( model );
         
     for ( TInt i = 0; i < iKernelObjectItems.Count(); i++ )
         {
@@ -182,14 +203,16 @@
         TBuf<KMaxName> temp;
         temp.Copy(iKernelObjectItems[i]->Name());    	
         tempNamePtr.Append( temp	 );
-        iModel->AppendL( tempNamePtr );
+        model->AppendL( tempNamePtr );
             
         CleanupStack::PopAndDestroy( tempName ); 
         }
     
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iModel );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );       
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    
+    CleanupStack::Pop( model );
     }
 
 
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewProcesses.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewProcesses.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -56,8 +56,7 @@
 
 CMemSpyViewProcesses::~CMemSpyViewProcesses()
     {	
-	iProcesses.Reset();
-    //delete iSearchField;
+	iProcesses.ResetAndDestroy();
     delete iMatcherBuffer;
     }
 
@@ -65,7 +64,15 @@
 //void CMemSpyViewProcesses::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
 void CMemSpyViewProcesses::ConstructL( const TRect& aRect, CCoeControl& aContainer, TProcessId aSelectionRune )
     {
-	iMemSpySession.GetProcessesL(iProcesses); // get processes array;
+    RArray<CMemSpyApiProcess*> processes;
+	iMemSpySession.GetProcessesL( processes ); // get processes array;
+	CleanupClosePushL( processes );
+	iProcesses.ResetAndDestroy();
+	for (TInt i=0; i<processes.Count(); i++)
+	    {
+	    iProcesses.Append(processes[i]);
+	    }
+	CleanupStack::PopAndDestroy( &processes );
 	
     _LIT( KTitle, "Processes\n& Threads" );
     SetTitleL( KTitle );
@@ -302,7 +309,7 @@
     if ( doTerminate )
         {        
         TRAP( err, iMemSpySession.EndProcessL( iCurrentProcessId, ETerminate ) );
-        if( err = KErrNone )
+        if( err == KErrNone )
             RefreshL();
         }        
     }
@@ -358,21 +365,23 @@
 
 void CMemSpyViewProcesses::SetListBoxModelL()
     {	
-	if( iProcesses.Count() > 0 )
-		{
-		iProcesses.Close();
-		}
-	
-	iMemSpySession.GetProcessesL(iProcesses); // get processes array;
-	iModel = new (ELeave) CDesC16ArrayFlat( iProcesses.Count() + 1); //array for formated items
-	
-	_LIT( KTab, "\t" );
-	iModel = FormatModel( iProcesses ); //TODO Format model method with advanced formatting
+    RArray<CMemSpyApiProcess*> processes;
+    iMemSpySession.GetProcessesL( processes ); // get processes array;
+    CleanupClosePushL( processes );
+    iProcesses.ResetAndDestroy();
+    for (TInt i=0; i<processes.Count(); i++)
+        {
+        iProcesses.Append( processes[i] );
+        }
+    
+    CDesCArrayFlat* model = FormatModelLC( processes ); //TODO Format model method with advanced formatting
 		
 	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    //listbox->Model()->SetItemTextArray( &iEngine.Container() );
-    listbox->Model()->SetItemTextArray( iModel );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    
+    CleanupStack::Pop( model );
+    CleanupStack::PopAndDestroy( &processes );
     }
 
 
@@ -561,9 +570,11 @@
 //Model formating methods
 //TODO: to be debbuged
 
-CDesCArrayFlat* CMemSpyViewProcesses::FormatModel( RArray<CMemSpyApiProcess*> aProcesses )
+CDesCArrayFlat* CMemSpyViewProcesses::FormatModelLC( const RArray<CMemSpyApiProcess*> &aProcesses )
 	{		
-	model = new (ELeave) CDesC16ArrayFlat( iProcesses.Count() + 16 ); //array for formated items
+    CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iProcesses.Count() + 16 ); //array for formated items
+    CleanupStack::PushL( model );
+    
 	_LIT( KMemSpyProcessNameFormatSpecBasicName, " \t%S\t\t%8x, " );
 	
 	for( TInt i=0; i < aProcesses.Count(); i++ )
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewServerList.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewServerList.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -53,7 +53,8 @@
 CMemSpyViewServerList::~CMemSpyViewServerList()
     {
     delete iList;
-    iServers.Reset();    
+    
+    iServers.ResetAndDestroy();
     }
 
 
@@ -138,57 +139,67 @@
 void CMemSpyViewServerList::SetListBoxModelL()
     {
 	TInt err = KErrNone;	
-	iModel = NULL;		
 	
-	TRAP( err, iMemSpySession.GetServersL( iServers, iSort ) );
+	RArray<CMemSpyApiServer*> servers;
+	iMemSpySession.GetServersL( servers, iSort );
+	CleanupClosePushL( servers );
 	
-	if ( err == KErrNone )
-		{
-		iModel = new (ELeave) CDesC16ArrayFlat( iServers.Count() ); //array for formated items
-		_LIT(KSession, "session");		
-		
-		for( TInt i = 0; i < iServers.Count(); i++ )
-			{		
-			HBufC* combined = HBufC::NewLC( iServers[i]->Name().Length() + 128 );
+	// copy servers to iServers array
+	iServers.ResetAndDestroy();
+	for (TInt i=0; i<servers.Count(); i++)
+	    {
+	    iServers.Append(servers[i]);
+	    }
+	
+	CleanupStack::PopAndDestroy( &servers );
+	
+    CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iServers.Count() ); //array for formated items
+    CleanupStack::PushL( model );
+    
+    _LIT(KSession, "session");		
+    
+    for( TInt i = 0; i < iServers.Count(); i++ )
+        {		
+        HBufC* combined = HBufC::NewLC( iServers[i]->Name().Length() + 128 );
 
-			TPtr pCombined( combined->Des() );
-			pCombined.Zero();
-			pCombined.Copy( _L("\t") );
-			
-			if( iServers[i]->Name() != KNullDesC )
-				{
-				pCombined.Append( iServers[i]->Name() );
-				}
-			
-			pCombined.Append( _L("\t\t") );
-			TBuf<16> count;
-			_LIT( KCount, "%d session");
-			
-			count.Format( KCount, iServers[i]->SessionCount() );
-			pCombined.Append( count );
-			
-			if( iServers[i]->SessionCount() != 1 )				
-				{
-				_LIT( KS, "s" );
-				pCombined.Append( KS );
-				}
-			
-			iModel->AppendL( pCombined );	
-			
-			CleanupStack::PopAndDestroy(combined);
-			}
-		}
+        TPtr pCombined( combined->Des() );
+        pCombined.Zero();
+        pCombined.Copy( _L("\t") );
+        
+        if( iServers[i]->Name() != KNullDesC )
+            {
+            pCombined.Append( iServers[i]->Name() );
+            }
+        
+        pCombined.Append( _L("\t\t") );
+        TBuf<16> count;
+        _LIT( KCount, "%d session");
+        
+        count.Format( KCount, iServers[i]->SessionCount() );
+        pCombined.Append( count );
+        
+        if( iServers[i]->SessionCount() != 1 )				
+            {
+            _LIT( KS, "s" );
+            pCombined.Append( KS );
+            }
+        
+        model->AppendL( pCombined );	
+        
+        CleanupStack::PopAndDestroy( combined );
+        }
 	
-    //
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iModel );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );    
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    
+    CleanupStack::Pop( model );
     }
 
 
 void CMemSpyViewServerList::HandleListBoxItemActionedL( TInt aCurrentIndex )
-    {	
-    if  ( aCurrentIndex >= 0 && aCurrentIndex < iServers.Count() )
+    {
+    if  ( aCurrentIndex >= 0 && aCurrentIndex < iListBox->Model()->NumberOfItems() )
         {        
  		iActionedItemIndex = aCurrentIndex;
         }
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -215,34 +215,41 @@
 
 void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL()
     {
-	iMemSpySession.GetThreadInfoItems( iThreadInfoItems, iThreadId, iType ); // TODO don't ignore error!
-	
-	iModel = new (ELeave) CDesC16ArrayFlat( iThreadInfoItems.Count() + 10 );
+    
+    RArray<CMemSpyApiThreadInfoItem*> threadInfoItems;
+	iMemSpySession.GetThreadInfoItems( threadInfoItems, iThreadId, iType ); // TODO don't ignore error!
+	CleanupClosePushL( threadInfoItems );
 	
-	for( TInt i=0; i<iThreadInfoItems.Count(); i++)
+	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( threadInfoItems.Count() + 10 );
+	CleanupStack::PushL( model );
+	
+	for( TInt i=0; i<threadInfoItems.Count(); i++)
 		{						
-		HBufC* combined = HBufC::NewLC( iThreadInfoItems[i]->Caption().Length() + iThreadInfoItems[i]->Value().Length() + 30 );		
+		HBufC* combined = HBufC::NewLC( threadInfoItems[i]->Caption().Length() + threadInfoItems[i]->Value().Length() + 30 );		
 
 		TPtr pCombined( combined->Des() );
 		pCombined.Zero();
 		pCombined.Copy( _L("\t") );
-		if( iThreadInfoItems[i]->Caption() != KNullDesC )
-			pCombined.Append( iThreadInfoItems[i]->Caption() );
+		if( threadInfoItems[i]->Caption() != KNullDesC )
+			pCombined.Append( threadInfoItems[i]->Caption() );
 		if( iType != EMemSpyThreadInfoItemTypeChunk )
 			{
 			pCombined.Append( _L("\t\t") );
-			pCombined.Append( iThreadInfoItems[i]->Value() );
+			pCombined.Append( threadInfoItems[i]->Value() );
 			}					
 		
-		iModel->AppendL( pCombined );	
+		model->AppendL( pCombined );	
 		
-		CleanupStack::PopAndDestroy(combined);
+		CleanupStack::PopAndDestroy( combined );
 		}	
 	
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
     //listbox->Model()->SetItemTextArray( iInfoItem );
-    listbox->Model()->SetItemTextArray( iModel );
+    listbox->Model()->SetItemTextArray( model );
     listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    
+    CleanupStack::Pop( model );
+    CleanupStack::PopAndDestroy( &threadInfoItems );
     }
 
 
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -266,118 +266,100 @@
 
 void CMemSpyViewThreadInfoItemList::SetListBoxModelL()
     {	
-	CDesC16ArrayFlat* iModel = new (ELeave) CDesC16ArrayFlat( 32 );
-	
-	HBufC* iItem = HBufC::NewL( 32 );
+	CDesC16ArrayFlat* model = new (ELeave) CDesC16ArrayFlat( 32 );
+	CleanupStack::PushL( model );
 	
-	iItem = MemSpyUiUtils::FormatItem( KGeneral );
-	TPtr pItem( iItem->Des() );
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	HBufC* item;
 	
-	iItem = MemSpyUiUtils::FormatItem( KHeap );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KGeneral );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KStack );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KHeap );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KChunks );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KStack );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KCodeSegs );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KChunks );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KOpenFiles );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KCodeSegs );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KActiveObjects );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KOpenFiles );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KThreadHandlers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KActiveObjects );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KProcessHandlers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KThreadHandlers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KServers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KProcessHandlers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KConnections );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KServers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KSemaphores );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KConnections );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
+	
+	item = MemSpyUiUtils::FormatItemLC( KSemaphores );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KThreadReferences );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KThreadReferences );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KProcessReferences );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KProcessReferences );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KMutexes );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KMutexes );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KTimers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KTimers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KDD );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KDD );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KChangeNotif );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KChangeNotif );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KUndertakers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KUndertakers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KLogicalDrivers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
+	item = MemSpyUiUtils::FormatItemLC( KLogicalDrivers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
-	iItem = MemSpyUiUtils::FormatItem( KPhysicalDrivers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();		
+	item = MemSpyUiUtils::FormatItemLC( KPhysicalDrivers );
+	model->AppendL( item->Des() );
+	CleanupStack::PopAndDestroy( item );
 	
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); 
-    listbox->Model()->SetItemTextArray( iModel );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    
+    CleanupStack::Pop( model );
     }
 
 
--- a/perfapps/memspyui/ui/avkon/src/MemSpyViewThreads.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewThreads.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -46,17 +46,25 @@
 
 CMemSpyViewThreads::~CMemSpyViewThreads()
     {
-	iThreads.Reset();
+    iThreads.ResetAndDestroy();
     }
 
  
 void CMemSpyViewThreads::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
     {
-    TInt error = KErrNone; 
-	TRAP( error, iMemSpySession.GetThreadsL( iParentProcessId, iThreads ) );
+    TInt error = KErrNone;
+    RArray<CMemSpyApiThread*> threads;
+	TRAP( error, iMemSpySession.GetThreadsL( iParentProcessId, threads ) );
 	
 	if( error == KErrNone )
 	    {
+	    CleanupClosePushL( threads );
+        for (TInt i=0; i<threads.Count(); i++)
+            {
+            iThreads.Append( threads[i] );
+            }
+        CleanupStack::PopAndDestroy( &threads );
+        
 	    _LIT( KTitle, "Threads" );
 	    SetTitleL( KTitle );
 	    //
@@ -350,9 +358,20 @@
 
 
 void CMemSpyViewThreads::SetListBoxModelL()
-    {		
-	iModel = new (ELeave) CDesC16ArrayFlat( iThreads.Count() ); //array for formated items
-		
+    {
+    RArray<CMemSpyApiThread*> threads;
+    iMemSpySession.GetThreadsL( iParentProcessId, threads );
+    CleanupClosePushL( threads );
+    iThreads.ResetAndDestroy();
+    for (TInt i=0; i<threads.Count(); i++)
+        {
+        iThreads.Append( threads[i] );
+        }
+    CleanupStack::PopAndDestroy( &threads );
+    
+    CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iThreads.Count() ); //array for formated items
+    CleanupStack::PushL( model );
+    
 	_LIT( KTab, "\t" );
 	_LIT( KTTab, "\t\t" );
 			
@@ -367,14 +386,16 @@
 	    
 	    AppendPriority( tempNamePtr, iThreads[i]->ThreadPriority() );
 	    
-	    iModel->AppendL( tempNamePtr );
+	    model->AppendL( tempNamePtr );
 	    	
 	    CleanupStack::PopAndDestroy( tempName ); 
 	    }			
 	
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );    
-    listbox->Model()->SetItemTextArray( iModel );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    
+    CleanupStack::Pop( model );
     }
 
 
--- a/perfapps/memspyui/ui/hb/src/memspyview.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/memspyui/ui/hb/src/memspyview.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -142,7 +142,7 @@
 void MemSpyView::showAbout()
 {
 	HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-	messageBox->setText("Version 2.2.1 - 7th September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+	messageBox->setText("Version 2.2.2 - 21st September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
 	HbLabel *header = new HbLabel("About MemSpy", messageBox);
 	messageBox->setHeadingWidget(header);
 	messageBox->setAttribute(Qt::WA_DeleteOnClose);
--- a/perfapps/perfmon/data/perfmon.rss	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/data/perfmon.rss	Mon Oct 04 10:09:02 2010 +0300
@@ -594,7 +594,7 @@
             id = EAknMessageQueryContentId;
             control = AVKON_MESSAGE_QUERY
                 {
-                message = "Version 1.2.1 - 10th September 2010. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
+                message = "Version 1.2.2 - 24th September 2010. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
                 };
             }
         };
--- a/perfapps/perfmon/engine/src/perfmon_engine.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/engine/src/perfmon_engine.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -863,7 +863,7 @@
     iSettings.iCPUMode = ECPUModeCPUTime;
     iSettings.iKeepBacklightOn = ETrue;
 
-    iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysAlwaysOff;
+    iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysOn;
     iSettings.iDataPopupLocation = EDataPopupLocationTopRight;
     iSettings.iDataPopupSources.SetDefaults1();
 
--- a/perfapps/perfmon/group/ReleaseNotes_PerfMon.txt	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/group/ReleaseNotes_PerfMon.txt	Mon Oct 04 10:09:02 2010 +0300
@@ -1,9 +1,9 @@
 ===============================================================================
 
-RELEASE NOTES - PERFORMANCE MONITOR v1.2.1
-RELEASED 10th September 2010 
+RELEASE NOTES - PERFORMANCE MONITOR v1.2.2
+RELEASED 24th September 2010 
 
-SUPPORTS S60 5.2+
+SUPPORTS S60 3.0+
 
 ===============================================================================
 
@@ -28,9 +28,7 @@
 
 What's New in v1.2.1
 ====================
-- Feature: Power usage analysis for TB 10.1 devices 
-- Feature: Datapopup can be set to visible
-
+- Fix: Datapopup's location handling  
 
 ===============================================================================
 
@@ -67,23 +65,33 @@
 
 Known Issues:
 =============
-Datapopup can make Orbit's main menu difficult to use. Works better in landscape mode.
+- Datapopup can make Orbit's main menu difficult to use. Works better 
+	in landscape mode.
 
 ===============================================================================
 
 Version History:
 
 ================
+Version 1.2.1 - 10th September 2010
+-----------------------------------
+- Feature: Power usage analysis for Symbian^4 devices 
+- Feature: Datapopup can be set to visible
+
 Version 1.2.0 - 26th August 2010 
-====================
+--------------------------------
 - Feature: Support for multiple CPUs in the device
 - Feature: Power usage analysis in watts
-- Error corrections
+- Fix: Log to file, data sources not according to selected ones
 
-Version 1.1.1 - 26th August 2010 
-====================
-- Improved Orbit UI
-- Error corrections
+Version 1.1.1 - 21st May 2010 
+-----------------------------
+- Feature: Improved Orbit UI
+- Fix: Values not shown on UI
+
+Version 1.1.0 - 8th April 2010
+------------------------------
+- Initial Orbit version
 
 Version 1.0.0 - 6th March 2008
 ------------------------------
--- a/perfapps/perfmon/group/bld.inf	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/group/bld.inf	Mon Oct 04 10:09:02 2010 +0300
@@ -12,19 +12,9 @@
 * Contributors:
 *
 * Description:  
+* Bld.inf file to build Avkon version of PerfMon
 *
 */
 
-#include <platform_paths.hrh>
-
-prj_platforms
-
-WINSCW GCCE ARMV5 ARMV6
-
 #include "bld_generic.inf"
-
 #include "../ui/avkon/group/bld.inf"
-
-prj_mmpfiles
-
-prj_extensions
\ No newline at end of file
--- a/perfapps/perfmon/group/bld_generic.inf	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/group/bld_generic.inf	Mon Oct 04 10:09:02 2010 +0300
@@ -22,7 +22,7 @@
 ../rom/perfmon.iby CORE_IBY_EXPORT_PATH(tools,perfmon.iby)
 
 PRJ_MMPFILES
-#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
+#ifndef SBSV2
   gnumakefile perfmon_icons_aif.mk
 
   #ifdef MARM
@@ -30,7 +30,7 @@
   #endif
 #endif
 
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
+#ifdef SBSV2
   PRJ_EXTENSIONS
   START EXTENSION s60/mifconv
   OPTION TARGETFILE perfmon_aif.mif
--- a/perfapps/perfmon/ui/hb/app/app.pro	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/app/app.pro	Mon Oct 04 10:09:02 2010 +0300
@@ -58,6 +58,7 @@
         -lbafl \
         -lefsrv \
         -lavkon \
+        -leikcore \
         -lapparc \
         -lapgrfx \
         -lgdi \
--- a/perfapps/perfmon/ui/hb/app/inc/datapopup.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/app/inc/datapopup.h	Mon Oct 04 10:09:02 2010 +0300
@@ -22,13 +22,14 @@
 #include <QFont>
 
 class EngineWrapper;
+class HbMainWindow;
 
 class DataPopup : public HbDeviceDialog
 {
     Q_OBJECT
 
 public:
-    DataPopup(EngineWrapper &engine);
+    DataPopup(EngineWrapper &engine, HbMainWindow &mainWindow);
 
 public slots:
     void show();
@@ -37,19 +38,20 @@
     void updateSettings();
     void updateVisibility(bool foreground);
 
-signals:
-    void clicked();
 
 private slots:
     void triggerAction(QVariantMap data);
+    void orientationChanged(Qt::Orientation newOrientation);
+    void inForeground();
+    void inBackground();
 
 private:
     QVariantMap collectParams() const;
     void updateData();
 
 private:
-    EngineWrapper &mEngine;
-
+    EngineWrapper& mEngine;
+    HbMainWindow& mMainWindow;
     bool mPopupCreated;
 
     bool mPopupVisible;
--- a/perfapps/perfmon/ui/hb/app/src/datapopup.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/app/src/datapopup.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -15,6 +15,7 @@
 *
 */
 
+#include <HbMainWindow>
 #include <HbView>
 #include <HbEvent>
 #include <QFontMetrics>
@@ -23,14 +24,18 @@
 #include "enginewrapper.h"
 #include "popupdatacontainer.h"
 
-DataPopup::DataPopup(EngineWrapper &engine) :
+DataPopup::DataPopup(EngineWrapper &engine, HbMainWindow &mainWindow) :
         mEngine(engine),
+        mMainWindow(mainWindow),
         mPopupCreated(false),
         mPopupVisible(false)
 {
     connect(&mEngine, SIGNAL(samplesUpdated()), this, SLOT(updateSamples()));
     connect(&mEngine, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
     connect(this, SIGNAL(dataReceived(QVariantMap)), this, SLOT(triggerAction(QVariantMap)));
+    connect(&mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation)));
+    connect(&mainWindow, SIGNAL(obscured()), this, SLOT(inBackground()));
+    connect(&mainWindow, SIGNAL(revealed()), this, SLOT(inForeground()));
 }
 
 void DataPopup::show()
@@ -66,9 +71,7 @@
 
 void DataPopup::updateSettings()
 {
-    // mEngine.settings().dataPopupVisibility can only be changed from
-    // main window, so we may assume the window is in foreground
-    updateVisibility(true);
+    updateVisibility(!mMainWindow.isObscured());
     updateData();
 }
 
@@ -76,7 +79,6 @@
 {
     if (mEngine.settings().dataPopupVisibility() == EDataPopupVisbilityAlwaysOn ||
         (mEngine.settings().dataPopupVisibility() == EDataPopupVisbilityBackgroundOnly && !foreground)) {
-
         show();
     } else {
         hide();
@@ -86,12 +88,14 @@
 void DataPopup::triggerAction(QVariantMap data)
 {
     if (data.contains("mouseEvent") && data["mouseEvent"].toString() == "press") {
-        emit clicked();
-
         // data popup was clicked, move it to other position
+        hide();
+        
         mEngine.settings().setDataPopupLocation(
                 EDataPopupLocationBottomMiddle - mEngine.settings().dataPopupLocation());
         mEngine.updateSettings();
+        
+        show();
     }
 }
 
@@ -175,3 +179,23 @@
         HbDeviceDialog::update(collectParams());
     }
 }
+
+void DataPopup::orientationChanged(Qt::Orientation /*newOrientation*/)
+    {
+    // force the reposition of the window
+    if( mEngine.settings().dataPopupVisibility() == EDataPopupVisbilityAlwaysOn ||
+        (mEngine.settings().dataPopupVisibility() == EDataPopupVisbilityBackgroundOnly && mMainWindow.isObscured()) ) {
+        hide();
+        show();
+        }
+    }
+
+void DataPopup::inForeground()
+    {
+    updateVisibility(true);
+    }
+
+void DataPopup::inBackground()
+    {
+    updateVisibility(false);
+    }
--- a/perfapps/perfmon/ui/hb/app/src/main.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/app/src/main.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -15,6 +15,7 @@
 *
 */
 
+#include <eikenv.h>
 #include <QMessageBox>
 
 #include "application.h"
@@ -33,13 +34,13 @@
         return 1;
     }
 
+    // set as system application to prevent getting shut down events 
+    CEikonEnv::Static()->SetSystem( ETrue );
+    
     MainWindow window(engine);
 	window.show();
 
-    DataPopup dataPopup(engine);
-
-    QObject::connect(&app, SIGNAL(foregroundEvent(bool)),
-                     &dataPopup, SLOT(updateVisibility(bool)));
+    DataPopup dataPopup(engine, window);
 
     // TODO: pass false if run in background
     dataPopup.updateVisibility(true);
--- a/perfapps/perfmon/ui/hb/app/src/mainview.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/app/src/mainview.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <QActionGroup>
 #include <HbApplication>
+#include <hbmainwindow.h>
 #include <HbMenu>
 #include <HbToolBar>
 #include <HbAction>
@@ -84,6 +85,9 @@
 {
     // remove old widget & take ownership
     takeWidget();
+    if(scene()){
+        scene()->removeItem(mGraphDataContainer);
+    }
     mGraphDataContainer->hideContainer();
     mValueDataContainer->showContainer(); 
     // set new widget
@@ -100,6 +104,9 @@
 {
     // remove old widget & take ownership
     takeWidget();
+    if(scene()){
+        scene()->removeItem(mValueDataContainer);
+    }
     mValueDataContainer->hideContainer();    
     mGraphDataContainer->showContainer();
     // set new widget
@@ -128,7 +135,7 @@
 void MainView::showAbout()
 {
     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-    messageBox->setText("Version 1.2.1 - 10th September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+    messageBox->setText("Version 1.2.2 - 24th September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
     HbLabel *header = new HbLabel("About PerfMon", messageBox);
     messageBox->setHeadingWidget(header);
     messageBox->setAttribute(Qt::WA_DeleteOnClose);
--- a/perfapps/perfmon/ui/hb/app/src/settingsview.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/app/src/settingsview.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -81,11 +81,8 @@
     mSettingsForm->setModel(mModel);
     setWidget(mSettingsForm);
 
-
     connect(actionOk, SIGNAL(triggered()), this, SLOT(accept()));
     connect(actionCancel, SIGNAL(triggered()), this, SLOT(reject()));
-    connect(this, SIGNAL(aboutToClose()), this, SLOT(accept()));
-
 }
 
 void SettingsView::createModel(HbDataFormModel &model)
@@ -274,5 +271,6 @@
 
 void SettingsView::reject()
 {
+    load(mEngine.settings());
     emit finished(false);
 }
--- a/perfapps/perfmon/ui/hb/datapopup/inc/perfmondatapopupdialog_p.h	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/datapopup/inc/perfmondatapopupdialog_p.h	Mon Oct 04 10:09:02 2010 +0300
@@ -38,6 +38,7 @@
 public:
     enum Location
     {
+        LocationUndefined = -1,
         LocationTopRight = 0,
         LocationBottomMiddle
     };
@@ -64,9 +65,6 @@
     void deviceDialogClosed();
     void deviceDialogData(QVariantMap data);
 
-private slots:
-    void reposition();
-
 private:
     Location location() const;
     void setLocation(Location location);
--- a/perfapps/perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp	Fri Sep 17 14:22:55 2010 +0300
+++ b/perfapps/perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp	Mon Oct 04 10:09:02 2010 +0300
@@ -29,7 +29,7 @@
 PerfMonDataPopupDialog::PerfMonDataPopupDialog(const QVariantMap &parameters) :
         mLastError(NoError),
         mShowEventReceived(false),
-        mLocation(LocationTopRight),
+        mLocation(LocationUndefined),
         mWidget(new PerfMonDataPopupWidget(this))
 {
     setTimeout(0);
@@ -108,10 +108,6 @@
 // Widget is about to hide. Closing effect has ended.
 void PerfMonDataPopupDialog::hideEvent(QHideEvent *event)
 {
-    if (mainWindow()) {
-        disconnect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
-                   this, SLOT(reposition()));
-    }
     HbPopup::hideEvent(event);
     emit deviceDialogClosed();
 }
@@ -119,11 +115,6 @@
 // Widget is about to show
 void PerfMonDataPopupDialog::showEvent(QShowEvent *event)
 {
-    if (mainWindow()) {
-        connect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
-                this, SLOT(reposition()));
-    }
-    reposition();
     HbPopup::showEvent(event);
     mShowEventReceived = true;
 }
@@ -148,7 +139,13 @@
 {
     if (location != mLocation) {
         mLocation = location;
-        reposition();
+        QSize screenSize = HbDeviceProfile::profile(mainWindow()).logicalSize();
+        if(mLocation == LocationTopRight) {
+            setPreferredPos(QPointF(screenSize.width(), 0), HbPopup::TopRightCorner);
+        }
+        else{
+            setPreferredPos(QPointF(screenSize.width() / 2, screenSize.height()), HbPopup::BottomEdgeCenter);
+        }
     }
 }
 
@@ -160,24 +157,4 @@
 void PerfMonDataPopupDialog::setLines(const QStringList &lines)
 {
     mWidget->setLines(lines);
-    setPreferredSize(mWidget->preferredWidth()+30,mWidget->preferredHeight()+30);
 }
-
-void PerfMonDataPopupDialog::reposition()
-{
-    if (mainWindow()) {
-        QSize screenSize = HbDeviceProfile::profile(mainWindow()).logicalSize();
-        switch (mLocation) {
-            case LocationTopRight:
-                setPreferredPos(QPointF(screenSize.width(), 0),
-                                HbPopup::TopRightCorner);
-                break;
-
-            case LocationBottomMiddle:
-                setPreferredPos(QPointF(screenSize.width() / 2, screenSize.height()),
-                                HbPopup::BottomEdgeCenter);
-                break;
-        }
-    }
-    resize(0,0);
-}