Revision: 201031
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 10:12:07 +0300
changeset 45 a93990e5815e
parent 36 aa5a574040a4
child 52 40db28bb26b8
Revision: 201031 Kit: 201033
clfwrapper/ClientSrc/CCLFDbItemContainer.cpp
clfwrapper/ClientSrc/CCLFDbItemProvider.cpp
clfwrapper/ClientSrc/CCLFEngineImpl.cpp
clfwrapper/ClientSrc/CCLFItemImpl.cpp
clfwrapper/ClientSrc/CCLFItemListModelImpl.cpp
clfwrapper/ClientSrc/CCLFQueryAdapter.cpp
clfwrapper/ClientSrc/CCLFServerProxy.cpp
contextengine/group/contextengine.mmp
contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp
contextengine/plugins/contextplugininterface/group/contextplugininterface.mmp
contextengine/src/contextengine.cpp
group/bld.inf
harvester/blacklistclient/group/blacklistclient.mmp
harvester/blacklistclient/src/blacklistclient.cpp
harvester/blacklistclient/traces/blacklistclientTraces.h
harvester/blacklistclient/traces/fixed_id.definitions
harvester/blacklistserver/src/blacklistserver.cpp
harvester/blacklistserver/src/blacklistsession.cpp
harvester/blacklistserver/traces/blacklistserverTraces.h
harvester/blacklistserver/traces/fixed_id.definitions
harvester/client/eabi/harvesterclientarm.def
harvester/client/group/harvesterclient.mmp
harvester/client/inc/harvesterclientao.h
harvester/client/inc/harvesternotificationqueue.h
harvester/client/inc/harvesterrequestactive.h
harvester/client/src/harvesterclient.cpp
harvester/client/src/harvesterclientao.cpp
harvester/client/src/harvestereventobserverao.cpp
harvester/client/src/harvesternotificationqueue.cpp
harvester/client/src/harvesterrequestactive.cpp
harvester/client/traces/fixed_id.definitions
harvester/client/traces/harvesterclientTraces.h
harvester/client/traces/harvesterclientaoTraces.h
harvester/common/bwincw/harvestercommonwinscw.def
harvester/common/eabi/harvestercommonarm.def
harvester/common/group/harvestercommon.mmp
harvester/common/group/harvesterdata.mmp
harvester/common/group/harvesterplugininterface.mmp
harvester/common/inc/harvestdata.inl
harvester/common/inc/harvestercenreputil.h
harvester/common/inc/harvestercommon.h
harvester/common/inc/harvestereventmanager.h
harvester/common/inc/harvesterpluginfactory.h
harvester/common/inc/harvesterplugininfo.h
harvester/common/src/blacklistitem.cpp
harvester/common/src/harvestercenreputil.cpp
harvester/common/src/harvesterdata.cpp
harvester/common/src/harvestereventmanager.cpp
harvester/common/src/harvesterexifutil.cpp
harvester/common/src/harvestermediaidutil.cpp
harvester/common/src/harvesterplugin.cpp
harvester/common/src/harvesterpluginfactory.cpp
harvester/common/src/placeholderdata.cpp
harvester/common/src/propertywatcher.cpp
harvester/common/traces/fixed_id.definitions
harvester/common/traces/harvestereventmanagerTraces.h
harvester/common/traces/harvesterexifutilTraces.h
harvester/composerplugins/composerplugininterface/group/composerplugininterface.mmp
harvester/composerplugins/imagecomposer/inc/imagecomposerao.h
harvester/composerplugins/imagecomposer/src/composerimageplugin.cpp
harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp
harvester/composerplugins/imagecomposer/src/locationrelationobserver.cpp
harvester/data/bld.inf
harvester/group/bld.inf
harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h
harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp
harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp
harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h
harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp
harvester/harvesterplugins/MessagePlugin/src/harvestermessageplugin.cpp
harvester/harvesterplugins/OMADRMPlugin/group/harvesteromadrmplugin.mmp
harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h
harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp
harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h
harvester/harvesterplugins/RTPPlugin/src/harvesterrtpmetadatareader.cpp
harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp
harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h
harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp
harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h
harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp
harvester/monitorplugins/fileplugin/group/filemonitorplugin.mmp
harvester/monitorplugins/fileplugin/inc/fileeventhandlerao.h
harvester/monitorplugins/fileplugin/src/FolderRenamer.cpp
harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp
harvester/monitorplugins/fileplugin/src/filemonitorao.cpp
harvester/monitorplugins/fileplugin/src/filemonitorplugin.cpp
harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp
harvester/monitorplugins/inc/mdsfspqueue.inl
harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp
harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp
harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h
harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp
harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp
harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp
harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp
harvester/monitorplugins/monitorplugininterface/group/monitorplugininterface.mmp
harvester/server/inc/harvesterao.h
harvester/server/src/harvesterao.cpp
harvester/server/src/harvesterqueue.cpp
harvester/server/src/harvesterserver.cpp
harvester/server/src/mdeobjecthandler.cpp
harvester/server/src/ondemandao.cpp
harvester/server/src/reharvesterao.cpp
harvester/server/traces/fixed_id.definitions
harvester/server/traces/harvesteraoTraces.h
harvester/server/traces/harvesterserverTraces.h
harvester/server/traces/harvesterserversessionTraces.h
iadstoprestart/src/iadrestart.cpp
iadstoprestart/src/iadstop.cpp
inc/mdscommoninternal.h
inc/mdssqliteconnection.h
locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss
locationmanager/ReverseGeoCoderPlugin/group/bld.inf
locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp
locationmanager/ReverseGeoCoderPlugin/sis/ReverseGeoCoderPlugin_stub.sis
locationmanager/ReverseGeoCoderPlugin/sis/depends.xml
locationmanager/ReverseGeoCoderPlugin/sis/package.pkg
locationmanager/ReverseGeoCoderPlugin/sis/stub.pkg
locationmanager/ReverseGeocode/group/bld.inf
locationmanager/ReverseGeocode/group/reversegeocode.mmp
locationmanager/ReverseGeocode/inc/internalreversegeocode.h
locationmanager/ReverseGeocode/sis/ReverseGeocode_stub.sis
locationmanager/ReverseGeocode/sis/depends.xml
locationmanager/ReverseGeocode/sis/package.pkg
locationmanager/ReverseGeocode/sis/stub.pkg
locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp
locationmanager/ReverseGeocode/src/internalreversegeocode.cpp
locationmanager/ReverseGeocode/src/xmlhandler.cpp
locationmanager/client/group/locationmanagerclient.mmp
locationmanager/client/sis/depends.xml
locationmanager/client/sis/locationmanagerclient_stub.sis
locationmanager/client/sis/package.pkg
locationmanager/client/sis/stub.pkg
locationmanager/client/src/rlocationmanager.cpp
locationmanager/client/src/rlocationobjectmanipulator.cpp
locationmanager/client/src/rlocationtrail.cpp
locationmanager/data/bld.inf
locationmanager/geoconverter/group/bld.inf
locationmanager/geoconverter/group/geoconverter.mmp
locationmanager/geoconverter/sis/depends.xml
locationmanager/geoconverter/sis/geoconverter_stub.sis
locationmanager/geoconverter/sis/package.pkg
locationmanager/geoconverter/sis/stub.pkg
locationmanager/geoconverter/src/cgeoconverter.cpp
locationmanager/geotagger/group/geotagger.mmp
locationmanager/geotagger/inc/cinternalgeotagger.h
locationmanager/geotagger/sis/depends.xml
locationmanager/geotagger/sis/geotagger_stub.sis
locationmanager/geotagger/sis/package.pkg
locationmanager/geotagger/sis/stub.pkg
locationmanager/geotagger/src/cinternalgeotagger.cpp
locationmanager/group/bld.inf
locationmanager/inc/locationmanagerdefs.h
locationmanager/locationtrail/group/locationtrail.mmp
locationmanager/locationtrail/inc/clocationrecord.h
locationmanager/locationtrail/sis/depends.xml
locationmanager/locationtrail/sis/locationtrail_stub.sis
locationmanager/locationtrail/sis/package.pkg
locationmanager/locationtrail/sis/stub.pkg
locationmanager/locationtrail/src/cgpxconverterao.cpp
locationmanager/locationtrail/src/clocationrecord.cpp
locationmanager/locationtrail/src/ctracklog.cpp
locationmanager/locationtrail/src/locationremappingao.cpp
locationmanager/server/group/locationmanagerserver.mmp
locationmanager/server/inc/clocationmanagerserver.h
locationmanager/server/sis/depends.xml
locationmanager/server/sis/locationmanagerserver_stub.sis
locationmanager/server/sis/package.pkg
locationmanager/server/sis/stub.pkg
locationmanager/server/src/clocationgeotagtimerao.cpp
locationmanager/server/src/clocationmanagerserver.cpp
locationmanager/server/src/clocationmanagersession.cpp
locationmanager/server/src/clocationservertimerhandler.cpp
locationmanager/server/src/nwregistrationstatushandler.cpp
locationmanager/tagcreator/bwincw/tagcreatorwinscw.def
locationmanager/tagcreator/eabi/tagcreatorarm.def
locationmanager/tagcreator/group/bld.inf
locationmanager/tagcreator/group/tagcreator.mmp
locationmanager/tagcreator/inc/ctagcreator.h
locationmanager/tagcreator/sis/depends.xml
locationmanager/tagcreator/sis/package.pkg
locationmanager/tagcreator/sis/stub.pkg
locationmanager/tagcreator/sis/tagcreator_stub.sis
locationmanager/tagcreator/src/ctagcreator.cpp
mds_plat/harvester_framework_api/inc/harvesterclient.h
mds_plat/location_manager_api/group/bld.inf
mds_plat/location_manager_api/inc/geotagger.h
mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp
mds_plat/location_manager_api/tsrc/inc/LocationManagerTestScripter.h
metadataengine/client/group/mdeclient.mmp
metadataengine/client/src/mdeasynchronousfindao.cpp
metadataengine/client/src/mdeevent.cpp
metadataengine/client/src/mdeeventcondition.cpp
metadataengine/client/src/mdeharvestersession.cpp
metadataengine/client/src/mdenotifierao.cpp
metadataengine/client/src/mdeobject.cpp
metadataengine/client/src/mdeobjectcondition.cpp
metadataengine/client/src/mdeproperty.cpp
metadataengine/client/src/mdequery.cpp
metadataengine/client/src/mdequerycriteriaserialization.cpp
metadataengine/client/src/mdequeryimpl.cpp
metadataengine/client/src/mderelationcondition.cpp
metadataengine/client/src/mdesessionimpl.cpp
metadataengine/client/src/mdetextpropertycondition.cpp
metadataengine/common/group/mdccommon.mmp
metadataengine/common/src/mdcserializationbuffer.cpp
metadataengine/server/group/mdsserver.mmp
metadataengine/server/inc/mdslogger.h
metadataengine/server/inc/mdspreferences.h
metadataengine/server/inc/mdsserversession.h
metadataengine/server/src/mdsclausebuffer.cpp
metadataengine/server/src/mdsfindengine.cpp
metadataengine/server/src/mdsfindsqlclause.cpp
metadataengine/server/src/mdsgetimeiao.cpp
metadataengine/server/src/mdsimportexport.cpp
metadataengine/server/src/mdsitemdef.cpp
metadataengine/server/src/mdsmaintenanceengine.cpp
metadataengine/server/src/mdsmanipulationengine.cpp
metadataengine/server/src/mdsnotifier.cpp
metadataengine/server/src/mdsschema.cpp
metadataengine/server/src/mdsserver.cpp
metadataengine/server/src/mdsserversession.cpp
metadataengine/server/src/mdssqldbmaintenance.cpp
metadataengine/server/src/mdssqlfindoperation.cpp
metadataengine/server/src/mdssqliteconnection.cpp
metadataengine/server/src/mdssqlobjectmanipulate.cpp
package_definition.xml
package_map.xml
rom/bld.inf
rom/mds_cellid_reverse_geocode_enabled.iby
rom/mds_cellidenabled.iby
rom/mds_reverse_geocode_enabled_only.iby
sis/mds/mds_stub.sis
sis/mds/package.pkg
sis/mds/package_cellid_reverse_geocode_enabled.pkg
sis/mds/package_cellidenabled.pkg
sis/mds/package_reverse_geocode_enabled_only.pkg
sis/mds/package_separate.pkg
sis/mds/stub.pkg
watchdog/src/watchdog.cpp
--- a/clfwrapper/ClientSrc/CCLFDbItemContainer.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFDbItemContainer.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -65,6 +65,7 @@
 CCLFContainerItem::~CCLFContainerItem()
     {
     delete iMdEObject;
+    iMdEObject = NULL;
     }
 
 // -----------------------------------------------------------------------------
--- a/clfwrapper/ClientSrc/CCLFDbItemProvider.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFDbItemProvider.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -84,6 +84,7 @@
     {
     Cancel();
     delete iObjectQuery;
+    iObjectQuery = NULL;
     iItemArray.ResetAndDestroy();
     }
 
--- a/clfwrapper/ClientSrc/CCLFEngineImpl.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFEngineImpl.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -105,14 +105,21 @@
 CCLFEngineImpl::~CCLFEngineImpl()
     {
     delete iItemProvider;
+    iItemProvider = NULL;
     delete iUpdateStartEventHandler;
+    iUpdateStartEventHandler = NULL;
     delete iUpdateEndEventHandler;
+    iUpdateEndEventHandler = NULL;
     delete iDbItemContainer;
+    iDbItemContainer = NULL;
     delete iCLFServerProxy;
+    iCLFServerProxy = NULL;
     iChangedItemObserverArray.Close();
     iProcessObserverArray.Close();
     delete iQueryAdapter;
+    iQueryAdapter = NULL;
     delete iMdESession;
+    iMdESession = NULL;
     }
 
 // -----------------------------------------------------------------------------
--- a/clfwrapper/ClientSrc/CCLFItemImpl.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFItemImpl.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -521,6 +521,7 @@
     for ( HBufC* const* p = hashIter.NextValue(); p; p = hashIter.NextValue() )
         {
         delete *p;
+        p = NULL;
         }
     iTextMap.Close();
     }
--- a/clfwrapper/ClientSrc/CCLFItemListModelImpl.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFItemListModelImpl.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -157,7 +157,9 @@
     {
     iChangedItemProvider.RemoveChangedItemProviderObserver( this );
     delete iMimeTypeArray;
+    iMimeTypeArray = NULL;
     delete iMediaTypeArray;
+    iMediaTypeArray = NULL;
     iItemArray.ResetAndDestroy();
     delete iItemProvider;
     iResultArray.Close();
--- a/clfwrapper/ClientSrc/CCLFQueryAdapter.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFQueryAdapter.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -255,8 +255,8 @@
         }
 
     aStatus = KRequestPending;
-    iStatusArray.Append( &aStatus );
-    iQueryArray.Append( aQuery );
+    iStatusArray.AppendL( &aStatus );
+    iQueryArray.AppendL( aQuery );
 
     // Check that we can actually execute the query. We can if we have at least one query condition.
     if ( rootCondition.Count() > 0 )
--- a/clfwrapper/ClientSrc/CCLFServerProxy.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/clfwrapper/ClientSrc/CCLFServerProxy.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -758,7 +758,9 @@
     TRAP_IGNORE( iMdESession.RemoveObjectPresentObserverL( *this ));
     iUpdateItemsHandlerArray.ResetAndDestroy();
     delete iUriArray;
+    iUriArray = NULL;
     delete iExtensionArray;
+    iExtensionArray = NULL;
     iFs.Close();
 
     iHC.RemoveHarvesterEventObserver( *this );
--- a/contextengine/group/contextengine.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/contextengine/group/contextengine.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -47,7 +47,7 @@
 
 #if defined(WINS)
 deffile ../bwincw/contextenginewinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/contextenginearm.def
 #endif
 nostrictdef
--- a/contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -89,12 +89,15 @@
 	{
 	WRITELOG( "CCalendarContextPlugin::~CCalendarContextPlugin -- ENTER" );
 	delete iCalInstanceView;
+	iCalInstanceView = NULL;
 	delete iCalSession;
+	iCalSession = NULL;
 	
 	if( iInitTimer )
 	    {
 	    iInitTimer->Cancel();
 	    delete iInitTimer;
+	    iInitTimer = NULL;
 	    }
 		
 	WRITELOG( "CCalendarContextPlugin::~CCalendarContextPlugin -- RETURN" );
--- a/contextengine/plugins/contextplugininterface/group/contextplugininterface.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/contextengine/plugins/contextplugininterface/group/contextplugininterface.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -39,7 +39,7 @@
 
 #if defined(WINS)
     deffile ../bwincw/contextplugininterfacewinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/contextplugininterfacearm.def
 #endif
 nostrictdef
--- a/contextengine/src/contextengine.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/contextengine/src/contextengine.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -109,6 +109,7 @@
             {
             // destroy the singleton and free TLS
             delete data;
+            data = NULL;
             UserSvr::DllFreeTls( KContextEngineTLSKey );
             }
         }
@@ -132,6 +133,7 @@
         {
         // destroy the singleton and free TLS
         delete data;
+        data = NULL;
         UserSvr::DllFreeTls( KContextEngineTLSKey );
         }
     }
@@ -144,6 +146,7 @@
     {
     WRITELOG( "CContextEngine::~CContextEngine" ); // DEBUG INFO
     delete iContextEngineAO;
+    iContextEngineAO = NULL;
 
     MdsUtils::CleanupPtrArray<CContextSnapshotItem>( &iSnapshotQueue );
     REComSession::FinalClose(); // we are done
@@ -279,6 +282,7 @@
     if ( iSnapshotQueue.Append( aItem ) != KErrNone )
         {
         delete aItem;
+        aItem = NULL;
         return;
         }
 
--- a/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -17,7 +17,8 @@
 
 
 #include <platform_paths.hrh>
-#include "../locationmanager/inc/locplatsupport.mmh"
+
+#include "../rom/bld.inf"
 
 #include "../metadataengine/group/bld.inf"
 #include "../locationmanager/group/bld.inf"
@@ -36,31 +37,7 @@
 
 PRJ_EXPORTS
 
-#if defined(_LOC_GEOTAGGING_CELLID)
-#ifdef _LOC_REVERSEGEOCODE
-../rom/mds_cellid_reverse_geocode_enabled.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
-#else
-../rom/mds_cellidenabled.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
-#endif
-#elif defined(_LOC_REVERSEGEOCODE)
-#ifdef _LOC_GEOTAGGING_CELLID
-../rom/mds_cellid_reverse_geocode_enabled.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
-#else
-../rom/mds_reverse_geocode_enabled_only.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
-#endif
-#else
-../rom/mds.iby    CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
-#endif
-
-#ifdef RD_MDS_2_5
-../rom/ContentListingFramework.iby	CORE_MW_LAYER_IBY_EXPORT_PATH( ContentListingFramework.iby )
-#endif
-
-//Stubs
-../sis/mds/mds_stub.sis  /epoc32/data/z/system/install/mds_stub.sis
-
 PRJ_TESTMMPFILES
 
 PRJ_TESTEXPORTS
-../rom/mds_testers.iby	CORE_MW_LAYER_IBY_EXPORT_PATH(mds_testers.iby)
 
--- a/harvester/blacklistclient/group/blacklistclient.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistclient/group/blacklistclient.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -44,7 +44,7 @@
 deffile ../bwincw/blacklistclientwinscw.def
 #else 
 
-#if defined(ARMCC)
+#if defined(EABI)
 deffile ../eabi/blacklistclientarm.def
 #endif
 
--- a/harvester/blacklistclient/src/blacklistclient.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistclient/src/blacklistclient.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -278,6 +278,7 @@
     if ( err != KErrNone )
         {
         delete item;
+        item = NULL;
         }
 
 
@@ -300,6 +301,7 @@
         {
         CBlacklistItem* item = iBlacklistMemoryTable[index];
         delete item;
+        item = NULL;
         iBlacklistMemoryTable.Remove( index );
         }
 
--- a/harvester/blacklistclient/traces/blacklistclientTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistclient/traces/blacklistclientTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __BLACKLISTCLIENTTRACES_H__
@@ -6,35 +6,35 @@
 
 #define KOstTraceComponentID 0x2001b2ed
 
-#define RBLACKLISTCLIENT_RBLACKLISTCLIENT 0x860001
-#define DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT 0x860002
-#define RBLACKLISTCLIENT_CONNECT 0x860003
-#define DUP1_RBLACKLISTCLIENT_CONNECT 0x860004
-#define RBLACKLISTCLIENT_VERSION 0x860005
-#define RBLACKLISTCLIENT_STARTSERVER 0x860006
-#define DUP1_RBLACKLISTCLIENT_STARTSERVER 0x860007
-#define RBLACKLISTCLIENT_REMOVEFROMDBL 0x860008
-#define DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL 0x860009
-#define RBLACKLISTCLIENT_DOLOADBLACKLISTL 0x86000a
-#define DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL 0x86000b
-#define RBLACKLISTCLIENT_LOADBLACKLISTL 0x86000c
-#define DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL 0x86000d
-#define RBLACKLISTCLIENT_ADDTOMEMORYTABLEL 0x86000e
-#define DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL 0x86000f
-#define RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL 0x860010
-#define DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL 0x860011
-#define RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860012
-#define DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860013
-#define DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860014
-#define DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860015
-#define RBLACKLISTCLIENT_GETLISTINDEX 0x860016
-#define DUP1_RBLACKLISTCLIENT_GETLISTINDEX 0x860017
-#define RBLACKLISTCLIENT_ADDL 0x860018
-#define DUP1_RBLACKLISTCLIENT_ADDL 0x860019
-#define RBLACKLISTCLIENT_REMOVEL 0x86001a
-#define DUP1_RBLACKLISTCLIENT_REMOVEL 0x86001b
-#define RBLACKLISTCLIENT_CLOSEDBL 0x86001c
-#define DUP1_RBLACKLISTCLIENT_CLOSEDBL 0x86001d
+#define RBLACKLISTCLIENT_RBLACKLISTCLIENT 0x30001
+#define DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT 0x30002
+#define RBLACKLISTCLIENT_CONNECT 0x30003
+#define DUP1_RBLACKLISTCLIENT_CONNECT 0x30004
+#define RBLACKLISTCLIENT_VERSION 0x30005
+#define RBLACKLISTCLIENT_STARTSERVER 0x30006
+#define DUP1_RBLACKLISTCLIENT_STARTSERVER 0x30007
+#define RBLACKLISTCLIENT_REMOVEFROMDBL 0x30008
+#define DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL 0x30009
+#define RBLACKLISTCLIENT_DOLOADBLACKLISTL 0x3000a
+#define DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL 0x3000b
+#define RBLACKLISTCLIENT_LOADBLACKLISTL 0x3000c
+#define DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL 0x3000d
+#define RBLACKLISTCLIENT_ADDTOMEMORYTABLEL 0x3000e
+#define DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL 0x3000f
+#define RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL 0x30010
+#define DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL 0x30011
+#define RBLACKLISTCLIENT_ISBLACKLISTEDL 0x30012
+#define DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x30013
+#define DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x30014
+#define DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x30015
+#define RBLACKLISTCLIENT_GETLISTINDEX 0x30016
+#define DUP1_RBLACKLISTCLIENT_GETLISTINDEX 0x30017
+#define RBLACKLISTCLIENT_ADDL 0x30018
+#define DUP1_RBLACKLISTCLIENT_ADDL 0x30019
+#define RBLACKLISTCLIENT_REMOVEL 0x3001a
+#define DUP1_RBLACKLISTCLIENT_REMOVEL 0x3001b
+#define RBLACKLISTCLIENT_CLOSEDBL 0x3001c
+#define DUP1_RBLACKLISTCLIENT_CLOSEDBL 0x3001d
 
 
 #endif
--- a/harvester/blacklistclient/traces/fixed_id.definitions	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistclient/traces/fixed_id.definitions	Wed Aug 18 10:12:07 2010 +0300
@@ -1,31 +1,31 @@
 #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_ADDL=0x19
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL=0xf
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_CLOSEDBL=0x1d
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_CONNECT=0x4
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL=0xb
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_GETLISTINDEX=0x17
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x13
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL=0xd
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT=0x2
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL=0x9
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL=0x11
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_REMOVEL=0x1b
-[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_STARTSERVER=0x7
-[TRACE]TRACE_NORMAL[0x86]_DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x14
-[TRACE]TRACE_NORMAL[0x86]_DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x15
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_ADDL=0x18
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL=0xe
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_CLOSEDBL=0x1c
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_CONNECT=0x3
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_DOLOADBLACKLISTL=0xa
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_GETLISTINDEX=0x16
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x12
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_LOADBLACKLISTL=0xc
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_RBLACKLISTCLIENT=0x1
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_REMOVEFROMDBL=0x8
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL=0x10
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_REMOVEL=0x1a
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_STARTSERVER=0x6
-[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_VERSION=0x5
+[GROUP]TRACE_NORMAL=0x3
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_ADDL=0x19
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL=0xf
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_CLOSEDBL=0x1d
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_CONNECT=0x4
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL=0xb
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_GETLISTINDEX=0x17
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x13
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL=0xd
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT=0x2
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL=0x9
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL=0x11
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_REMOVEL=0x1b
+[TRACE]TRACE_NORMAL[0x3]_DUP1_RBLACKLISTCLIENT_STARTSERVER=0x7
+[TRACE]TRACE_NORMAL[0x3]_DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x14
+[TRACE]TRACE_NORMAL[0x3]_DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x15
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_ADDL=0x18
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL=0xe
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_CLOSEDBL=0x1c
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_CONNECT=0x3
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_DOLOADBLACKLISTL=0xa
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_GETLISTINDEX=0x16
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x12
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_LOADBLACKLISTL=0xc
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_RBLACKLISTCLIENT=0x1
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_REMOVEFROMDBL=0x8
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL=0x10
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_REMOVEL=0x1a
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_STARTSERVER=0x6
+[TRACE]TRACE_NORMAL[0x3]_RBLACKLISTCLIENT_VERSION=0x5
--- a/harvester/blacklistserver/src/blacklistserver.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistserver/src/blacklistserver.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -217,6 +217,7 @@
    	iBlacklistServerChunk.Close();
  
     delete iSqLiteConnection;
+    iSqLiteConnection = NULL;
 
     WRITELOG( "CBlacklistServer::~CBlacklistServer - end" );
     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER, "CBlacklistServer::~CBlacklistServer -end " );
@@ -291,6 +292,7 @@
         {
         TRAP(result, CBlacklistServer::ExeMainL());
         delete cleanup;
+        cleanup = NULL;
         }
     __UHEAP_MARKEND;
     WRITELOG( "CBlacklistServer::E32Main - end" );
@@ -495,6 +497,7 @@
     if ( err != KErrNone )
         {
         delete item;
+        item = NULL;
         }
 
     WRITELOG( "CBlacklistServer::AddToMemoryTableL - end" );
@@ -518,6 +521,7 @@
         {
         CBlacklistItem * item = iBlacklistMemoryTable[index];
         delete item;
+        item = NULL;
         iBlacklistMemoryTable.Remove( index );
         }
 
@@ -723,7 +727,7 @@
         variables->AppendL( TColumn( lcBuf ) );     
         variables->AppendL( TColumn( aMediaId ) );    
  
-        iBufferedRemoveItems.Append( variables ); // transfer ownership
+        iBufferedRemoveItems.AppendL( variables ); // transfer ownership
         iDBUpdateNeeded = ETrue;
         CleanupStack::Pop( lcBuf );
         CleanupStack::Pop( 2, variables );
@@ -768,7 +772,7 @@
         rowData->AppendL( TColumn( lcBuf ) );     
         rowData->AppendL( TColumn( aMediaId ) );    
 
-        iBufferedAddedItems.Append( rowData ); // transfer ownership
+        iBufferedAddedItems.AppendL( rowData ); // transfer ownership
         iDBUpdateNeeded = ETrue;
         CleanupStack::Pop( lcBuf );
         CleanupStack::Pop( 2, rowData );
--- a/harvester/blacklistserver/src/blacklistsession.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistserver/src/blacklistsession.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -140,7 +140,7 @@
 void CBlacklistSession::RemoveL( const RMessage2& aMessage ) 
     {
  	RBuf uri;
-    uri.Create( aMessage.GetDesLength( 1 ) );
+    User::LeaveIfError( uri.Create( aMessage.GetDesLength( 1 ) ) );
     CleanupClosePushL( uri );
     aMessage.ReadL( 1, uri );
 
@@ -162,7 +162,7 @@
 void CBlacklistSession::RemoveFromDBL( const RMessage2& aMessage ) 
     {
  	RBuf uri;
-    uri.Create( aMessage.GetDesLength( 1 ) );
+ 	User::LeaveIfError( uri.Create( aMessage.GetDesLength( 1 ) ) );
     CleanupClosePushL( uri );
     aMessage.ReadL( 1, uri );
 
--- a/harvester/blacklistserver/traces/blacklistserverTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistserver/traces/blacklistserverTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __BLACKLISTSERVERTRACES_H__
@@ -6,60 +6,60 @@
 
 #define KOstTraceComponentID 0x2001b2eb
 
-#define CBLACKLISTSERVER_CUSTOMSECURITYCHECKL 0x860001
-#define DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL 0x860002
-#define CBLACKLISTSERVER_CUSTOMFAILUREACTIONL 0x860003
-#define CBLACKLISTSERVER_NEWL 0x860004
-#define DUP1_CBLACKLISTSERVER_NEWL 0x860005
-#define CBLACKLISTSERVER_NEWLC 0x860006
-#define DUP1_CBLACKLISTSERVER_NEWLC 0x860007
-#define CBLACKLISTSERVER_CONSTRUCTL 0x860008
-#define DUP1_CBLACKLISTSERVER_CONSTRUCTL 0x860009
-#define CBLACKLISTSERVER_CBLACKLISTSERVER 0x86000a
-#define DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER 0x86000b
-#define CBLACKLISTSERVER_CLOSEDB 0x86000c
-#define DUP1_CBLACKLISTSERVER_CLOSEDB 0x86000d
-#define CBLACKLISTSERVER_EXEMAINL 0x86000e
-#define DUP1_CBLACKLISTSERVER_EXEMAINL 0x86000f
-#define _E32MAIN 0x860010
-#define DUP1__E32MAIN 0x860011
-#define CBLACKLISTSERVER_OPENDATABASEL 0x860012
-#define DUP1_CBLACKLISTSERVER_OPENDATABASEL 0x860013
-#define CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL 0x860014
-#define DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL 0x860015
-#define CBLACKLISTSERVER_MEMORYHANDLE 0x860016
-#define CBLACKLISTSERVER_LOADDATABASETOMEMORYL 0x860017
-#define DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL 0x860018
-#define CBLACKLISTSERVER_CREATEBLACKLISTTABLEL 0x860019
-#define DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL 0x86001a
-#define CBLACKLISTSERVER_ADDTOMEMORYTABLEL 0x86001b
-#define DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL 0x86001c
-#define CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE 0x86001d
-#define DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE 0x86001e
-#define CBLACKLISTSERVER_GETMEMORYTABLEINDEX 0x86001f
-#define DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX 0x860020
-#define CBLACKLISTSERVER_TABLEEXISTSL 0x860021
-#define DUP1_CBLACKLISTSERVER_TABLEEXISTSL 0x860022
-#define CBLACKLISTSERVER_NEWSESSIONL 0x860023
-#define DUP1_CBLACKLISTSERVER_NEWSESSIONL 0x860024
-#define CBLACKLISTSERVER_RUNERROR 0x860025
-#define DUP1_CBLACKLISTSERVER_RUNERROR 0x860026
-#define CBLACKLISTSERVER_ADDSESSION 0x860027
-#define CBLACKLISTSERVER_REMOVESESSION 0x860028
-#define DUP1_CBLACKLISTSERVER_REMOVESESSION 0x860029
-#define DUP2_CBLACKLISTSERVER_REMOVESESSION 0x86002a
-#define CBLACKLISTSERVER_ADDL 0x86002b
-#define DUP1_CBLACKLISTSERVER_ADDL 0x86002c
-#define CBLACKLISTSERVER_REMOVEL 0x86002d
-#define DUP1_CBLACKLISTSERVER_REMOVEL 0x86002e
-#define CBLACKLISTSERVER_REMOVEFROMDBL 0x86002f
-#define DUP1_CBLACKLISTSERVER_REMOVEFROMDBL 0x860030
-#define CBLACKLISTSERVER_ADDTODBL 0x860031
-#define DUP1_CBLACKLISTSERVER_ADDTODBL 0x860032
-#define CBLACKLISTSERVER_WRITEALLDATATODBL 0x860033
-#define DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL 0x860034
-#define CBLACKLISTSERVER_COMMITBUFFEREDITEMSL 0x860035
-#define DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL 0x860036
+#define CBLACKLISTSERVER_CUSTOMSECURITYCHECKL 0x30001
+#define DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL 0x30002
+#define CBLACKLISTSERVER_CUSTOMFAILUREACTIONL 0x30003
+#define CBLACKLISTSERVER_NEWL 0x30004
+#define DUP1_CBLACKLISTSERVER_NEWL 0x30005
+#define CBLACKLISTSERVER_NEWLC 0x30006
+#define DUP1_CBLACKLISTSERVER_NEWLC 0x30007
+#define CBLACKLISTSERVER_CONSTRUCTL 0x30008
+#define DUP1_CBLACKLISTSERVER_CONSTRUCTL 0x30009
+#define CBLACKLISTSERVER_CBLACKLISTSERVER 0x3000a
+#define DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER 0x3000b
+#define CBLACKLISTSERVER_CLOSEDB 0x3000c
+#define DUP1_CBLACKLISTSERVER_CLOSEDB 0x3000d
+#define CBLACKLISTSERVER_EXEMAINL 0x3000e
+#define DUP1_CBLACKLISTSERVER_EXEMAINL 0x3000f
+#define _E32MAIN 0x30010
+#define DUP1__E32MAIN 0x30011
+#define CBLACKLISTSERVER_OPENDATABASEL 0x30012
+#define DUP1_CBLACKLISTSERVER_OPENDATABASEL 0x30013
+#define CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL 0x30014
+#define DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL 0x30015
+#define CBLACKLISTSERVER_MEMORYHANDLE 0x30016
+#define CBLACKLISTSERVER_LOADDATABASETOMEMORYL 0x30017
+#define DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL 0x30018
+#define CBLACKLISTSERVER_CREATEBLACKLISTTABLEL 0x30019
+#define DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL 0x3001a
+#define CBLACKLISTSERVER_ADDTOMEMORYTABLEL 0x3001b
+#define DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL 0x3001c
+#define CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE 0x3001d
+#define DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE 0x3001e
+#define CBLACKLISTSERVER_GETMEMORYTABLEINDEX 0x3001f
+#define DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX 0x30020
+#define CBLACKLISTSERVER_TABLEEXISTSL 0x30021
+#define DUP1_CBLACKLISTSERVER_TABLEEXISTSL 0x30022
+#define CBLACKLISTSERVER_NEWSESSIONL 0x30023
+#define DUP1_CBLACKLISTSERVER_NEWSESSIONL 0x30024
+#define CBLACKLISTSERVER_RUNERROR 0x30025
+#define DUP1_CBLACKLISTSERVER_RUNERROR 0x30026
+#define CBLACKLISTSERVER_ADDSESSION 0x30027
+#define CBLACKLISTSERVER_REMOVESESSION 0x30028
+#define DUP1_CBLACKLISTSERVER_REMOVESESSION 0x30029
+#define DUP2_CBLACKLISTSERVER_REMOVESESSION 0x3002a
+#define CBLACKLISTSERVER_ADDL 0x3002b
+#define DUP1_CBLACKLISTSERVER_ADDL 0x3002c
+#define CBLACKLISTSERVER_REMOVEL 0x3002d
+#define DUP1_CBLACKLISTSERVER_REMOVEL 0x3002e
+#define CBLACKLISTSERVER_REMOVEFROMDBL 0x3002f
+#define DUP1_CBLACKLISTSERVER_REMOVEFROMDBL 0x30030
+#define CBLACKLISTSERVER_ADDTODBL 0x30031
+#define DUP1_CBLACKLISTSERVER_ADDTODBL 0x30032
+#define CBLACKLISTSERVER_WRITEALLDATATODBL 0x30033
+#define DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL 0x30034
+#define CBLACKLISTSERVER_COMMITBUFFEREDITEMSL 0x30035
+#define DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL 0x30036
 
 
 #endif
--- a/harvester/blacklistserver/traces/fixed_id.definitions	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/blacklistserver/traces/fixed_id.definitions	Wed Aug 18 10:12:07 2010 +0300
@@ -1,56 +1,56 @@
 #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDL=0x2b
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDSESSION=0x27
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDTODBL=0x31
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDTOMEMORYTABLEL=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CBLACKLISTSERVER=0xa
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CLOSEDB=0xc
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL=0x35
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CONSTRUCTL=0x8
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL=0x19
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CUSTOMFAILUREACTIONL=0x3
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL=0x1
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_EXEMAINL=0xe
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_GETMEMORYTABLEINDEX=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_LOADDATABASETOMEMORYL=0x17
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_MEMORYHANDLE=0x16
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_NEWL=0x4
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_NEWLC=0x6
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_NEWSESSIONL=0x23
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_OPENDATABASEL=0x12
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVEFROMDBL=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVEL=0x2d
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVESESSION=0x28
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_RUNERROR=0x25
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL=0x14
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_TABLEEXISTSL=0x21
-[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_WRITEALLDATATODBL=0x33
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_ADDL=0x2c
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_ADDTODBL=0x32
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL=0x1c
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER=0xb
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CLOSEDB=0xd
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL=0x36
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CONSTRUCTL=0x9
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL=0x1a
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL=0x2
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_EXEMAINL=0xf
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX=0x20
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL=0x18
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_NEWL=0x5
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_NEWLC=0x7
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_NEWSESSIONL=0x24
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_OPENDATABASEL=0x13
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVEFROMDBL=0x30
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE=0x1e
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVEL=0x2e
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVESESSION=0x29
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_RUNERROR=0x26
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL=0x15
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_TABLEEXISTSL=0x22
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL=0x34
-[TRACE]TRACE_NORMAL[0x86]_DUP1__E32MAIN=0x11
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CBLACKLISTSERVER_REMOVESESSION=0x2a
-[TRACE]TRACE_NORMAL[0x86]__E32MAIN=0x10
+[GROUP]TRACE_NORMAL=0x3
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_ADDL=0x2b
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_ADDSESSION=0x27
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_ADDTODBL=0x31
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_ADDTOMEMORYTABLEL=0x1b
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_CBLACKLISTSERVER=0xa
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_CLOSEDB=0xc
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL=0x35
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_CONSTRUCTL=0x8
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL=0x19
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_CUSTOMFAILUREACTIONL=0x3
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL=0x1
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_EXEMAINL=0xe
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_GETMEMORYTABLEINDEX=0x1f
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_LOADDATABASETOMEMORYL=0x17
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_MEMORYHANDLE=0x16
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_NEWL=0x4
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_NEWLC=0x6
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_NEWSESSIONL=0x23
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_OPENDATABASEL=0x12
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_REMOVEFROMDBL=0x2f
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE=0x1d
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_REMOVEL=0x2d
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_REMOVESESSION=0x28
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_RUNERROR=0x25
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL=0x14
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_TABLEEXISTSL=0x21
+[TRACE]TRACE_NORMAL[0x3]_CBLACKLISTSERVER_WRITEALLDATATODBL=0x33
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_ADDL=0x2c
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_ADDTODBL=0x32
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL=0x1c
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER=0xb
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_CLOSEDB=0xd
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL=0x36
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_CONSTRUCTL=0x9
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL=0x1a
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL=0x2
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_EXEMAINL=0xf
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX=0x20
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL=0x18
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_NEWL=0x5
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_NEWLC=0x7
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_NEWSESSIONL=0x24
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_OPENDATABASEL=0x13
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_REMOVEFROMDBL=0x30
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE=0x1e
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_REMOVEL=0x2e
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_REMOVESESSION=0x29
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_RUNERROR=0x26
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL=0x15
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_TABLEEXISTSL=0x22
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL=0x34
+[TRACE]TRACE_NORMAL[0x3]_DUP1__E32MAIN=0x11
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CBLACKLISTSERVER_REMOVESESSION=0x2a
+[TRACE]TRACE_NORMAL[0x3]__E32MAIN=0x10
--- a/harvester/client/eabi/harvesterclientarm.def	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/eabi/harvesterclientarm.def	Wed Aug 18 10:12:07 2010 +0300
@@ -20,4 +20,6 @@
 	_ZTV22CHarvesterRequestQueue @ 19 NONAME ; #<VT>#
 	_ZN16RHarvesterClient19AddSessionObserverLER25MHarvesterSessionObserver @ 20 NONAME
 	_ZN16RHarvesterClient21RemoveSessionObserverEv @ 21 NONAME
+	_ZTI27CHarvesterNotificationQueue @ 22 NONAME
+	_ZTV27CHarvesterNotificationQueue @ 23 NONAME
 
--- a/harvester/client/group/harvesterclient.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/group/harvesterclient.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -29,7 +29,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/harvesterclientwinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/harvesterclientarm.def
 #endif
 nostrictdef
@@ -46,6 +46,7 @@
 SOURCE		      harvestereventobserverao.cpp 
 SOURCE            harvesterrequestactive.cpp
 SOURCE            harvesterrequestqueue.cpp
+SOURCE            harvesternotificationqueue.cpp
 
 MW_LAYER_SYSTEMINCLUDE
 
--- a/harvester/client/inc/harvesterclientao.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/inc/harvesterclientao.h	Wed Aug 18 10:12:07 2010 +0300
@@ -25,16 +25,14 @@
 
 #include "harvesterclient.h"
 
-class RHarvesterClient;
-class MHarvestObserver;
-
 NONSHARABLE_CLASS( CHarvesterClientAO ) : public CActive
     {
     public:
         /**
         * Construction.
         */
-        static CHarvesterClientAO* NewL( RHarvesterClient &aHarvesterClient );
+        static CHarvesterClientAO* NewL( RHarvesterClient& aHarvesterClient,
+                                                            CHarvesterNotificationQueue* aNotificationQueue );
 
         /**
         * Destruction.
@@ -46,20 +44,14 @@
         * @param aObserver  Pointer to observer object.
         */
         void SetObserver( MHarvestObserver* aObserver );
-
-        /**
-        * Method for removing an observer.
-        * @param aObserver  Pointer to observer object.
-        */		
-        void RemoveObserver( MHarvestObserver* aObserver );
-        
-        void NotificateObserver( TInt aErr );
         
         /**
          * Set AO to active state. RunL is launched from harvesting complete
          * request which are subscribed from server.
          */ 
-        void Active();
+        void Active( TDesC& aUri );
+        
+        TBool RequestComplete();
         
     protected:
 		
@@ -88,7 +80,8 @@
         * 
         * @param aHarvesterClient Reference to session class
         */	
-        CHarvesterClientAO( RHarvesterClient &aHarvesterClient );
+        CHarvesterClientAO( RHarvesterClient& aHarvesterClient,
+                                           CHarvesterNotificationQueue* aNotificationQueue );
 
         /**
         * 2nd phase construction
@@ -104,13 +97,20 @@
 
         /**
         * Reference to Harvester client session
+        */      
+        RHarvesterClient& iHarvesterClient;
+        
+        /**
+        * Pointer to harvest notification request queue, not owned
         */   	
-        RHarvesterClient& iHarvesterClient;
+        CHarvesterNotificationQueue* iNotificationQueue;
 
         /**
          * Harvester server assigned file name
          */ 
-        TFileName iURI;
+        HBufC* iURI;
+        
+        TBool iRequestComplete;
     };
 
 #endif // __CHARVESTERCLIENTAO_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/client/inc/harvesternotificationqueue.h	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Processor object for running harvester requests
+*
+*/
+
+
+#ifndef HARVESTERNOTIFICATIONQUEUE_H
+#define HARVESTERNOTIFICATIONQUEUE_H
+
+#include <e32base.h>
+
+class CHarvesterClientAO;
+class MHarvestObserver;
+
+/**
+ *  Processor object for running queued tasks.
+ *
+ */
+class CHarvesterNotificationQueue: public CBase
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @return Instance of CHarvesterNotificationQueue.
+     */
+    static CHarvesterNotificationQueue* NewL();
+
+    /**
+     * Destructor
+     *
+     */
+    virtual ~CHarvesterNotificationQueue();
+    
+    /**
+     * Adds new request to the queue.
+     *
+     * @param aRequest Request to be added to the queue.
+     */
+    void AddRequestL( CHarvesterClientAO* aRequest );
+    
+    /**
+     * Marks request completed.
+     */
+    void Cleanup( TBool aShutdown );
+    
+    void SetObserver( MHarvestObserver* aObserver );
+    
+private:
+
+    /**
+     * C++ default constructor
+     * @return Instance of CHarvesterNotificationQueue.
+     */
+    CHarvesterNotificationQueue();
+
+    /**
+     * Symbian 2nd phase constructor can leave.
+     */
+    void ConstructL();
+
+private:
+
+    /**
+     * Array of active objects for each pending harvester request.
+     */
+    RPointerArray <CHarvesterClientAO> iRequests;
+
+};
+
+#endif // HARVESTERNOTIFICATIONQUEUE_H
--- a/harvester/client/inc/harvesterrequestactive.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/inc/harvesterrequestactive.h	Wed Aug 18 10:12:07 2010 +0300
@@ -58,7 +58,7 @@
      * @return New CHarvesterRequestActive object.
      */
     static CHarvesterRequestActive* NewL( 
-            RHarvesterClient& aClient, MHarvestObserver* aObserver,
+            RHarvesterClient& aClient,
             TInt aService, const TDesC& aUri, 
             HBufC8* aAlbumIds, TBool aAddLocation,
             CHarvesterRequestQueue* aQueue );
@@ -103,7 +103,7 @@
      * @return New CHarvesterRequestActive object.
      */
     CHarvesterRequestActive( RHarvesterClient& aClient,
-            MHarvestObserver* aObserver, TInt aService, const TDesC& aUri, 
+            TInt aService, const TDesC& aUri, 
             HBufC8* aAlbumIds, TBool aAddLocation,
             CHarvesterRequestQueue* aQueue );
 
@@ -141,11 +141,6 @@
      */
     RHarvesterClient iClient;
 
-    /**
-     * Observer to receive notifications about completed operations. Not owned.
-     */
-    MHarvestObserver* iObserver;
-    
     TInt iService;
     
     /**
--- a/harvester/client/src/harvesterclient.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/src/harvesterclient.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -19,6 +19,7 @@
 #include "harvesterclient.h"
 #include "harvestercommon.h"
 #include "harvesterrequestqueue.h"
+#include "harvesternotificationqueue.h"
 #include "harvestereventobserverao.h"
 #include "harvesterlog.h"
 #include "harvesterclientao.h"
@@ -54,10 +55,10 @@
     WRITELOG( "RHarvesterClient::RHarvesterClient() - Constructor" );
     OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_RHARVESTERCLIENT, "RHarvesterClient::RHarvesterClient" );
     
-    iHarvesterClientAO = NULL;
     iObserver = NULL;
     iHEO = NULL;
     iRequestQueue = NULL;
+    iNotificationQueue = NULL;
     }
 
 // ----------------------------------------------------------------------------------------
@@ -69,7 +70,6 @@
     WRITELOG( "RHarvesterClient::Connect()" );
     OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_CONNECT, "RHarvesterClient::Connect" );
     
-    
     RProperty property;
     const TInt error( property.Attach( KHarvesterPSShutdown, KShutdown, EOwnerThread ) );
     TInt value = 0;
@@ -81,26 +81,29 @@
         return KErrLocked;
         }
     
-    if( iHarvesterClientAO )
+    if( iRequestQueue )
     	{
     	return KErrAlreadyExists;
     	}
     
-    TRAPD( err, iHarvesterClientAO = CHarvesterClientAO::NewL(*this) );
-    if ( err != KErrNone )
-        {
-        WRITELOG( "RHarvesterClient::RHarvesterClient() - Couldn't create active object" );
-        return err;
-        }
-    
     // request processor
-    TRAP( err, iRequestQueue = CHarvesterRequestQueue::NewL() )
+    TRAPD( err, iRequestQueue = CHarvesterRequestQueue::NewL() )
         {
         if ( err != KErrNone )
             {
             WRITELOG( "RHarvesterClient::RHarvesterClient() - Couldn't create harvester request queue" );
-            delete iHarvesterClientAO;
-            iHarvesterClientAO = NULL;
+            return err;
+            }
+        }
+
+    // request processor
+    TRAP( err, iNotificationQueue = CHarvesterNotificationQueue::NewL() )
+        {
+        if ( err != KErrNone )
+            {
+            WRITELOG( "RHarvesterClient::RHarvesterClient() - Couldn't create harvester notification queue" );
+            delete iRequestQueue;
+            iRequestQueue = NULL;
             return err;
             }
         }
@@ -114,10 +117,10 @@
         }
     else
         {
-        delete iHarvesterClientAO;
-        iHarvesterClientAO = NULL;
         delete iRequestQueue;
         iRequestQueue = NULL;
+        delete iNotificationQueue;
+        iNotificationQueue = NULL;
         }
 
 #ifdef _DEBUG
@@ -185,6 +188,8 @@
     
     // cancels Harvest Complete request if it exist at server
     UnregisterHarvestComplete();
+    delete iNotificationQueue;
+    iNotificationQueue = NULL;
     
     WRITELOG( "RHarvesterClient::Close() - UnregisterHarvest done" );
     
@@ -197,9 +202,6 @@
     delete iRequestQueue;
     iRequestQueue = NULL;
     
-    delete iHarvesterClientAO;
-    iHarvesterClientAO = NULL;
-    
     delete iHEO;
     iHEO = NULL;
     
@@ -217,11 +219,8 @@
     WRITELOG( "RHarvesterClient::SetObserver()" );
     OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_SETOBSERVER, "RHarvesterClient::SetObserver" );
 
-    if ( iHarvesterClientAO )
-        {
-        iHarvesterClientAO->SetObserver( aObserver );
-        }
 	iObserver = aObserver;
+	iNotificationQueue->SetObserver( iObserver );
     }
 
 // ----------------------------------------------------------------------------------------
@@ -233,18 +232,11 @@
     WRITELOG( "RHarvesterClient::RemoveObserver()" );
     OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_REMOVEOBSERVER, "RHarvesterClient::RemoveObserver" );
     
-    if ( iHarvesterClientAO )
-        {
-        iHarvesterClientAO->RemoveObserver( aObserver );
-        }
-    
 	if ( aObserver == iObserver )
 		{
-		if ( iObserver )
-			{
-			WRITELOG( "CHarvesterClientAO::RemoveObserver() - deleting observer" );
-			iObserver = NULL;
-			}
+		WRITELOG( "RHarvesterClient::RemoveObserver() - deleting observer" );
+		iObserver = NULL;
+		iNotificationQueue->SetObserver( iObserver );
 		}
     }
 
@@ -300,7 +292,6 @@
     WRITELOG1( "RHarvesterClient::HarvestFile() - file %S", &aURI );
     OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_HARVESTFILE, "RHarvesterClient::HarvestFile" );
     
-    
     HBufC8* paramBuf = NULL;
     TRAPD( err, paramBuf = SerializeArrayL( aAlbumIds ) );
     if ( err )
@@ -314,7 +305,7 @@
     	}
         
     CHarvesterRequestActive* harvestFileActive( NULL );
-    TRAP( err, harvestFileActive = CHarvesterRequestActive::NewL( *this, iObserver, (TInt)EHarvestFile, aURI, 
+    TRAP( err, harvestFileActive = CHarvesterRequestActive::NewL( *this, (TInt)EHarvestFile, aURI, 
                                                                                                    paramBuf, aAddLocation, iRequestQueue ) );
     if( err )
         {
@@ -335,11 +326,13 @@
             WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrServerBusy );
             iObserver->HarvestingComplete( const_cast<TDesC&>(aURI), KErrServerBusy );  
             delete harvestFileActive;
+            harvestFileActive = NULL;
             }
         else if( err )
             {
             WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrServerBusy );
             delete harvestFileActive;
+            harvestFileActive = NULL;
             }
         else
             {
@@ -352,11 +345,13 @@
         WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrDisconnected );
         iObserver->HarvestingComplete( const_cast<TDesC&>(aURI), KErrDisconnected );  
         delete harvestFileActive;
+        harvestFileActive = NULL;
         }
     else
         {
         WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrDisconnected );
         delete harvestFileActive;
+        harvestFileActive = NULL;
         }
     WRITELOG( "RHarvesterClient::HarvestFile() - end" );
     }
@@ -387,7 +382,7 @@
         }
 
     CHarvesterRequestActive* harvestFileActive( NULL );
-    TRAP( err, harvestFileActive = CHarvesterRequestActive::NewL( *this, iObserver, (TInt)EHarvestFile, aURI, 
+    TRAP( err, harvestFileActive = CHarvesterRequestActive::NewL( *this, (TInt)EHarvestFile, aURI, 
                                                                                                    paramBuf, aAddLocation, iRequestQueue ) );
     if( err )
         {
@@ -408,11 +403,13 @@
             WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrServerBusy );
             iObserver->HarvestingComplete( const_cast<TDesC&>(aURI), KErrServerBusy );  
             delete harvestFileActive;
+            harvestFileActive = NULL;
             }
         else if( err )
             {
             WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrServerBusy );
             delete harvestFileActive;
+            harvestFileActive = NULL;
             }
         else
             {
@@ -424,11 +421,13 @@
         WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrDisconnected );
         iObserver->HarvestingComplete( const_cast<TDesC&>(aURI), KErrDisconnected );  
         delete harvestFileActive;
+        harvestFileActive = NULL;
         }
     else
         {
         WRITELOG1( "RHarvesterClient::HarvestFile() - cannot not send harvest request to server, error: %d", KErrDisconnected );
         delete harvestFileActive;
+        harvestFileActive = NULL;
         }
     }
 
@@ -468,7 +467,6 @@
 	TIpcArgs ipcArgs( &aURI );
 	OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE, "RHarvesterClient::RegisterHarvestComplete" );
 	
-	
 	if( !iHandle )
 		{
 		return;
@@ -488,17 +486,43 @@
 		return;
 		}	
 	
-	Send( EUnregisterHarvestComplete );
+	SendReceive( EUnregisterHarvestComplete );
 	}
 
 // ----------------------------------------------------------------------------------------
 // HarvestFile
 // ----------------------------------------------------------------------------------------
 //
-void RHarvesterClient::HarvestFile( TInt& aService, TIpcArgs& aArgs, TRequestStatus& aStatus )
+void RHarvesterClient::HarvestFile( TInt& aService, TIpcArgs& aArgs, TRequestStatus& aStatus, TDesC& aUri )
     {
     // send to server harvesting complete observer
-    iHarvesterClientAO->Active();
+    if( iObserver )
+        {
+        CHarvesterClientAO* harvestNotificationRequest( NULL );
+        TRAPD( err, harvestNotificationRequest = CHarvesterClientAO::NewL(*this, iNotificationQueue ) );
+        if( err )
+            {
+            WRITELOG1( "RHarvesterClient::HarvestFile() - cannot issue harvesting notitification request, error: %d", err );
+            iObserver->HarvestingComplete( const_cast<TDesC&>(aUri), KErrCompletion );  
+            delete harvestNotificationRequest;
+            harvestNotificationRequest = NULL;
+            }
+        else
+            {
+            TRAP( err, iNotificationQueue->AddRequestL( harvestNotificationRequest ) );
+            if( err )
+                {
+                iObserver->HarvestingComplete( const_cast<TDesC&>(aUri), KErrCompletion );  
+                delete harvestNotificationRequest;
+                harvestNotificationRequest = NULL;            
+                }
+            else
+                {
+                harvestNotificationRequest->SetObserver( iObserver );
+                harvestNotificationRequest->Active( aUri );
+                }
+            }
+        }
     SendReceive( aService, aArgs, aStatus );
     }
 
@@ -508,8 +532,6 @@
 //
 void RHarvesterClient::ForceHarvestFile( TInt& aService, TIpcArgs& aArgs )
     {
-    // send to server harvesting complete observer
-    iHarvesterClientAO->Active();
     SendReceive( aService, aArgs );
     }
 
--- a/harvester/client/src/harvesterclientao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/src/harvesterclientao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -17,6 +17,7 @@
 
 
 #include "harvesterclientao.h"
+#include "harvesternotificationqueue.h"
 #include "harvestercommon.h"
 #include "harvesterlog.h"
 #include "mdsutils.h"
@@ -30,12 +31,13 @@
 // NewL
 // ---------------------------------------------------------------------------
 //
-CHarvesterClientAO* CHarvesterClientAO::NewL( RHarvesterClient& aHarvesterClient )
+CHarvesterClientAO* CHarvesterClientAO::NewL( RHarvesterClient& aHarvesterClient, 
+        CHarvesterNotificationQueue* aNotificationQueue )
 	{
     WRITELOG( "CHarvesterClientAO::NewL()" );
     OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_NEWL, "CHarvesterClientAO::NewL" );
     
-	CHarvesterClientAO* self = new (ELeave) CHarvesterClientAO( aHarvesterClient );
+	CHarvesterClientAO* self = new (ELeave) CHarvesterClientAO( aHarvesterClient, aNotificationQueue );
 	CleanupStack::PushL( self );
 	self->ConstructL();
 	CleanupStack::Pop( self );
@@ -52,6 +54,9 @@
     
     WRITELOG( "CHarvesterClientAO::~CHarvesterClientAO()" );
     Cancel();
+    
+    delete iURI;
+    iURI = NULL;
  	}
 
 // ---------------------------------------------------------------------------
@@ -59,10 +64,14 @@
 // First-phase C++ constructor
 // ---------------------------------------------------------------------------
 //
-CHarvesterClientAO::CHarvesterClientAO( RHarvesterClient& aHarvesterClient )
+CHarvesterClientAO::CHarvesterClientAO( RHarvesterClient& aHarvesterClient, 
+        CHarvesterNotificationQueue* aNotificationQueue )
     : CActive( CActive::EPriorityStandard ), 
     iObserver( NULL ),
-    iHarvesterClient( aHarvesterClient )
+    iHarvesterClient( aHarvesterClient ),
+    iNotificationQueue( aNotificationQueue ),
+    iURI( NULL ),
+    iRequestComplete( EFalse )
   	{
     OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::CHarvesterClientAO" );
     
@@ -94,25 +103,6 @@
 	}
 
 // ---------------------------------------------------------------------------
-// RemoveObserver
-// ---------------------------------------------------------------------------
-//	
-void CHarvesterClientAO::RemoveObserver( MHarvestObserver* aObserver )
-	{
-	WRITELOG( "CHarvesterClientAO::RemoveObserver()" );
-	OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_REMOVEOBSERVER, "CHarvesterClientAO::RemoveObserver" );
-	
-	if ( aObserver == iObserver )
-		{
-		if ( iObserver )
-			{
-			WRITELOG( "CHarvesterClientAO::RemoveObserver() - deleting observer" );
-			iObserver = NULL;
-			}
-		}
-	}
-
-// ---------------------------------------------------------------------------
 // DoCancel
 // ---------------------------------------------------------------------------
 //
@@ -120,20 +110,33 @@
 	{
 	WRITELOG( "CHarvesterClientAO::DoCancel()" );
 	OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_DOCANCEL, "CHarvesterClientAO::DoCancel" );
-	
+	iRequestComplete = ETrue;
 	}
 	
 // ---------------------------------------------------------------------------
 // Active
 // ---------------------------------------------------------------------------
 //
-void CHarvesterClientAO::Active()
+void CHarvesterClientAO::Active( TDesC& aUri )
 	{	
-	if (!IsActive())
-		{
-		iHarvesterClient.RegisterHarvestComplete(iURI, iStatus);
-		SetActive();
-		}
+    WRITELOG( "CHarvesterClientAO::Active()");
+    if( iObserver && !IsActive() )
+        {
+        delete iURI;
+        iURI = NULL;
+        iURI = aUri.Alloc();
+        if( iURI )
+            {
+            TPtr16 uri( iURI->Des() );
+            iHarvesterClient.RegisterHarvestComplete( uri, iStatus );
+            SetActive();            
+            }
+        else if( iObserver )
+            {
+            iObserver->HarvestingComplete( aUri, KErrCompletion );
+            iRequestComplete = ETrue;
+            }
+        }
 	}
 
 // ---------------------------------------------------------------------------
@@ -144,8 +147,9 @@
 	{
 	WRITELOG( "CHarvesterClientAO::RunL()" );
 	OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_RUNL, "CHarvesterClientAO::RunL" );
+
+	iNotificationQueue->Cleanup( EFalse );
 	
-
 	const TInt status = iStatus.Int();
 	
     if ( status < KErrNone )
@@ -154,17 +158,16 @@
         }
 
 	// Callback to client process
-	if ( iObserver )
+	if ( iObserver && iURI )
 		{
-		WRITELOG( "CHarvesterClientAO::RunL() - ECompleteRequest - calling callback" );
-		iObserver->HarvestingComplete( iURI, status );
+		WRITELOG( "CHarvesterClientAO::RunL() - Request complete - calling callback" );
+		TPtrC16 uri( iURI->Des() );
+		iObserver->HarvestingComplete( uri, status );
 		}
 	
-	// if the request was not canceled or server is not terminated, Activating AO again
-	if ( status != KErrCancel && status != KErrServerTerminated )
-		{
-		Active();
-		}
+    delete iURI;
+    iURI = NULL;
+	iRequestComplete = ETrue;
 	}
 	
 // ---------------------------------------------------------------------------
@@ -179,5 +182,18 @@
     {
     WRITELOG1( "CHarvesterClientAO::RunError(), errorcode: %d", aError );
     
+    iNotificationQueue->Cleanup( EFalse );
+    iRequestComplete = ETrue;
+    
     return KErrNone;
     }
+
+// ---------------------------------------------------------------------------
+// RequestComplete
+// ---------------------------------------------------------------------------
+//  
+TBool CHarvesterClientAO::RequestComplete()
+    {
+    return iRequestComplete;
+    }
+
--- a/harvester/client/src/harvestereventobserverao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/src/harvestereventobserverao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -126,6 +126,7 @@
 			iHarvesterClient.Send( EUnregisterHarvesterEvent, ipcArgs );
 			iObservers.Remove( i );
 			delete observer;
+			observer = NULL;
 			}
 		}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/client/src/harvesternotificationqueue.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Processor object for running harvester requests
+*
+*/
+
+
+#include "harvesternotificationqueue.h"
+#include "harvesterclientao.h"
+#include "harvesterlog.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CHarvesterNotificationQueue::NewL()
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CHarvesterNotificationQueue* CHarvesterNotificationQueue::NewL()
+    {
+    CHarvesterNotificationQueue* self = new( ELeave )CHarvesterNotificationQueue();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CHarvesterNotificationQueue::CHarvesterNotificationQueue()
+// C++ default constructor can NOT contain any code, that might leave.
+// ---------------------------------------------------------------------------
+//
+CHarvesterNotificationQueue::CHarvesterNotificationQueue()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CHarvesterNotificationQueue::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------------------------
+//
+void CHarvesterNotificationQueue::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CHarvesterNotificationQueue::~CHarvesterNotificationQueue()
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CHarvesterNotificationQueue::~CHarvesterNotificationQueue()
+    {
+    WRITELOG( "CHarvesterNotificationQueue::~CHarvesterNotificationQueue()");
+    
+    Cleanup( ETrue );
+    iRequests.ResetAndDestroy();
+    
+    WRITELOG( "CHarvesterNotificationQueue::~CHarvesterNotificationQueue() - All requests deleted");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CHarvesterNotificationQueue::AddRequestL()
+// Adds new request to the queue.
+// ---------------------------------------------------------------------------
+//
+void CHarvesterNotificationQueue::AddRequestL( CHarvesterClientAO* aRequest )
+    {
+    WRITELOG( "CHarvesterNotificationQueue::AddRequestL()");
+    
+    iRequests.AppendL( aRequest );
+    }
+
+// ---------------------------------------------------------------------------
+// CHarvesterNotificationQueue::RequestComplete()
+// Completes the request
+// ---------------------------------------------------------------------------
+//
+void CHarvesterNotificationQueue::Cleanup( TBool aShutdown )
+    {
+    WRITELOG( "CHarvesterNotificationQueue::RequestComplete()");
+    
+    for( TInt i = iRequests.Count() - 1; i >=0; i-- )
+        {
+        if( aShutdown )
+            {
+            iRequests[i]->Cancel();
+            }
+        
+        if( iRequests[i]->RequestComplete() && !iRequests[i]->IsActive() )
+            {
+            delete iRequests[i];
+            iRequests[i] = NULL;
+            iRequests.Remove( i );
+            
+            // correct the index so that no items are skipped
+            i--;
+            if(i <= -1)
+                {
+                i = -1;
+                }
+            }
+        }
+
+    if( iRequests.Count() == 0 && !aShutdown )
+        {
+        iRequests.Compress();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetObserver
+// ---------------------------------------------------------------------------
+//
+void CHarvesterNotificationQueue::SetObserver( MHarvestObserver* aObserver )
+    {
+    WRITELOG( "CHarvesterNotificationQueue::SetObserver()" );
+    
+    for( TInt i = iRequests.Count() - 1; i >=0; i-- )
+        {
+        iRequests[i]->SetObserver( aObserver );
+        }
+    }
+
+// End of file
+
--- a/harvester/client/src/harvesterrequestactive.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/src/harvesterrequestactive.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -19,6 +19,7 @@
 
 #include "harvesterrequestactive.h"
 #include "harvesterrequestqueue.h"
+#include "harvesterlog.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -32,14 +33,11 @@
     if( IsActive() )
         {
         Cancel();
-        if( iObserver )
-            {
-            iObserver->HarvestingComplete( iUri, KErrCancel );
-            }    
         iRequestCompleted = ETrue;
         }
     
     delete iAlbumIds;
+    iAlbumIds = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -48,12 +46,12 @@
 // --------------------------------------------------------------------------- 
 //
 CHarvesterRequestActive* CHarvesterRequestActive::NewL(
-        RHarvesterClient& aClient, MHarvestObserver* aObserver,
+        RHarvesterClient& aClient,
         TInt aService, const TDesC& aUri, 
         HBufC8* aAlbumIds, TBool aAddLocation,
         CHarvesterRequestQueue* aQueue )
     {
-    CHarvesterRequestActive* self = new( ELeave )CHarvesterRequestActive( aClient, aObserver,
+    CHarvesterRequestActive* self = new( ELeave )CHarvesterRequestActive( aClient,
             aService, aUri, aAlbumIds, aAddLocation, aQueue );
     return self;
     }
@@ -63,10 +61,10 @@
 // C++ default constructor can NOT contain any code, that might leave.
 // ---------------------------------------------------------------------------
 //
-CHarvesterRequestActive::CHarvesterRequestActive( RHarvesterClient& aClient,
-    MHarvestObserver* aObserver, TInt aService, const TDesC& aUri, 
+CHarvesterRequestActive::CHarvesterRequestActive( RHarvesterClient& aClient, 
+    TInt aService, const TDesC& aUri, 
     HBufC8* aAlbumIds, TBool aAddLocation, CHarvesterRequestQueue* aQueue )
-    : CActive( CActive::EPriorityStandard ), iClient( aClient ), iObserver( aObserver ), 
+    : CActive( CActive::EPriorityStandard ), iClient( aClient ), 
     iService( aService ), iUri( aUri ), iAlbumIds( aAlbumIds ), iAddLocation( aAddLocation ),
     iRequestQueue( aQueue ), iLocation( EFalse ), iCancelled( EFalse )
     {
@@ -79,10 +77,6 @@
 //
 void CHarvesterRequestActive::RunL()
     {
-    if( iStatus.Int() && iObserver )
-        {
-        iObserver->HarvestingComplete( iUri, iStatus.Int() );
-        }       
     iRequestCompleted = ETrue;
     if( iRequestQueue )
         {
@@ -101,10 +95,6 @@
         return KErrNone;
         }
     
-    if( iObserver )
-        {
-        iObserver->HarvestingComplete( iUri, aError );
-        }    
     iRequestCompleted = ETrue;
     return KErrNone;
     }
@@ -132,7 +122,7 @@
     
     if( !iCancelled )
         {
-        iClient.HarvestFile( iService, iPersistentArgs, iStatus );
+        iClient.HarvestFile( iService, iPersistentArgs, iStatus, iUri );
         SetActive();
         }
     }
@@ -143,7 +133,7 @@
 //
 void CHarvesterRequestActive::ForceHarvest()
     {
-    iObserver = NULL;
+    WRITELOG( "CHarvesterRequestActive::ForceHarvest()");
     
     TPckg<TBool> location( iAddLocation );
     iLocation.Set( location );
--- a/harvester/client/traces/fixed_id.definitions	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/traces/fixed_id.definitions	Wed Aug 18 10:12:07 2010 +0300
@@ -1,22 +1,22 @@
 #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xe
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_CONSTRUCTL=0x10
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_DOCANCEL=0x13
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_NEWL=0xd
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_REMOVEOBSERVER=0x12
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_RUNL=0x14
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_SETOBSERVER=0x11
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xf
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_CLOSE=0x5
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_CONNECT=0x2
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_HARVESTFILE=0x8
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_HARVESTFILEWITHUID=0x9
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_PAUSE=0x3
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE=0xa
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_REMOVEOBSERVER=0x7
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_RESUME=0x4
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_RHARVESTERCLIENT=0x1
-[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_SETOBSERVER=0x6
-[TRACE]TRACE_NORMAL[0x86]__CREATESERVERPROCESS=0xc
-[TRACE]TRACE_NORMAL[0x86]__STARTSERVER=0xb
+[GROUP]TRACE_NORMAL=0x3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xe
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_CONSTRUCTL=0x10
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_DOCANCEL=0x13
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_NEWL=0xd
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_RUNL=0x14
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_SETOBSERVER=0x11
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xf
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_CLOSE=0x5
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_CONNECT=0x2
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_HARVESTFILE=0x8
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_HARVESTFILEWITHUID=0x9
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_PAUSE=0x3
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE=0xa
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_REMOVEOBSERVER=0x7
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_RESUME=0x4
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_RHARVESTERCLIENT=0x1
+[TRACE]TRACE_NORMAL[0x3]_RHARVESTERCLIENT_SETOBSERVER=0x6
+[TRACE]TRACE_NORMAL[0x3]__CREATESERVERPROCESS=0xc
+[TRACE]TRACE_NORMAL[0x3]__STARTSERVER=0xb
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_REMOVEOBSERVER=0x12
--- a/harvester/client/traces/harvesterclientTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/traces/harvesterclientTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTERCLIENTTRACES_H__
@@ -6,18 +6,18 @@
 
 #define KOstTraceComponentID 0x200009f4
 
-#define RHARVESTERCLIENT_RHARVESTERCLIENT 0x860001
-#define RHARVESTERCLIENT_CONNECT 0x860002
-#define RHARVESTERCLIENT_PAUSE 0x860003
-#define RHARVESTERCLIENT_RESUME 0x860004
-#define RHARVESTERCLIENT_CLOSE 0x860005
-#define RHARVESTERCLIENT_SETOBSERVER 0x860006
-#define RHARVESTERCLIENT_REMOVEOBSERVER 0x860007
-#define RHARVESTERCLIENT_HARVESTFILE 0x860008
-#define RHARVESTERCLIENT_HARVESTFILEWITHUID 0x860009
-#define RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE 0x86000a
-#define _STARTSERVER 0x86000b
-#define _CREATESERVERPROCESS 0x86000c
+#define RHARVESTERCLIENT_RHARVESTERCLIENT 0x30001
+#define RHARVESTERCLIENT_CONNECT 0x30002
+#define RHARVESTERCLIENT_PAUSE 0x30003
+#define RHARVESTERCLIENT_RESUME 0x30004
+#define RHARVESTERCLIENT_CLOSE 0x30005
+#define RHARVESTERCLIENT_SETOBSERVER 0x30006
+#define RHARVESTERCLIENT_REMOVEOBSERVER 0x30007
+#define RHARVESTERCLIENT_HARVESTFILE 0x30008
+#define RHARVESTERCLIENT_HARVESTFILEWITHUID 0x30009
+#define RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE 0x3000a
+#define _STARTSERVER 0x3000b
+#define _CREATESERVERPROCESS 0x3000c
 
 
 #endif
--- a/harvester/client/traces/harvesterclientaoTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/traces/harvesterclientaoTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTERCLIENTAOTRACES_H__
@@ -6,14 +6,13 @@
 
 #define KOstTraceComponentID 0x200009f4
 
-#define CHARVESTERCLIENTAO_NEWL 0x86000d
-#define CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x86000e
-#define DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x86000f
-#define CHARVESTERCLIENTAO_CONSTRUCTL 0x860010
-#define CHARVESTERCLIENTAO_SETOBSERVER 0x860011
-#define CHARVESTERCLIENTAO_REMOVEOBSERVER 0x860012
-#define CHARVESTERCLIENTAO_DOCANCEL 0x860013
-#define CHARVESTERCLIENTAO_RUNL 0x860014
+#define CHARVESTERCLIENTAO_NEWL 0x3000d
+#define CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x3000e
+#define DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x3000f
+#define CHARVESTERCLIENTAO_CONSTRUCTL 0x30010
+#define CHARVESTERCLIENTAO_SETOBSERVER 0x30011
+#define CHARVESTERCLIENTAO_DOCANCEL 0x30013
+#define CHARVESTERCLIENTAO_RUNL 0x30014
 
 
 #endif
--- a/harvester/common/bwincw/harvestercommonwinscw.def	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/bwincw/harvestercommonwinscw.def	Wed Aug 18 10:12:07 2010 +0300
@@ -66,4 +66,5 @@
 	?HandleObjectPropertyL@CMdeObjectWrapper@@SAXAAVCMdEObject@@AAVCMdEPropertyDef@@PAXH@Z @ 65 NONAME ; void CMdeObjectWrapper::HandleObjectPropertyL(class CMdEObject &, class CMdEPropertyDef &, void *, int)
 	?SendHarvestingStatusEventL@CHarvesterPluginFactory@@QAEXH@Z @ 66 NONAME ; void CHarvesterPluginFactory::SendHarvestingStatusEventL(int)
 	?PauseHarvester@CHarvesterPluginFactory@@QAEXH@Z @ 67 NONAME ; void CHarvesterPluginFactory::PauseHarvester(int)
+	?GetObjectDefL@CHarvesterPluginFactory@@QAEXPAVCHarvesterData@@AAVTDes16@@@Z @ 68 NONAME ; void CHarvesterPluginFactory::GetObjectDefL(class CHarvesterData *, class TDes16 &)
 
--- a/harvester/common/eabi/harvestercommonarm.def	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/eabi/harvestercommonarm.def	Wed Aug 18 10:12:07 2010 +0300
@@ -86,4 +86,5 @@
 	_ZN18CHarvesterExifUtilD1Ev @ 85 NONAME
 	_ZN18CHarvesterExifUtilD2Ev @ 86 NONAME
 	_ZN23CHarvesterPluginFactory14PauseHarvesterEi @ 87 NONAME
+	_ZN23CHarvesterPluginFactory13GetObjectDefLEP14CHarvesterDataR6TDes16 @ 88 NONAME
 
--- a/harvester/common/group/harvestercommon.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/group/harvestercommon.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -29,7 +29,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/harvestercommonwinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/harvestercommonarm.def
 #endif
 nostrictdef
--- a/harvester/common/group/harvesterdata.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/group/harvesterdata.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -29,7 +29,7 @@
 
 #if defined(WINSCW)
     deffile ../bwincw/harvesterdatawinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/harvesterdataarm.def
 #endif
 nostrictdef
--- a/harvester/common/group/harvesterplugininterface.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/group/harvesterplugininterface.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -46,7 +46,7 @@
 
 #if defined(WINS)
     deffile ../bwincw/harvesterplugininterfacewinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/harvesterplugininterfacearm.def
 #endif
 nostrictdef
--- a/harvester/common/inc/harvestdata.inl	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/inc/harvestdata.inl	Wed Aug 18 10:12:07 2010 +0300
@@ -80,9 +80,55 @@
 //
 void CObjectDataArray::Append( CMdEObject* aMdeObject, CLocationData* aLocationData, CMdEQuery* aQuery )
     {
-    iMdeObjectArray.Append( aMdeObject );
-    iLocationArray.Append( aLocationData );
-    iQueryArray.Append( aQuery );
+    TInt mdeObjectIndex(KErrNone);
+    TInt locationDataIndex(KErrNone);
+    
+    mdeObjectIndex = iMdeObjectArray.Append( aMdeObject );
+    
+    if( mdeObjectIndex != KErrNone )
+        {
+        delete aMdeObject;
+        aMdeObject = NULL;
+        
+        delete aLocationData;
+        aLocationData = NULL;
+        
+        delete aQuery;
+        aQuery = NULL;
+        }
+    else
+        {
+        locationDataIndex = iLocationArray.Append( aLocationData );
+        
+        if( locationDataIndex != KErrNone )
+            {
+            iMdeObjectArray.Remove( mdeObjectIndex );
+            delete aMdeObject;
+            aMdeObject = NULL;
+            
+            delete aLocationData;
+            aLocationData = NULL;
+            
+            delete aQuery;
+            aQuery = NULL;
+            }
+        else
+            {
+            if( iQueryArray.Append( aQuery ) != KErrNone )
+                {
+                iMdeObjectArray.Remove( mdeObjectIndex );
+                delete aMdeObject;
+                aMdeObject = NULL;
+                
+                iLocationArray.Remove( locationDataIndex );
+                delete aLocationData;
+                aLocationData = NULL;
+                
+                delete aQuery;
+                aQuery = NULL;
+                }
+            }
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -96,8 +142,14 @@
         return;
         }
     delete iMdeObjectArray[aIndex];
+    iMdeObjectArray[aIndex] = NULL;
+    
     delete iLocationArray[aIndex];
+    iLocationArray[aIndex] = NULL;
+    
     delete iQueryArray[aIndex];
+    iQueryArray[aIndex] = NULL;
+    
     iMdeObjectArray.Remove( aIndex );
     iLocationArray.Remove( aIndex );
     iQueryArray.Remove( aIndex );
--- a/harvester/common/inc/harvestercenreputil.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/inc/harvestercenreputil.h	Wed Aug 18 10:12:07 2010 +0300
@@ -28,7 +28,7 @@
 {
 	TUint32 iPreinstalled;
 	HBufC* iPath;
-	~TScanItem() { delete iPath; }
+	~TScanItem() { delete iPath; iPath = NULL;}
 };
 // CLASS DECLARATION
 
--- a/harvester/common/inc/harvestercommon.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/inc/harvestercommon.h	Wed Aug 18 10:12:07 2010 +0300
@@ -106,6 +106,9 @@
 
 // Between Standard and UserInput to allow components to react to important events correctly
 const TInt KHarvesterCustomImportantPriority = 5;
+// Higher than MonitorPlugin priority but lower than High to ensure server can answer to all
+// connection requests as fast as possible
+const TInt KHarvesterServerSessionPriority = 11;
 
 #endif
 
--- a/harvester/common/inc/harvestereventmanager.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/inc/harvestereventmanager.h	Wed Aug 18 10:12:07 2010 +0300
@@ -154,6 +154,7 @@
         virtual ~CHarvesterEventManagerStaticData()
             {
             delete iHEM;
+            iHEM = NULL;
             }
 
     protected:
--- a/harvester/common/inc/harvesterpluginfactory.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/inc/harvesterpluginfactory.h	Wed Aug 18 10:12:07 2010 +0300
@@ -44,6 +44,8 @@
 		
 		IMPORT_C void SendHarvestingStatusEventL( TBool aStarted );
 		IMPORT_C void PauseHarvester( TBool aPaused );
+		
+		IMPORT_C void GetObjectDefL( CHarvesterData* aHD, TDes& aObjectDef );
 
 	private:
 		CHarvesterPluginFactory();
--- a/harvester/common/inc/harvesterplugininfo.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/inc/harvesterplugininfo.h	Wed Aug 18 10:12:07 2010 +0300
@@ -27,6 +27,7 @@
 	virtual ~CHarvesterPluginInfo()
 	{
 		delete iPlugin;
+		iPlugin = NULL;
 		iExtensions.ResetAndDestroy();
 		iExtensions.Close();
 		iObjectTypes.ResetAndDestroy();
--- a/harvester/common/src/blacklistitem.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/blacklistitem.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -51,6 +51,7 @@
 CBlacklistItem::~CBlacklistItem()
     {
     delete iUri;
+    iUri = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/harvester/common/src/harvestercenreputil.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvestercenreputil.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -198,7 +198,9 @@
 	        continue;
 	        }
 		HBufC* pathBuf = path.AllocL();
-		aPaths.Append( pathBuf );
+		CleanupStack::PushL( pathBuf );
+		aPaths.AppendL( pathBuf );
+		CleanupStack::Pop( pathBuf );
 		}
 
 	CleanupStack::PopAndDestroy( &scanPathKeys );
@@ -214,14 +216,17 @@
 	repo->FindL( aPartialKey, KSearchMask, scanPathKeys );
 
 	TBuf<KMaxFileName> path;
+	
 	for( TInt i = scanPathKeys.Count() - 1; i >=0; i-- )
 		{
 	    const TInt error( repo->Get( scanPathKeys[i], path ) );
+	    
 	    if( error != KErrNone )
 	        {
 	        continue;
 	        }
 		TUint32 preinstalled = MdeConstants::MediaObject::ENotPreinstalled;
+		
 		if( path[ path.Length() - 1 ] != TChar('\\') )
 			{
 			User::LeaveIfError( repo->GetMeta( scanPathKeys[i], preinstalled ) );
@@ -231,7 +236,7 @@
 		item->iPath = path.AllocL();
 		item->iPreinstalled = preinstalled;
 		CleanupStack::Pop( item );
-		aItems.Append( item ); // ownership is transferred
+		aItems.AppendL( item ); // ownership is transferred
 		}
 
 	CleanupStack::PopAndDestroy( &scanPathKeys );
--- a/harvester/common/src/harvesterdata.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvesterdata.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -29,7 +29,11 @@
 CHarvesterData::CHarvesterData( const HBufC* aUri )
 	{
 	iUri = aUri;
+	iClientData = NULL;
+	iMdeObject = NULL;
+	iLocationData = NULL;
 	iIsBinary = ETrue;
+	iClientId = KNullUid;
 	}
 
 //==========================================================================
@@ -39,9 +43,13 @@
 CHarvesterData::~CHarvesterData()
 	{
 	delete iUri;
+	iUri = NULL;
 	delete iClientData;
+	iClientData = NULL;
 	delete iMdeObject;
+	iMdeObject = NULL;
 	delete iLocationData;
+	iLocationData = NULL;
 	}
 
 //==========================================================================
@@ -225,6 +233,11 @@
 //
 EXPORT_C void CHarvesterData::SetMdeObject( CMdEObject* aMdeObject )
 	{
+    if( iMdeObject )
+        {
+        delete iMdeObject;
+        iMdeObject = NULL;
+        }
 	iMdeObject = aMdeObject;
 	}
 
--- a/harvester/common/src/harvestereventmanager.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvestereventmanager.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -93,6 +93,7 @@
             {
             // destroy the singleton and free TLS
             delete data;
+            data = NULL;
             UserSvr::DllFreeTls( KHarvesterEventManagerTLSKey );
             }
         }
@@ -439,6 +440,7 @@
 				
 				iRegisteredObservers.Remove( i );
 				delete observer;
+				observer = NULL;
 				}
 			// Find if any other observer is using the same queue
 			else
@@ -468,6 +470,7 @@
                     iEventQueues.Remove( mid );
                     queue->Close();
                     delete queue;
+                    queue = NULL;
                     break;
 	                }
 	            else if( compare > 0 )
--- a/harvester/common/src/harvesterexifutil.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvesterexifutil.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -156,6 +156,7 @@
 		}
 	
 	delete reader;
+	reader = NULL;
 	
 	WRITELOG( "CHarvesterExifUtil::IsValidExifData end" );	
 	OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA, "CHarvesterExifUtil::IsValidExifData end" );
--- a/harvester/common/src/harvestermediaidutil.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvestermediaidutil.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -136,8 +136,10 @@
 		if (data->iRefCount <= 0)
 			{
 			delete data->iMediaIdUtil;
+			data->iMediaIdUtil = NULL;
 
 			delete data;
+			data = NULL;
 			UserSvr::DllFreeTls(KHarvesterMediaIdTLSKey);
 			}
 		}
--- a/harvester/common/src/harvesterplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvesterplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -144,13 +144,13 @@
             {
             if( iQueue->Count() == 0 )
                 {
-                SetNextRequest( EHarvesterIdle );
                 if( iHarvesting )
                     {
                     TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( EFalse ) );
                     iHarvesting = EFalse;     
                     }
                 iQueue->Compress();
+                SetNextRequest( EHarvesterIdle );
                 }
             else
             	{
@@ -162,6 +162,11 @@
             
             	CHarvesterData* hd = (*iQueue)[0];
             	iQueue->Remove( 0 );
+            	if( !hd )
+            	    {
+            	    SetNextRequest( EHarvesterGathering );
+            	    break;
+            	    }
             	const TDesC& uri = hd->Uri();
             	TUint32 mediaId = hd->MdeObject().MediaId();
             	
@@ -194,7 +199,7 @@
 				TRAP_IGNORE( SetDefaultPropertiesL( *hd ) );
 				
 				WRITELOG1("CHarvesterPlugin::RunL - Calling HarvestL for file: %S", &uri);  
-                TRAPD(err, HarvestL( hd ) );
+                TRAPD( err, HarvestL( hd ) );
                 
                 if ( iBlacklist )
                     {
--- a/harvester/common/src/harvesterpluginfactory.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/harvesterpluginfactory.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -93,50 +93,9 @@
 // GetObjectDef
 // ---------------------------------------------------------------------------
 //
-EXPORT_C void CHarvesterPluginFactory::GetObjectDefL( CHarvesterData& aHD, TDes& aObjectDef )
+EXPORT_C void CHarvesterPluginFactory::GetObjectDefL( CHarvesterData& /*aHD*/, TDes& aObjectDef )
 	{
-	TPtrC extPtr;
-	if( MdsUtils::GetExt( aHD.Uri(), extPtr ) )
-		{
-		RPointerArray<CHarvesterPluginInfo> supportedPlugins;
-		CleanupClosePushL( supportedPlugins );
-		GetSupportedPluginsL( supportedPlugins, extPtr );
-		
-		const TInt sCount = supportedPlugins.Count();
-		if( sCount == 1 )
-			{
-			CHarvesterPluginInfo* info = supportedPlugins[0];
-			if( info->iObjectTypes.Count() == 1 )
-				{
-				aObjectDef.Copy( *(info->iObjectTypes[0]) );
-				aHD.SetHarvesterPluginInfo( info );
-				CleanupStack::PopAndDestroy( &supportedPlugins );
-				return;
-				}
-			}
-		for( TInt i = sCount - 1; i >=0; i-- )
-			{
-			CHarvesterPluginInfo* info = supportedPlugins[i];
-			if ( !(info->iPlugin) )
-				{
-				info->iPlugin = CHarvesterPlugin::NewL( info->iPluginUid );
-				info->iPlugin->SetQueue( info->iQueue );
-				info->iPlugin->SetHarvesterPluginFactory( *this );  
-				info->iPlugin->SetBlacklist( *iBlacklist );
-				}
-			info->iPlugin->GetObjectType( aHD.Uri(), aObjectDef );
-			if( aObjectDef.Length() > 0 )
-				{
-				aHD.SetHarvesterPluginInfo( info );
-				break;
-				}
-			}
-		CleanupStack::PopAndDestroy( &supportedPlugins );
-		}
-	else
-		{
-		aObjectDef.Zero();
-		}
+	aObjectDef.Zero();
 	}
 	
 // ---------------------------------------------------------------------------
@@ -209,7 +168,8 @@
 			
 		if( aHD->ObjectType() == EFastHarvest || aHD->Origin() == MdeConstants::Object::ECamera )
 		   	{
-		   	hpi->iQueue.Insert( aHD, 0 );
+		   	hpi->iQueue.InsertL( aHD, 0 );
+		   	
 		   	if( !hpi->iPlugin->IsActive() )
 		   	    {
 	            hpi->iPlugin->SetPriority( KHarvesterPriorityHarvestingPlugin + 1 );
@@ -328,11 +288,9 @@
     
     pluginInfo->iPluginUid = aPluginUid;
     
-#ifdef MDS_HARVESTERPLUGINS_ON_BOOT
     pluginInfo->iPlugin = CHarvesterPlugin::NewL( pluginInfo->iPluginUid );
     pluginInfo->iPlugin->SetQueue( pluginInfo->iQueue );
     pluginInfo->iPlugin->SetHarvesterPluginFactory( *this );
-#endif
     
     iHarvesterPluginInfoArray.AppendL( pluginInfo );
     CleanupStack::Pop( pluginInfo );
@@ -491,3 +449,54 @@
         }
     }
 
+EXPORT_C void CHarvesterPluginFactory::GetObjectDefL( CHarvesterData* aHD, TDes& aObjectDef )
+    {
+    TPtrC extPtr;
+    if( MdsUtils::GetExt( aHD->Uri(), extPtr ) )
+        {
+        RPointerArray<CHarvesterPluginInfo> supportedPlugins;
+        CleanupClosePushL( supportedPlugins );
+        GetSupportedPluginsL( supportedPlugins, extPtr );
+        
+        const TInt sCount = supportedPlugins.Count();
+        if( sCount == 1 )
+            {
+            CHarvesterPluginInfo* info = supportedPlugins[0];
+            if( info->iObjectTypes.Count() == 1 )
+                {
+                aObjectDef.Copy( *(info->iObjectTypes[0]) );
+                aHD->SetHarvesterPluginInfo( info );
+                CleanupStack::PopAndDestroy( &supportedPlugins );
+                return;
+                }
+            }
+        for( TInt i = sCount - 1; i >=0; i-- )
+            {
+            CHarvesterPluginInfo* info = supportedPlugins[i];
+            if ( !(info->iPlugin) )
+                {
+                info->iPlugin = CHarvesterPlugin::NewL( info->iPluginUid );
+                info->iPlugin->SetQueue( info->iQueue );
+                info->iPlugin->SetHarvesterPluginFactory( *this );  
+                info->iPlugin->SetBlacklist( *iBlacklist );
+                }
+            info->iPlugin->GetObjectType( aHD->Uri(), aObjectDef );
+            if( aHD && aObjectDef.Length() > 0 )
+                {
+                aHD->SetHarvesterPluginInfo( info );
+                break;
+                }
+            else if( !aHD )
+                {
+                break;
+                }
+            }
+        CleanupStack::PopAndDestroy( &supportedPlugins );
+        }
+    else
+        {
+        aObjectDef.Zero();
+        }
+    }
+
+
--- a/harvester/common/src/placeholderdata.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/placeholderdata.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -50,6 +50,7 @@
 CPlaceholderData::~CPlaceholderData()
 	{
 		delete iUri;
+		iUri = NULL;
 	}
 
 //==========================================================================
@@ -86,6 +87,7 @@
 EXPORT_C void CPlaceholderData::SetUri( const TDesC& aUri )
 	{
 	delete iUri;
+	iUri = NULL;
 	iUri = aUri.Alloc();
 	}
 
--- a/harvester/common/src/propertywatcher.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/src/propertywatcher.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -66,6 +66,7 @@
     if ( me )
         {
         delete me; 
+        me = NULL;
         Dll::SetTls( NULL ); // Free TLS.
         }
     
--- a/harvester/common/traces/fixed_id.definitions	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/traces/fixed_id.definitions	Wed Aug 18 10:12:07 2010 +0300
@@ -1,33 +1,33 @@
 #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xb
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_GETINSTANCEL=0x1
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x3
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_RELEASEINSTANCE=0x2
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x19
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x11
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREXIFUTIL_READEXIFDATAL=0x14
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xc
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x4
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1a
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x12
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL=0x15
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xd
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x5
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1b
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x13
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL=0x16
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xe
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x6
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1c
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL=0x17
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xf
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x7
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1d
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL=0x18
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0x10
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x8
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1e
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x9
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1f
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0xa
+[GROUP]TRACE_NORMAL=0x3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xb
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREVENTMANAGER_GETINSTANCEL=0x1
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREVENTMANAGER_RELEASEINSTANCE=0x2
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x19
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x11
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTEREXIFUTIL_READEXIFDATAL=0x14
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xc
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x4
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1a
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x12
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL=0x15
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xd
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x5
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1b
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x13
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL=0x16
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xe
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x6
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1c
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL=0x17
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xf
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x7
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1d
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL=0x18
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0x10
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x8
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1e
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x9
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1f
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0xa
--- a/harvester/common/traces/harvestereventmanagerTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/traces/harvestereventmanagerTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTEREVENTMANAGERTRACES_H__
@@ -6,22 +6,22 @@
 
 #define KOstTraceComponentID 0x200009fe
 
-#define CHARVESTEREVENTMANAGER_GETINSTANCEL 0x860001
-#define CHARVESTEREVENTMANAGER_RELEASEINSTANCE 0x860002
-#define CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860003
-#define DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860004
-#define DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860005
-#define DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860006
-#define DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860007
-#define DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860008
-#define DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860009
-#define DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x86000a
-#define CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000b
-#define DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000c
-#define DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000d
-#define DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000e
-#define DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000f
-#define DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x860010
+#define CHARVESTEREVENTMANAGER_GETINSTANCEL 0x30001
+#define CHARVESTEREVENTMANAGER_RELEASEINSTANCE 0x30002
+#define CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30003
+#define DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30004
+#define DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30005
+#define DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30006
+#define DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30007
+#define DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30008
+#define DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x30009
+#define DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x3000a
+#define CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x3000b
+#define DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x3000c
+#define DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x3000d
+#define DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x3000e
+#define DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x3000f
+#define DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x30010
 
 
 #endif
--- a/harvester/common/traces/harvesterexifutilTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/common/traces/harvesterexifutilTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTEREXIFUTILTRACES_H__
@@ -6,21 +6,21 @@
 
 #define KOstTraceComponentID 0x200009fe
 
-#define CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x860011
-#define DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x860012
-#define DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x860013
-#define CHARVESTEREXIFUTIL_READEXIFDATAL 0x860014
-#define DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860015
-#define DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860016
-#define DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860017
-#define DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860018
-#define CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x860019
-#define DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001a
-#define DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001b
-#define DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001c
-#define DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001d
-#define DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001e
-#define DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001f
+#define CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x30011
+#define DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x30012
+#define DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x30013
+#define CHARVESTEREXIFUTIL_READEXIFDATAL 0x30014
+#define DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL 0x30015
+#define DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL 0x30016
+#define DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL 0x30017
+#define DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL 0x30018
+#define CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x30019
+#define DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x3001a
+#define DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x3001b
+#define DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x3001c
+#define DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x3001d
+#define DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x3001e
+#define DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x3001f
 
 
 #endif
--- a/harvester/composerplugins/composerplugininterface/group/composerplugininterface.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/composerplugins/composerplugininterface/group/composerplugininterface.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -39,7 +39,7 @@
 
 #if defined(WINS)
     deffile ../bwincw/composerplugininterfacewinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/composerplugininterfacearm.def
 #endif
 nostrictdef
--- a/harvester/composerplugins/imagecomposer/inc/imagecomposerao.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/inc/imagecomposerao.h	Wed Aug 18 10:12:07 2010 +0300
@@ -267,6 +267,8 @@
         CHarvesterExifUtil* iExifUtil;
         
         RFs iFs;
+        
+        TBool iFastModeEnabled;
     };
 
 #endif // __CIMAGECOMPOSERAO_H__
--- a/harvester/composerplugins/imagecomposer/src/composerimageplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/src/composerimageplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -48,10 +48,13 @@
     WRITELOG( "CComposerImagePlugin::~CComposerImagePlugin()" );
 
     delete iImageComposerAO;
+    iImageComposerAO = NULL;
     delete iLocationRelationObserver;
+    iLocationRelationObserver = NULL;
     delete iImagePresentObserver;
-    
+    iImagePresentObserver = NULL;
     delete iMdEHarvesterSession;
+    iMdEHarvesterSession = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -71,16 +71,20 @@
     if ( iMdeObject )
         {
         delete iMdeObject;
+        iMdeObject = NULL;
         }
     if ( iExifUtil )
     	{
     	delete iExifUtil;
+    	iExifUtil = NULL;
     	}
 
     delete iRelationQuery;
+    iRelationQuery = NULL;
     iFs.Close();
     
     delete iMdEHarvesterSession;
+    iMdEHarvesterSession = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -110,6 +114,7 @@
     CActiveScheduler::Add( this );
     
     iExifUtil = CHarvesterExifUtil::NewL();
+    iFastModeEnabled = EFalse;
     User::LeaveIfError( iFs.Connect() );
     }
     
@@ -241,6 +246,10 @@
             if( iItemQueue.Count() <= 0 )
             	{
                 iItemQueue.Compress();
+                if( iFastModeEnabled )
+                    {
+                    SetPriority( KHarvesterPriorityComposerPlugin );
+                    }
             	SetNextRequest( ERequestReady );
             	}
             else
@@ -250,6 +259,20 @@
 	            
 	            if ( err == KErrNone )
 	                {    
+	                CMdEProperty* prop = NULL;
+	                CMdEPropertyDef& originPropDef = iMdeObject->Def().GetPropertyDefL( Object::KOriginProperty );
+	                iMdeObject->Property( originPropDef, prop );
+	                if( prop && prop->Uint8ValueL() == MdeConstants::Object::ECamera && !iFastModeEnabled )
+	                    {
+	                    iFastModeEnabled = ETrue;
+	                    SetPriority( KHarvesterPriorityMonitorPlugin );
+	                    }
+	                else if( iFastModeEnabled )
+	                    {
+	                    iFastModeEnabled = EFalse;
+	                    SetPriority( KHarvesterPriorityComposerPlugin );
+	                    }
+	                
 	                SetNextRequest( ERequestCompose );
 	                }
 	            // if object does not exists, find next
@@ -746,8 +769,13 @@
 
     // Check whether the file is open
     TBool isOpen( EFalse );
-    iFs.IsFileOpen( uri, isOpen );
-    if ( isOpen )
+    const TInt openError = iFs.IsFileOpen( uri, isOpen );
+    if( openError != KErrNone )
+        {
+        WRITELOG( "CImageComposerAO::DoWriteExifL() - check for open file failed!" );
+        User::Leave( openError );
+        }
+    else if ( isOpen )
         {
         WRITELOG( "CImageComposerAO::DoWriteExifL() - file handle is open!" );
         User::Leave( KErrInUse );
--- a/harvester/composerplugins/imagecomposer/src/locationrelationobserver.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/src/locationrelationobserver.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -47,6 +47,7 @@
 	    {
 	    iQuery->Cancel();
 	    delete iQuery;
+	    iQuery = NULL;
 	    }
 	}
 
@@ -208,6 +209,7 @@
 	            }
 	    	
 	    	delete relation;
+	    	relation = NULL;
 	    	}
 	    	)
     	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/data/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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:  Build information file
+*
+*/
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+blacklist_backup_registration.xml	/epoc32/winscw/c/private/200009F5/backup_registration.xml
+blacklist_backup_registration.xml   /epoc32/data/z/private/200009F5/backup_registration.xml
+default_origin_mappings.db    /epoc32/winscw/c/private/200009F5/mappings.db
+default_origin_mappings.db    /epoc32/data/z/private/200009F5/mappings.db
+../conf/harvester.confml        MW_LAYER_CONFML(harvester.confml)
+../conf/harvester_200009FE.crml MW_LAYER_CRML(harvester_200009FE.crml)
+
+../sis/blacklistserver/blacklistserver_stub.sis  /epoc32/data/z/system/install/blacklistserver_stub.sis
+../sis/composerplugins/composerplugins_stub.sis  /epoc32/data/z/system/install/composerplugins_stub.sis
+../sis/harvester/harvester_stub.sis  /epoc32/data/z/system/install/harvester_stub.sis
+../sis/harvesterplugins/harvesterplugins_stub.sis  /epoc32/data/z/system/install/harvesterplugins_stub.sis
+../sis/monitorplugins/monitorplugins_stub.sis  /epoc32/data/z/system/install/monitorplugins_stub.sis
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+
+PRJ_TESTEXPORTS
--- a/harvester/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -25,27 +25,16 @@
 #include "../server/group/bld.inf"
 #include "../client/group/bld.inf"
 
+#include "../data/bld.inf"
 
 PRJ_PLATFORMS
     DEFAULT
 
 PRJ_EXPORTS
-../data/blacklist_backup_registration.xml	/epoc32/winscw/c/private/200009F5/backup_registration.xml
-../data/blacklist_backup_registration.xml   /epoc32/data/z/private/200009F5/backup_registration.xml
-../data/default_origin_mappings.db    /epoc32/winscw/c/private/200009F5/mappings.db
-../data/default_origin_mappings.db    /epoc32/data/z/private/200009F5/mappings.db
-../conf/harvester.confml        MW_LAYER_CONFML(harvester.confml)
-../conf/harvester_200009FE.crml MW_LAYER_CRML(harvester_200009FE.crml)
-
-../sis/blacklistserver/blacklistserver_stub.sis  /epoc32/data/z/system/install/blacklistserver_stub.sis
-../sis/composerplugins/composerplugins_stub.sis  /epoc32/data/z/system/install/composerplugins_stub.sis
-../sis/harvester/harvester_stub.sis  /epoc32/data/z/system/install/harvester_stub.sis
-../sis/harvesterplugins/harvesterplugins_stub.sis  /epoc32/data/z/system/install/harvesterplugins_stub.sis
-../sis/monitorplugins/monitorplugins_stub.sis  /epoc32/data/z/system/install/monitorplugins_stub.sis
 
 PRJ_MMPFILES
 
 PRJ_TESTMMPFILES
 
+PRJ_TESTEXPORTS
 
-PRJ_TESTEXPORTS
--- a/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h	Wed Aug 18 10:12:07 2010 +0300
@@ -66,10 +66,11 @@
 	private:
 		CHarvesterAudioPluginPropertyDefs();
 	
-		void ConstructL(CMdEObjectDef& aObjectDef);
+		void ConstructL( CMdEObjectDef& aObjectDef );
 
 	public:	
-		static CHarvesterAudioPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+		static CHarvesterAudioPluginPropertyDefs* NewL();
+		void SetByObjectDefL( CMdEObjectDef& aObjectDef );
 	};
 
 class CHarvesterAudioPlugin : public CHarvesterPlugin,
@@ -148,6 +149,8 @@
 		 */
         void GetMusicPropertiesL( CHarvesterData* aHD, TBool aIsAdd, TPtrC aMimeType );
 
+        void InitPropDefsL( CMdEObjectDef& aObjectDef );
+
 	private:
 		CAudioMDParser* iAudioParser;
 		
--- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -25,6 +25,7 @@
 #include <caf/caf.h>
 #include <pathinfo.h>
 
+#include "harvestercommon.h"
 #include "harvesteraudioplugin.h"
 #include "harvesteraudiopluginutils.h"
 #include "mdsutils.h"
@@ -36,52 +37,55 @@
 const TUid KHarvesterRepoUid = { 0x200009FE };
 const TUint32 KEnableAlbumArtHarvest = 0x00090001;
 
-CHarvesterAudioPluginPropertyDefs::CHarvesterAudioPluginPropertyDefs() : CBase()
+CHarvesterAudioPluginPropertyDefs::CHarvesterAudioPluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
 void CHarvesterAudioPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
 	{
-	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
+    SetByObjectDefL( aObjectDef );
+	}
+
+CHarvesterAudioPluginPropertyDefs* CHarvesterAudioPluginPropertyDefs::NewL()
+    {
+    CHarvesterAudioPluginPropertyDefs* self = 
+        new (ELeave) CHarvesterAudioPluginPropertyDefs();
+    return self;
+    }
 
-	// Common property definitions
-	CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
-	iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
-	iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
-	iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
-	iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
-	iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
+void CHarvesterAudioPluginPropertyDefs::SetByObjectDefL(CMdEObjectDef& aObjectDef)
+    {
+    CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
+
+    // Common property definitions
+    CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
+    iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
+    iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
+    iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
+    iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
+    iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
     iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTimeOffsetProperty );
     iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder );
 
-	// Media property definitions
-	CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
-	iRatingPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KRatingProperty );
-	iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
-	iArtistPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty );
-	iDurationPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDurationProperty );
-	iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KCopyrightProperty );
-	iTrackPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KTrackProperty );
-	iThumbnailPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KThumbnailPresentProperty );
-	iDatePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KReleaseDateProperty );
+    // Media property definitions
+    CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
+    iRatingPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KRatingProperty );
+    iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
+    iArtistPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty );
+    iDurationPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDurationProperty );
+    iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KCopyrightProperty );
+    iTrackPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KTrackProperty );
+    iThumbnailPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KThumbnailPresentProperty );
+    iDatePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KReleaseDateProperty );
     iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty );
 
-	// Audio property definitions
-	CMdEObjectDef& audioDef = nsDef.GetObjectDefL( MdeConstants::Audio::KAudioObject );
-	iAlbumPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty );
-	iComposerPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty );
-	iOriginalArtistPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KOriginalArtistProperty );
-	}
-
-CHarvesterAudioPluginPropertyDefs* CHarvesterAudioPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterAudioPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterAudioPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
+    // Audio property definitions
+    CMdEObjectDef& audioDef = nsDef.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+    iAlbumPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty );
+    iComposerPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty );
+    iOriginalArtistPropertyDef = &audioDef.GetPropertyDefL( MdeConstants::Audio::KOriginalArtistProperty );
+    }
 
 using namespace MdeConstants;
 
@@ -118,11 +122,16 @@
 	WRITELOG( "CHarvesterAudioPlugin::~CHarvesterAudioPlugin()" );
 	
 	delete iAudioParser;
+	iAudioParser = NULL;
 	delete iPropDefs;
+	iPropDefs = NULL;
 	delete iTNM;
+	iTNM = NULL;
 	
 	delete iPhoneSoundsPath;
+	iPhoneSoundsPath = NULL;
 	delete iMmcSoundsPath;
+	iMmcSoundsPath = NULL;
 	}
 
 // ---------------------------------------------------------------------------
@@ -144,7 +153,10 @@
         {
         TRAP_IGNORE( iTNM = CThumbnailManager::NewL( *this ) );
         }
+		
+    iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL();
     
+    SetPriority( KHarvesterPriorityHarvestingPlugin - 2 );
 	
     TFileName sounds = PathInfo::SoundsPath();
     
@@ -287,13 +299,7 @@
     TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
     TTime localModifiedDate = entry.iModified + timeOffsetSeconds;
 	
-	if( !iPropDefs )
-		{
-		CMdEObjectDef& objectDef = mdeObject.Def();
-		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
-		// Prefetch max text lengt for validity checking
-		iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
-		}
+	InitPropDefsL( mdeObject.Def() );
 	
 	CMdeObjectWrapper::HandleObjectPropertyL(
                  mdeObject, *iPropDefs->iCreationDatePropertyDef, &localModifiedDate, aIsAdd );
@@ -322,13 +328,7 @@
     
     if ( mapping && !mdeObject.Placeholder() )
         {
-    	if( !iPropDefs )
-    		{
-    		CMdEObjectDef& objectDef = mdeObject.Def();
-    		iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef );
-    		// Prefetch max text lengt for validity checking
-    		iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
-    		}
+        InitPropDefsL( mdeObject.Def() );
         
     	CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
     			*iPropDefs->iItemTypePropertyDef, (TAny*)&(mapping->iMimeType), aIsAdd );
@@ -354,13 +354,7 @@
     CMdEObject& mdeObject = aHD->MdeObject();
     const TDesC& uri = mdeObject.Uri();
  
-    if( !iPropDefs )
-        {
-        CMdEObjectDef& audioObjectDef = mdeObject.Def();
-        iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( audioObjectDef );
-        // Prefetch max text lengt for validity checking
-        iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
-        }
+    InitPropDefsL( mdeObject.Def() );
 
     TBool possiblyProtectedContent( EFalse );
     if( aMimeType.Length() > 0 )
@@ -534,6 +528,7 @@
         CleanupStack::Pop(); // jpegBuf
         iTNM->CreateThumbnails( *tnmSource );
         delete tnmSource;
+        tnmSource = NULL;
         TBool thumbnailPresent( ETrue );
         CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
                           *iPropDefs->iThumbnailPropertyDef, &thumbnailPresent, aIsAdd );
@@ -553,5 +548,15 @@
 #endif   
     }
 
+void CHarvesterAudioPlugin::InitPropDefsL(CMdEObjectDef& aObjectDef)
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        // Prefetch max text lengt for validity checking
+        iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
+        }
+    }
+
 // End of file
 
--- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -74,6 +74,7 @@
 CAudioMDParser::~CAudioMDParser()
     {
     delete iMetaDataUtility;
+    iMetaDataUtility = NULL;
     
     iMimeTypeMappings.Close();
     iWantedMetadataFields.Close();
--- a/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h	Wed Aug 18 10:12:07 2010 +0300
@@ -102,10 +102,11 @@
 	private:
 		CHarvesterImagePluginPropertyDefs();
 	
-		void ConstructL(CMdEObjectDef& aObjectDef);
+		void ConstructL( CMdEObjectDef& aObjectDef );
 
 	public:	
-		static CHarvesterImagePluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+		static CHarvesterImagePluginPropertyDefs* NewL();
+		void SetByObjectDefL( CMdEObjectDef& aObjectDef) ;
 	};
 
 class CHarvesterImagePlugin : public CHarvesterPlugin
@@ -168,7 +169,9 @@
 		
 		// 2nd phase constructor
 		void ConstructL();
-	
+		
+		void InitPropDefsL( CMdEObjectDef& aObjectDef );
+
 	private:
 	
 		enum TImageMetadataHandling
--- a/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -69,87 +69,90 @@
 const TUid KBGPSUid = { 0x0ADC2480 };
 #endif
 
-CHarvesterImagePluginPropertyDefs::CHarvesterImagePluginPropertyDefs() : CBase()
+CHarvesterImagePluginPropertyDefs::CHarvesterImagePluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
-void CHarvesterImagePluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
+void CHarvesterImagePluginPropertyDefs::ConstructL( CMdEObjectDef& aObjectDef )
 	{
-	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
-
-	// Image property definitions
-	CMdEObjectDef& objectDef = nsDef.GetObjectDefL( Object::KBaseObject );
-	iCreationDatePropertyDef = &objectDef.GetPropertyDefL( Object::KCreationDateProperty );
-	iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( Object::KLastModifiedDateProperty );
-	iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty );
-	iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty );
-	iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty );
-	iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder );
-
-	// Media property definitions
-	CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject );
-	iWidthPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KWidthProperty );
-	iHeightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KHeightProperty );
-	iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDescriptionProperty );
-	iCommentPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCommentProperty );
-	iReleaseDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KReleaseDateProperty );
-	iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCopyrightProperty );
-	iCaptureDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCaptureDateProperty );
-	iResolutionUnitPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KResolutionUnitProperty );
-	iArtistPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KArtistProperty );
-
-	// Image property definitions
-	CMdEObjectDef& imageDef = nsDef.GetObjectDefL( Image::KImageObject );
-	iPixelYDimensionPropertyDef = &imageDef.GetPropertyDefL( Image::KPixelYDimensionProperty );
-	iPixelXDimensionPropertyDef = &imageDef.GetPropertyDefL( Image::KPixelXDimensionProperty );
-	iBitsPerSamplePropertyDef = &imageDef.GetPropertyDefL( Image::KBitsPerSampleProperty );
-	iFrameCountPropertyDef = &imageDef.GetPropertyDefL( Image::KFrameCountProperty );
-	iDateTimeOriginalPropertyDef = &imageDef.GetPropertyDefL( Image::KDateTimeOriginalProperty );
-	iDateTimeDigitizedPropertyDef = &imageDef.GetPropertyDefL( Image::KDateTimeDigitizedProperty );
-	iDateTimePropertyDef = &imageDef.GetPropertyDefL( Image::KDateTimeProperty );
-	iWhiteBalancePropertyDef = &imageDef.GetPropertyDefL( Image::KWhiteBalanceProperty );
-	iFlashPropertyDef = &imageDef.GetPropertyDefL( Image::KFlashProperty );
-	iExposureProgramPropertyDef = &imageDef.GetPropertyDefL( Image::KExposureProgramProperty );
-	iMakePropertyDef = &imageDef.GetPropertyDefL( Image::KMakeProperty );
-	iModelPropertyDef = &imageDef.GetPropertyDefL( Image::KModelProperty );
-	iOrientationPropertyDef = &imageDef.GetPropertyDefL( Image::KOrientationProperty );
-	iXResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KXResolutionProperty );
-	iYResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KYResolutionProperty );
-	iYCbCrPositioningPropertyDef = &imageDef.GetPropertyDefL( Image::KYCbCrPositioningProperty );
-	iExposureTimePropertyDef = &imageDef.GetPropertyDefL( Image::KExposureTimeProperty );
-	iFNumberPropertyDef = &imageDef.GetPropertyDefL( Image::KFNumberProperty );
-	iExifVersionPropertyDef = &imageDef.GetPropertyDefL( Image::KExifVersionProperty );
-	iShutterSpeedValuePropertyDef = &imageDef.GetPropertyDefL( Image::KShutterSpeedValueProperty );
-	iApertureValuePropertyDef = &imageDef.GetPropertyDefL( Image::KApertureValueProperty );
-	iFocalLengthPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalLengthProperty );
-	iFlashPixVersionPropertyDef = &imageDef.GetPropertyDefL( Image::KFlashPixVersionProperty );
-	iColourSpacePropertyDef = &imageDef.GetPropertyDefL( Image::KColourSpaceProperty );
-	iISOSpeedRatingsPropertyDef = &imageDef.GetPropertyDefL( Image::KISOSpeedRatingsProperty );
-	iComponentsConfigurationPropertyDef = &imageDef.GetPropertyDefL( Image::KComponentsConfigurationProperty );
-	iExposureBiasValuePropertyDef = &imageDef.GetPropertyDefL( Image::KExposureBiasValueProperty );
-	iSamplesPerPixelPropertyDef = &imageDef.GetPropertyDefL( Image::KSamplesPerPixelProperty );
-	iThumbCompressionPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbCompressionProperty );
-	iThumbXResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbXResolutionProperty );
-	iThumbYResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbYResolutionProperty );
-	iThumbResolutionUnitPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbResolutionUnitProperty );
-	iFocalLengthIn35mmFilmPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalLengthIn35mmFilmProperty );
-	iMeteringModePropertyDef = &imageDef.GetPropertyDefL( Image::KMeteringModeProperty );
-	iRelatedSoundFilePropertyDef = &imageDef.GetPropertyDefL( Image::KRelatedSoundFileProperty );
-	iFocalPlaneResolutionUnitPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalPlaneResolutionUnitProperty );
-	iFocalPlaneXResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalPlaneXResolutionProperty );
-	iFocalPlaneYResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalPlaneYResolutionProperty );
-	iDraftPropertyDef = &imageDef.GetPropertyDefL( Image::KDraftProperty );
+    SetByObjectDefL( aObjectDef );
 	}
 
-CHarvesterImagePluginPropertyDefs* CHarvesterImagePluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterImagePluginPropertyDefs* self = 
-		new (ELeave) CHarvesterImagePluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
+CHarvesterImagePluginPropertyDefs* CHarvesterImagePluginPropertyDefs::NewL()
+    {
+    CHarvesterImagePluginPropertyDefs* self = 
+        new (ELeave) CHarvesterImagePluginPropertyDefs();
+    return self;
+    }
+
+void CHarvesterImagePluginPropertyDefs::SetByObjectDefL(CMdEObjectDef& aObjectDef)
+    {
+    CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
+
+    // Image property definitions
+    CMdEObjectDef& objectDef = nsDef.GetObjectDefL( Object::KBaseObject );
+    iCreationDatePropertyDef = &objectDef.GetPropertyDefL( Object::KCreationDateProperty );
+    iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( Object::KLastModifiedDateProperty );
+    iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty );
+    iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty );
+    iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty );
+    iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder );
+
+    // Media property definitions
+    CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject );
+    iWidthPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KWidthProperty );
+    iHeightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KHeightProperty );
+    iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDescriptionProperty );
+    iCommentPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCommentProperty );
+    iReleaseDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KReleaseDateProperty );
+    iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCopyrightProperty );
+    iCaptureDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCaptureDateProperty );
+    iResolutionUnitPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KResolutionUnitProperty );
+    iArtistPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KArtistProperty );
+
+    // Image property definitions
+    CMdEObjectDef& imageDef = nsDef.GetObjectDefL( Image::KImageObject );
+    iPixelYDimensionPropertyDef = &imageDef.GetPropertyDefL( Image::KPixelYDimensionProperty );
+    iPixelXDimensionPropertyDef = &imageDef.GetPropertyDefL( Image::KPixelXDimensionProperty );
+    iBitsPerSamplePropertyDef = &imageDef.GetPropertyDefL( Image::KBitsPerSampleProperty );
+    iFrameCountPropertyDef = &imageDef.GetPropertyDefL( Image::KFrameCountProperty );
+    iDateTimeOriginalPropertyDef = &imageDef.GetPropertyDefL( Image::KDateTimeOriginalProperty );
+    iDateTimeDigitizedPropertyDef = &imageDef.GetPropertyDefL( Image::KDateTimeDigitizedProperty );
+    iDateTimePropertyDef = &imageDef.GetPropertyDefL( Image::KDateTimeProperty );
+    iWhiteBalancePropertyDef = &imageDef.GetPropertyDefL( Image::KWhiteBalanceProperty );
+    iFlashPropertyDef = &imageDef.GetPropertyDefL( Image::KFlashProperty );
+    iExposureProgramPropertyDef = &imageDef.GetPropertyDefL( Image::KExposureProgramProperty );
+    iMakePropertyDef = &imageDef.GetPropertyDefL( Image::KMakeProperty );
+    iModelPropertyDef = &imageDef.GetPropertyDefL( Image::KModelProperty );
+    iOrientationPropertyDef = &imageDef.GetPropertyDefL( Image::KOrientationProperty );
+    iXResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KXResolutionProperty );
+    iYResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KYResolutionProperty );
+    iYCbCrPositioningPropertyDef = &imageDef.GetPropertyDefL( Image::KYCbCrPositioningProperty );
+    iExposureTimePropertyDef = &imageDef.GetPropertyDefL( Image::KExposureTimeProperty );
+    iFNumberPropertyDef = &imageDef.GetPropertyDefL( Image::KFNumberProperty );
+    iExifVersionPropertyDef = &imageDef.GetPropertyDefL( Image::KExifVersionProperty );
+    iShutterSpeedValuePropertyDef = &imageDef.GetPropertyDefL( Image::KShutterSpeedValueProperty );
+    iApertureValuePropertyDef = &imageDef.GetPropertyDefL( Image::KApertureValueProperty );
+    iFocalLengthPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalLengthProperty );
+    iFlashPixVersionPropertyDef = &imageDef.GetPropertyDefL( Image::KFlashPixVersionProperty );
+    iColourSpacePropertyDef = &imageDef.GetPropertyDefL( Image::KColourSpaceProperty );
+    iISOSpeedRatingsPropertyDef = &imageDef.GetPropertyDefL( Image::KISOSpeedRatingsProperty );
+    iComponentsConfigurationPropertyDef = &imageDef.GetPropertyDefL( Image::KComponentsConfigurationProperty );
+    iExposureBiasValuePropertyDef = &imageDef.GetPropertyDefL( Image::KExposureBiasValueProperty );
+    iSamplesPerPixelPropertyDef = &imageDef.GetPropertyDefL( Image::KSamplesPerPixelProperty );
+    iThumbCompressionPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbCompressionProperty );
+    iThumbXResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbXResolutionProperty );
+    iThumbYResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbYResolutionProperty );
+    iThumbResolutionUnitPropertyDef = &imageDef.GetPropertyDefL( Image::KThumbResolutionUnitProperty );
+    iFocalLengthIn35mmFilmPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalLengthIn35mmFilmProperty );
+    iMeteringModePropertyDef = &imageDef.GetPropertyDefL( Image::KMeteringModeProperty );
+    iRelatedSoundFilePropertyDef = &imageDef.GetPropertyDefL( Image::KRelatedSoundFileProperty );
+    iFocalPlaneResolutionUnitPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalPlaneResolutionUnitProperty );
+    iFocalPlaneXResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalPlaneXResolutionProperty );
+    iFocalPlaneYResolutionPropertyDef = &imageDef.GetPropertyDefL( Image::KFocalPlaneYResolutionProperty );
+    iDraftPropertyDef = &imageDef.GetPropertyDefL( Image::KDraftProperty );
+    }
 
 /**
 * Default constructor
@@ -185,17 +188,22 @@
 		{
 		iDecoder->Reset();
 	    delete iDecoder;
+	    iDecoder = NULL;
 		}   
     
     if (iExifUtil)
 		{
 		delete iExifUtil;
+		iExifUtil = NULL;
 		}
    	
     delete iPropDefs;
+    iPropDefs = NULL;
     
     delete iPhoneImagesPath;
+    iPhoneImagesPath = NULL;
     delete iMmcImagesPath;
+    iMmcImagesPath = NULL;
     
     iMimeTypeMappings.Close();
     iFbs.Disconnect();
@@ -211,6 +219,8 @@
 	iExifUtil = CHarvesterExifUtil::NewL();
     User::LeaveIfError( iFbs.Connect() );
 
+    iPropDefs = CHarvesterImagePluginPropertyDefs::NewL(); 
+
     TLinearOrder< TMimeTypeMapping<TImageMetadataHandling> > cmp(
     		TMimeTypeMapping<TImageMetadataHandling>::CompareFunction);
 
@@ -396,13 +406,8 @@
         {
         CMdEProperty* prop = NULL;
         CMdEObjectDef& objectDef = *aFileData.iImageDef;
-        
-        if( !iPropDefs )
-        	{
-        	iPropDefs = CHarvesterImagePluginPropertyDefs::NewL( objectDef );
-        	// Prefetch max text lengt for validity checking
-        	iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
-        	}
+		
+        InitPropDefsL( objectDef );        
         
         aMetadataObject.Property( *iPropDefs->iSizePropertyDef, prop );
         if( prop )
@@ -692,13 +697,8 @@
     WRITELOG( "CHarvesterImagePlugin::HandleObjectPropertiesL() - New MdE object" );
     
     CMdEObject& mdeObject = aHarvesterData.MdeObject();
-    
-    if( !iPropDefs )
-    	{
-    	iPropDefs = CHarvesterImagePluginPropertyDefs::NewL( mdeObject.Def() );
-    	// Prefetch max text lengt for validity checking
-    	iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
-    	}
+	
+    InitPropDefsL( mdeObject.Def() );
 
     TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
 
@@ -1084,3 +1084,14 @@
     
     return KErrNotSupported;
     }
+
+void CHarvesterImagePlugin::InitPropDefsL( CMdEObjectDef& aObjectDef )
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        // Prefetch max text lengt for validity checking
+        iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
+        }
+    }
+
--- a/harvester/harvesterplugins/MessagePlugin/src/harvestermessageplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/MessagePlugin/src/harvestermessageplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -73,9 +73,13 @@
 	{
 	WRITELOG("CHarvesterMessagePlugin::~CHarvesterMessagePlugin()");
 	delete iMmsMtm;
+	iMmsMtm = NULL;
 	delete iSmsMtm;
+	iSmsMtm = NULL;
 	delete iMtmReg;
-	delete iMsvSession;  
+	iMtmReg = NULL;
+	delete iMsvSession;
+	iMsvSession = NULL;
 	}
 
 /**
--- a/harvester/harvesterplugins/OMADRMPlugin/group/harvesteromadrmplugin.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/group/harvesteromadrmplugin.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -47,6 +47,7 @@
 
 LIBRARY       euser.lib
 LIBRARY       efsrv.lib
+LIBRARY       imageconversion.lib
 LIBRARY       caf.lib
 LIBRARY	      cafutils.lib
 LIBRARY       harvesterplugininterface.lib
--- a/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h	Wed Aug 18 10:12:07 2010 +0300
@@ -18,13 +18,17 @@
 #ifndef __CHARVESTEROMADRMPLUGIN_H__
 #define __CHARVESTEROMADRMPLUGIN_H__
 
+#include <mdeobject.h>
 #include <e32base.h>
 #include <apmstd.h>
-#include "harvesterplugin.h"
+#include <imageconversion.h>
+#include <harvesterplugin.h>
+#include <harvesterdata.h>
+
 
 // FORWARD DECLARATION
-class CMdEObjectDef;
-class CMdEObject;
+class CFileData;
+class CHarvestData;
 
 /**
 * A data transfer class for harvested drm metadata.
@@ -84,14 +88,20 @@
 		CMdEPropertyDef* iAuthorPropertyDef;
 		CMdEPropertyDef* iGenrePropertyDef;
 		CMdEPropertyDef* iDefaultFolderPropertyDef;
+		CMdEPropertyDef* iWidthPropertyDef;
+		CMdEPropertyDef* iHeightPropertyDef;
 	
+		// Image property definitions
+		CMdEPropertyDef* iFrameCountPropertyDef;
+		CMdEPropertyDef* iBitsPerSamplePropertyDef;
 	private:
 		CHarvesterOmaDrmPluginPropertyDefs();
 	
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterOmaDrmPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+        static CHarvesterOmaDrmPluginPropertyDefs* NewL();
+        void SetByObjectDefL( CMdEObjectDef& aObjectDef) ;
 	};
 
 class CHarvesterOMADRMPlugin : public CHarvesterPlugin
@@ -126,35 +136,62 @@
 	
 	private:
 		/**
+        * Gathers data from file to meta data object.
+        *
+        * @param aMetadataObject  A reference to meta data object to gather the data.
+        * @param aDRMharvestData
+        * @param aFileData
+        * @param aHarvestData
+        */
+        TInt GatherDataL( CMdEObject& aMetadataObject, CDRMHarvestData& aDRMharvestData, 
+			CFileData& aFileData, CHarvestData& aHarvestData );
+	
+		
+		
+			/**
+			
 		* C++ constructor - not exported;
 		* implicitly called from NewL()
 		*
 		* @return an instance of CHarvesterOMADRMPlugin.
 		*/
-		CHarvesterOMADRMPlugin();
+
+		/**
+         * Handle addition of new mde video objects.
+         *
+         * @param aMetadataObject  A reference to meta data object to gather the data.
+         * @param aDRMharvestData
+         * @param aFileData
+         * @param aHarvestData
+         */
+        void HandleObjectPropertiesL( CHarvestData& aHarvestData, CDRMHarvestData& aDRMharvestData, CFileData& aFileData, 
+			CHarvesterData& aHarvesterData, TBool aIsAdd );
 		
-		/**
-		* 2nd phase construction, called by NewLC()
+				// Default constructor
+		CHarvesterOMADRMPlugin();
+	/**
+	* 2nd phase construction, called by NewLC()
 		*/
 		void ConstructL();
 		
-		/**
-        * Gathers data from file to meta data object.
-        *
-        * @param aMetadataObject  A reference to meta data object to gather the data.
-        * @param aHarvestData  An object to store harvested video file data.
-        */
-        void GatherDataL( CMdEObject& aMetadataObject, CDRMHarvestData& aHarvestData );
+	    void InitPropDefsL( CMdEObjectDef& aObjectDef );
+	      
+  protected:
+        /** 
+         * Handle to File server session.
+         */
+        RFs iFs;
+        
+	private:
+	     /**
+         *  image decoder
+         */        
+        
+
 		
-        /**
-         * Handle addition of new mde video objects.
-         *
-         * @param aMetadataObject  A reference to meta data object to gather the data.
-         * @param aHarvestData  An object containing harvested video file data.
-         */
-        void HandleObjectPropertiesL( CHarvesterData& aHD, CDRMHarvestData& aVHD, TBool aIsAdd );
+      
 
-	private:
+
 		CHarvesterOmaDrmPluginPropertyDefs* iPropDefs;
 		
 		TInt iMaxTextLength;
@@ -167,6 +204,7 @@
         
         HBufC* iPhoneSoundsPath;
         HBufC* iMmcSoundsPath;
+
 	};
 
 #endif // __CHarvesterOMADRMPlugin_H__
--- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -20,6 +20,7 @@
 #include <pathinfo.h>
 
 #include "mdsutils.h"
+#include "harvesterexifutil.h"
 #include "harvesteromadrmplugin.h"
 #include "harvesterlog.h"
 #include "harvestercommon.h"
@@ -33,6 +34,9 @@
 #include <mdetextproperty.h>
 #include <mdenamespacedef.h>
 #include <mdeconstants.h>
+#include <imageconversion.h>
+
+using namespace MdeConstants;
 
 _LIT(KImage, "Image");
 _LIT(KVideo, "Video");
@@ -44,11 +48,24 @@
 
 _LIT(KInUse, "InUse");
 
-CHarvesterOmaDrmPluginPropertyDefs::CHarvesterOmaDrmPluginPropertyDefs() : CBase()
+CHarvesterOmaDrmPluginPropertyDefs::CHarvesterOmaDrmPluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
-void CHarvesterOmaDrmPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
+void CHarvesterOmaDrmPluginPropertyDefs::ConstructL( CMdEObjectDef& aObjectDef )
+    {
+    SetByObjectDefL( aObjectDef );
+    }
+
+CHarvesterOmaDrmPluginPropertyDefs* CHarvesterOmaDrmPluginPropertyDefs::NewL()
+    {
+    CHarvesterOmaDrmPluginPropertyDefs* self = 
+        new (ELeave) CHarvesterOmaDrmPluginPropertyDefs();
+    return self;
+    }
+
+void CHarvesterOmaDrmPluginPropertyDefs::SetByObjectDefL( CMdEObjectDef& aObjectDef )
 	{
 	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
 	
@@ -65,17 +82,16 @@
 	iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty );
 	iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDescriptionProperty );
 	iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KAuthorProperty );
-	iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
-	}
+
+	// Media property definitions
+	iWidthPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KWidthProperty );
+	iHeightPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KHeightProperty );
 
-CHarvesterOmaDrmPluginPropertyDefs* CHarvesterOmaDrmPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterOmaDrmPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterOmaDrmPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
+	// Image property definitions
+	CMdEObjectDef& imageDef = nsDef.GetObjectDefL( MdeConstants::Image::KImageObject );
+	iBitsPerSamplePropertyDef = &imageDef.GetPropertyDefL( MdeConstants::Image::KBitsPerSampleProperty );
+	iFrameCountPropertyDef = &imageDef.GetPropertyDefL( MdeConstants::Image::KFrameCountProperty );
+	iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
 	}
 
 /**
@@ -108,16 +124,25 @@
 	{
 	WRITELOG("CHarvesterOMADRMPlugin::~CHarvesterOMADRMPlugin()");
 	
+	iFs.Close();
+
+	delete iPropDefs;
+    iPropDefs = NULL;
+
     delete iPhoneImagesPath;
+    iPhoneImagesPath = NULL;
     delete iMmcImagesPath;
+    iMmcImagesPath = NULL;
     
     delete iPhoneVideosPath;
+    iPhoneVideosPath = NULL;
     delete iMmcVideosPath;
+    iMmcVideosPath = NULL;
     
     delete iPhoneSoundsPath;
+    iPhoneSoundsPath = NULL;
     delete iMmcSoundsPath;
-	
-	delete iPropDefs;
+    iMmcSoundsPath = NULL;
 	}
 
 /**
@@ -126,7 +151,12 @@
 void CHarvesterOMADRMPlugin::ConstructL()
 	{
 	WRITELOG( "CHarvesterOMADRMPlugin::ConstructL()" );
+    SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );	
+    
+    User::LeaveIfError( iFs.Connect() );
 	
+    iPropDefs = CHarvesterOmaDrmPluginPropertyDefs::NewL();
+    
 	TFileName phoneRoot = PathInfo::PhoneMemoryRootPath();
 	TFileName mmcRoot = PathInfo::MemoryCardRootPath();
 	
@@ -161,25 +191,33 @@
     iMmcSoundsPath = mmcSoundPath.Right( mmcSoundPath.Length() - 1 ).AllocL();
 	}
 
-void CHarvesterOMADRMPlugin::HarvestL( CHarvesterData* aHD )
+void CHarvesterOMADRMPlugin::HarvestL( CHarvesterData* aHarvesterData )
 	{
-    CMdEObject& mdeObject = aHD->MdeObject();
-    CDRMHarvestData* fileData = CDRMHarvestData::NewL();
+	WRITELOG( "CHarvesterImagePlugin::HarvestL()" );
+    CMdEObject& mdeObject = aHarvesterData->MdeObject();
+	CDRMHarvestData* drmHarvestData = CDRMHarvestData::NewL();
+	CleanupStack::PushL( drmHarvestData );
+	
+    CFileData* fileData = CFileData::NewL();
     CleanupStack::PushL( fileData );
 
-    TRAPD( error, GatherDataL( mdeObject, *fileData ) );
-    if ( error == KErrNone || error == KErrCompletion )
-    	{
-        TBool isNewObject( mdeObject.Id() == 0 );
+    CHarvestData* harvestData = CHarvestData::NewL();
+    CleanupStack::PushL( harvestData );
         
-        if ( isNewObject || mdeObject.Placeholder() )
+    TInt errorCode( KErrNone );
+    
+    TRAPD( error, errorCode = GatherDataL( mdeObject, *drmHarvestData, *fileData, *harvestData ) );
+    
+    if ( error == KErrNone && (errorCode == KErrNone || errorCode == KErrCompletion ) ) // ok, something got harvested
+        {
+        if ( mdeObject.Id() == 0 || mdeObject.Placeholder() ) // is a new object or placeholder
             {
-            TRAP( error, HandleObjectPropertiesL( *aHD, *fileData, ETrue ) );
+            TRAP_IGNORE( HandleObjectPropertiesL( *harvestData,  *drmHarvestData, *fileData, *aHarvesterData, ETrue ) );
             mdeObject.SetPlaceholder( EFalse );
             }
-        else
+        else   // not a new object
             {
-            TRAP( error, HandleObjectPropertiesL( *aHD, *fileData, EFalse ) );
+            TRAP_IGNORE( HandleObjectPropertiesL( *harvestData, *drmHarvestData, *fileData, *aHarvesterData, EFalse ) );
             }
 
         if ( error != KErrNone )
@@ -189,21 +227,21 @@
     	}
     else	
         {
-        WRITELOG1( "CHarvesterOMADRMPlugin::HarvestL() - TRAP error: %d", error );
+        WRITELOG1( "CHarvesterOMADRMPlugin::HarvestL() - TRAP error: %d, errorCode %d", error );
         TInt convertedError = KErrNone;
         MdsUtils::ConvertTrapError( error, convertedError );
-        aHD->SetErrorCode( convertedError );
+        aHarvesterData->SetErrorCode( convertedError );
         }
 
-    CleanupStack::PopAndDestroy( fileData );
+    CleanupStack::PopAndDestroy( 3, drmHarvestData );
 	}
 
 // ---------------------------------------------------------------------------
 // GatherDataL
 // ---------------------------------------------------------------------------
 //
-void CHarvesterOMADRMPlugin::GatherDataL( CMdEObject& aMetadataObject,
-		CDRMHarvestData& aVHD )
+TInt CHarvesterOMADRMPlugin::GatherDataL( CMdEObject& aMetadataObject, CDRMHarvestData& aDRMharvestData, 
+        CFileData& aFileData, CHarvestData& /*aHarvestData*/ )
     {
     WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL" );
     
@@ -213,8 +251,8 @@
     const TDesC& uri = aMetadataObject.Uri();
     User::LeaveIfError( iFs.Entry( uri, *entry ) );
     
-    aVHD.iModified = entry->iModified;
-    aVHD.iFileSize = (TUint)entry->iSize;
+    aDRMharvestData.iModified = entry->iModified;
+    aDRMharvestData.iFileSize = (TUint)entry->iSize;
     CleanupStack::PopAndDestroy( entry );
     
     ContentAccess::CContent* content = ContentAccess::CContent::NewLC( uri );   
@@ -231,106 +269,126 @@
 
     User::LeaveIfError( data->GetStringAttributeSet(attrSet) );
     
-    TInt err = attrSet.GetValue( ContentAccess::EDescription, aVHD.iDescription );
+    TInt err = attrSet.GetValue( ContentAccess::EDescription, aDRMharvestData.iDescription );
     if ( err != KErrNone)
         {
         WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting description failed %d", err );
         }
         
-    if ( aVHD.iDescription.Length() <= 0 )
+    if ( aDRMharvestData.iDescription.Length() <= 0 )
         {
         WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no description" );
         }
     
-    err = attrSet.GetValue( ContentAccess::EMimeType, aVHD.iMimetype );
+    err = attrSet.GetValue( ContentAccess::EMimeType, aDRMharvestData.iMimetype );
     if ( err != KErrNone)
         {
         WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting mimetype failed %d", err );
         }
         
-    if ( aVHD.iMimetype.Length() <= 0 )
+    if ( aDRMharvestData.iMimetype.Length() <= 0 )
         {
         WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no mimetype" );
         }
     
-    err = attrSet.GetValue( ContentAccess::ETitle, aVHD.iTitle );
+    err = attrSet.GetValue( ContentAccess::ETitle, aDRMharvestData.iTitle );
     if ( err != KErrNone)
         {
         WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting title failed %d", err );
         }
         
-    if ( aVHD.iTitle.Length() <= 0 )
+    if ( aDRMharvestData.iTitle.Length() <= 0 )
         {
         WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no title" );
         }
     
-    err = attrSet.GetValue( ContentAccess::EAuthor, aVHD.iAuthor );
+    err = attrSet.GetValue( ContentAccess::EAuthor, aDRMharvestData.iAuthor );
     if ( err != KErrNone)
         {
         WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting author failed %d", err );
         }
         
-    if ( aVHD.iAuthor.Length() <= 0 )
+    if ( aDRMharvestData.iAuthor.Length() <= 0 )
         {
         WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no author" );
         }
 
-    err = attrSet.GetValue( ContentAccess::EGenre, aVHD.iGenre );
+    err = attrSet.GetValue( ContentAccess::EGenre, aDRMharvestData.iGenre );
     if ( err != KErrNone)
         {
         WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting genre failed %d", err );
         }
         
-    if ( aVHD.iGenre.Length() <= 0 )
+    if ( aDRMharvestData.iGenre.Length() <= 0 )
         {
         WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no genre" );
         }
     
-    err = content->GetAttribute( ContentAccess::EIsProtected, aVHD.iDrmProtected );
+    err = content->GetAttribute( ContentAccess::EIsProtected, aDRMharvestData.iDrmProtected );
     if ( err != KErrNone)
         {
         WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting protection info failed %d", err );
         }
-        
-    CleanupStack::PopAndDestroy( 3 ); // content, data, attrSet
+      
+    CImageDecoder* decoder = NULL;
+
+    TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, 
+            ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode )));
+
+    CleanupStack::PushL( decoder );
+    
+    if(decoder && !err)
+        {
+        WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." );        
+        // Get image width, frame count, height and bits per pixel from image decoder.
+        const TFrameInfo info = decoder->FrameInfo( 0 );
+        const TSize imageSize = info.iOverallSizeInPixels;
+        const TInt framecount = decoder->FrameCount();
+        aFileData.iFrameCount = framecount;
+        aFileData.iImageWidth = imageSize.iWidth;
+        aFileData.iImageHeight = imageSize.iHeight;
+        aFileData.iBitsPerPixel = info.iBitsPerPixel;
+        }
+    else
+        {
+        WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err );
+        }
+
+    CleanupStack::PopAndDestroy( 4 ); // content, data, attrSet, imagedecoder
+    return KErrNone;
     }
 
 // ---------------------------------------------------------------------------
 // HandleObjectPropertiesL
 // ---------------------------------------------------------------------------
 //
-void CHarvesterOMADRMPlugin::HandleObjectPropertiesL(
-		CHarvesterData& aHD,
-		CDRMHarvestData& aVHD,
-		TBool aIsAdd )
+void CHarvesterOMADRMPlugin::HandleObjectPropertiesL( CHarvestData& /*aHarvestData*/, CDRMHarvestData& aDRMharvestData, CFileData& aFileData, 
+        CHarvesterData& aHarvesterData, TBool aIsAdd )
     {
     WRITELOG("CHarvesterOMADRMPlugin - HandleNewObject ");
-    CMdEObject& mdeObject = aHD.MdeObject();
+    CMdEObject& mdeObject = aHarvesterData.MdeObject();
 
-    if( !iPropDefs )
-    	{
-    	CMdEObjectDef& objectDef = mdeObject.Def();
-    	iPropDefs = CHarvesterOmaDrmPluginPropertyDefs::NewL( objectDef );
-    	// Prefetch max text lengt for validity checking
-    	iMaxTextLength = iPropDefs->iGenrePropertyDef->MaxTextLengthL();
-    	}
+    InitPropDefsL( mdeObject.Def() );
     
     TTimeIntervalSeconds timeOffset = User::UTCOffset();
     
+    TPtrC objectDefName( mdeObject.Def().Name());
+    
     if( ! mdeObject.Placeholder() )
     	{
     	// Creation date
-    	TTime localTime = aVHD.iModified + timeOffset;
+    	TTime localTime = aDRMharvestData.iModified + timeOffset;
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     			*iPropDefs->iCreationDatePropertyDef, &localTime, aIsAdd );
     	// Last modified date
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-    			*iPropDefs->iLastModifiedDatePropertyDef, &aVHD.iModified, aIsAdd );
+    			*iPropDefs->iLastModifiedDatePropertyDef, &aDRMharvestData.iModified, aIsAdd );
     	// File size
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-    			*iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd );
+    			*iPropDefs->iSizePropertyDef, &aDRMharvestData.iFileSize, aIsAdd );
 
-    	TPtrC objectDefName( mdeObject.Def().Name() );
+    	TPtrC objectDefName( mdeObject.Def().Name());
+    	
         if( objectDefName == MdeConstants::Image::KImageObject )
             {
             const TDesC& uri = mdeObject.Uri();
@@ -381,7 +439,7 @@
     	}
         
     // Item Type
-    if(aVHD.iMimetype.Length() > 0)
+    if(aDRMharvestData.iMimetype.Length() > 0)
         {
         TBool isAdd( EFalse );
         CMdEProperty* prop = NULL;
@@ -391,36 +449,59 @@
             isAdd = ETrue;
             }
         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-                *iPropDefs->iItemTypePropertyDef, &aVHD.iMimetype, isAdd );
+                *iPropDefs->iItemTypePropertyDef, &aDRMharvestData.iMimetype, isAdd );
         }
     
     // DRM protection
     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-    		*iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd );
+    		*iPropDefs->iDrmPropertyDef, &aDRMharvestData.iDrmProtected, aIsAdd );
     
     // Title (is set from URI by default)
-    if( aVHD.iTitle.Length() > 0 && aVHD.iTitle.Length() < KMaxTitleFieldLength )
+    if( aDRMharvestData.iTitle.Length() > 0 && aDRMharvestData.iTitle.Length() < KMaxTitleFieldLength )
     	{
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-    			*iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse );
+    			*iPropDefs->iTitlePropertyDef, &aDRMharvestData.iTitle, EFalse );
     	}
     // Description
-    if( aVHD.iDescription.Length() > 0 && aVHD.iDescription.Length() < iMaxTextLength )
+    if( aDRMharvestData.iDescription.Length() > 0 && aDRMharvestData.iDescription.Length() < iMaxTextLength )
+    	{
+    	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
+    			*iPropDefs->iDescriptionPropertyDef, &aDRMharvestData.iDescription, aIsAdd );
+    	}   
+    // Author
+    if( aDRMharvestData.iAuthor.Length() > 0 && aDRMharvestData.iAuthor.Length() < iMaxTextLength )
     	{
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-    			*iPropDefs->iDescriptionPropertyDef, &aVHD.iDescription, aIsAdd );
-    	}   
-    // Author
-    if( aVHD.iAuthor.Length() > 0 && aVHD.iAuthor.Length() < iMaxTextLength )
-    	{
-    	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-    			*iPropDefs->iAuthorPropertyDef, &aVHD.iAuthor, aIsAdd );
+    			*iPropDefs->iAuthorPropertyDef, &aDRMharvestData.iAuthor, aIsAdd );
     	}
     // Genre
-    if( aVHD.iGenre.Length() > 0 && aVHD.iGenre.Length() < iMaxTextLength )
+    if( aDRMharvestData.iGenre.Length() > 0 && aDRMharvestData.iGenre.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
-                *iPropDefs->iGenrePropertyDef, &aVHD.iGenre, aIsAdd );
+                *iPropDefs->iGenrePropertyDef, &aDRMharvestData.iGenre, aIsAdd );
+        }
+    
+    if( objectDefName == MdeConstants::Image::KImageObject )
+        {
+      // Image - Bits per Sample
+        if (aFileData.iBitsPerPixel != 0)
+            {
+            CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iBitsPerSamplePropertyDef, &aFileData.iBitsPerPixel, aIsAdd );
+            }
+    
+        // Image - Framecount
+        CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iFrameCountPropertyDef, &aFileData.iFrameCount, aIsAdd );
+        
+        // MediaObject - Width
+        if (aFileData.iImageWidth != 0)
+            {
+            CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iWidthPropertyDef, &aFileData.iImageWidth, aIsAdd );
+            }
+        
+        if (aFileData.iImageHeight != 0)
+            {
+            CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iHeightPropertyDef, &aFileData.iImageHeight, aIsAdd );
+            } 
         }
     }
 
@@ -438,6 +519,7 @@
 		{
 		err = content->GetStringAttribute( ContentAccess::EMimeType, mime );
 		delete content;
+		content = NULL;
 		}
 
 #ifdef _DEBUG
@@ -558,6 +640,17 @@
         {
         err = content->GetStringAttribute( ContentAccess::EMimeType, aMimeType );
         delete content;
+        content = NULL;
         }
     }
 
+void CHarvesterOMADRMPlugin::InitPropDefsL( CMdEObjectDef& aObjectDef )
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        // Prefetch max text lengt for validity checking
+        iMaxTextLength = iPropDefs->iGenrePropertyDef->MaxTextLengthL();
+        }
+    }
+
--- a/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h	Wed Aug 18 10:12:07 2010 +0300
@@ -59,7 +59,8 @@
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterRtpPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+        static CHarvesterRtpPluginPropertyDefs* NewL();
+        void SetByObjectDefL( CMdEObjectDef& aObjectDef) ;
 	};
 
 /**
@@ -225,6 +226,8 @@
      
      /** */
      void HandleObjectPropertiesL( CHarvesterData& aHD, CHarvesterRtpClipDetails& aClipDetails, TBool aIsAdd);
+     
+     void InitPropDefsL( CMdEObjectDef& aObjectDef );
 
 private: // data
 	CHarvesterRtpPluginPropertyDefs* iPropDefs;
--- a/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpmetadatareader.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpmetadatareader.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -46,6 +46,7 @@
     {
     WRITELOG( "CHarvesterRtpMetaDataReader::~CHarvesterRtpMetaDataReader()" );
     delete iMetaData;
+    iMetaData = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -35,11 +35,24 @@
 // Enough size to recognize file and read metaheader
 const TInt KFileBufferSize( KMaxMetaHeaderLength );
 
-CHarvesterRtpPluginPropertyDefs::CHarvesterRtpPluginPropertyDefs() : CBase()
+CHarvesterRtpPluginPropertyDefs::CHarvesterRtpPluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
-void CHarvesterRtpPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
+void CHarvesterRtpPluginPropertyDefs::ConstructL( CMdEObjectDef& aObjectDef )
+    {
+    SetByObjectDefL( aObjectDef );
+    }
+
+CHarvesterRtpPluginPropertyDefs* CHarvesterRtpPluginPropertyDefs::NewL()
+    {
+    CHarvesterRtpPluginPropertyDefs* self = 
+        new (ELeave) CHarvesterRtpPluginPropertyDefs();
+    return self;
+    }
+
+void CHarvesterRtpPluginPropertyDefs::SetByObjectDefL( CMdEObjectDef& aObjectDef )
 	{
 	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
 	
@@ -61,16 +74,6 @@
 	iRecordingFlagsPropertyDef = &videoDef.GetPropertyDefL( MdeConstants::Video::KRecordingFlagsProperty );
 	}
 
-CHarvesterRtpPluginPropertyDefs* CHarvesterRtpPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterRtpPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterRtpPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
 // ======== MEMBER FUNCTIONS ========
 
 // ---------------------------------------------------------------------------
@@ -89,6 +92,7 @@
     {
     WRITELOG( "CHarvesterRtpPlugin::ConstructL()" );
     SetPriority( KHarvesterPriorityHarvestingPlugin - 1 );
+    iPropDefs = CHarvesterRtpPluginPropertyDefs::NewL();
     }
 
 // ---------------------------------------------------------------------------
@@ -262,12 +266,8 @@
     WRITELOG( "CHarvesterRtpPlugin::HandleObjectPropertiesL()" );
 
     CMdEObject& mdeObject = aHD.MdeObject();
-    
-    if( !iPropDefs )
-		{
-		CMdEObjectDef& objectDef = mdeObject.Def();
-		iPropDefs = CHarvesterRtpPluginPropertyDefs::NewL( objectDef );
-		}
+     
+    InitPropDefsL( mdeObject.Def() );
 
     TTimeIntervalSeconds timeOffset = User::UTCOffset();
     TTime localModifiedTime = aClipDetails.iModifiedDate + timeOffset;
@@ -340,3 +340,13 @@
     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     		*iPropDefs->iRecordingFlagsPropertyDef, &flags, aIsAdd );
     }
+
+void CHarvesterRtpPlugin::InitPropDefsL( CMdEObjectDef& aObjectDef )
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        }
+    }
+
+
--- a/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h	Wed Aug 18 10:12:07 2010 +0300
@@ -101,13 +101,20 @@
         ~CVideoHarvestData()
         	{
         	delete iCopyright;
+        	iCopyright = NULL;
             delete iAuthor;
+            iAuthor = NULL;
             delete iGenre;
+            iGenre = NULL;
             delete iPerformer;
+            iPerformer = NULL;
             delete iDescription;
+            iDescription = NULL;
             delete iTitle;
+            iTitle = NULL;
 
         	delete iMimeBuf;
+        	iMimeBuf = NULL;
         	}
     };
 
@@ -155,7 +162,8 @@
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterVideoPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+		static CHarvesterVideoPluginPropertyDefs* NewL();
+		void SetByObjectDefL( CMdEObjectDef& aObjectDef );
 	};
 
 class CHarvesterVideoPlugin : public CHarvesterPlugin
@@ -232,6 +240,8 @@
 		
 		void CheckForCodecSupport( HBufC* aMimeBuffer, CVideoHarvestData& aVHD );
 		
+        void InitPropDefsL( CMdEObjectDef& aObjectDef );
+
 	private:
 		RArray<THarvestingHandling> iMimeTypeMappings;
 		
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -85,58 +85,61 @@
 const TInt KKiloBytes = 1024;
 const TReal32 KThousandReal = 1000.0;
 
-CHarvesterVideoPluginPropertyDefs::CHarvesterVideoPluginPropertyDefs() : CBase()
+CHarvesterVideoPluginPropertyDefs::CHarvesterVideoPluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
 void CHarvesterVideoPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
 	{
-	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
-	
-	// Common property definitions
-	CMdEObjectDef& objectDef = nsDef.GetObjectDefL( Object::KBaseObject );
-	iCreationDatePropertyDef = &objectDef.GetPropertyDefL( Object::KCreationDateProperty );
-	iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( Object::KLastModifiedDateProperty );
-	iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty );
-	iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty );
-	iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty );
-	iTitlePropertyDef = &objectDef.GetPropertyDefL( Object::KTitleProperty );
-	iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder );
-
-	CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject );
-	iReleaseDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KReleaseDateProperty );
-	iCaptureDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCaptureDateProperty );
-	iDurationPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDurationProperty );
-	iWidthPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KWidthProperty );
-	iHeightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KHeightProperty );
-	iBitratePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KBitrateProperty );
-	iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCopyrightProperty );
-	iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KAuthorProperty );
-	iGenrePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KGenreProperty );
-	iArtistPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KArtistProperty );
-	iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDescriptionProperty );
-    iDrmPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDRMProperty );
-	
-	iAudioFourCCDef = &mediaDef.GetPropertyDefL( MediaObject::KAudioFourCCProperty );
-
-	// Video property definitions
-	CMdEObjectDef& videoDef = nsDef.GetObjectDefL( Video::KVideoObject );
-	iFrameratePropertyDef = &videoDef.GetPropertyDefL( Video::KFramerateProperty );
-
-	// Audio property definitions
-	CMdEObjectDef& audioDef = nsDef.GetObjectDefL( Audio::KAudioObject );
-	iSamplingFrequencyPropertyDef = &audioDef.GetPropertyDefL( Audio::KSamplingFrequencyProperty );
+    SetByObjectDefL( aObjectDef );
 	}
 
-CHarvesterVideoPluginPropertyDefs* CHarvesterVideoPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterVideoPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterVideoPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
+CHarvesterVideoPluginPropertyDefs* CHarvesterVideoPluginPropertyDefs::NewL()
+    {
+    CHarvesterVideoPluginPropertyDefs* self = 
+        new (ELeave) CHarvesterVideoPluginPropertyDefs();
+    return self;
+    }
+
+void CHarvesterVideoPluginPropertyDefs::SetByObjectDefL( CMdEObjectDef& aObjectDef )
+    {
+    CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
+    
+    // Common property definitions
+    CMdEObjectDef& objectDef = nsDef.GetObjectDefL( Object::KBaseObject );
+    iCreationDatePropertyDef = &objectDef.GetPropertyDefL( Object::KCreationDateProperty );
+    iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( Object::KLastModifiedDateProperty );
+    iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty );
+    iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty );
+    iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty );
+    iTitlePropertyDef = &objectDef.GetPropertyDefL( Object::KTitleProperty );
+    iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder );
+
+    CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject );
+    iReleaseDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KReleaseDateProperty );
+    iCaptureDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCaptureDateProperty );
+    iDurationPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDurationProperty );
+    iWidthPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KWidthProperty );
+    iHeightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KHeightProperty );
+    iBitratePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KBitrateProperty );
+    iCopyrightPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KCopyrightProperty );
+    iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KAuthorProperty );
+    iGenrePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KGenreProperty );
+    iArtistPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KArtistProperty );
+    iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDescriptionProperty );
+    iDrmPropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KDRMProperty );
+    
+    iAudioFourCCDef = &mediaDef.GetPropertyDefL( MediaObject::KAudioFourCCProperty );
+
+    // Video property definitions
+    CMdEObjectDef& videoDef = nsDef.GetObjectDefL( Video::KVideoObject );
+    iFrameratePropertyDef = &videoDef.GetPropertyDefL( Video::KFramerateProperty );
+
+    // Audio property definitions
+    CMdEObjectDef& audioDef = nsDef.GetObjectDefL( Audio::KAudioObject );
+    iSamplingFrequencyPropertyDef = &audioDef.GetPropertyDefL( Audio::KSamplingFrequencyProperty );
+    }
 
 /**
 * Default constructor
@@ -165,11 +168,14 @@
 CHarvesterVideoPlugin::~CHarvesterVideoPlugin()
 	{
 	delete iPropDefs;
+	iPropDefs = NULL;
 	iMimeTypeMappings.Close();
     RMediaIdUtil::ReleaseInstance();
 
     delete iPhoneVideosPath;
+    iPhoneVideosPath = NULL;
     delete iMmcVideosPath;
+    iMmcVideosPath = NULL;
     
 	WRITELOG("CHarvesterVideoPlugin::CHarvesterVideoPlugin()");
 	}
@@ -181,6 +187,8 @@
 	{
 	WRITELOG( "CHarvesterVideoPlugin::ConstructL() - begin" );
 	
+	iPropDefs = CHarvesterVideoPluginPropertyDefs::NewL();
+	
 	TLinearOrder< THarvestingHandling > cmp( THarvestingHandling::CompareFunction );
 
 	// MPEG4
@@ -548,22 +556,41 @@
     
     if( !dataExtracted )
         {
-        TEntry entry;
-        const TInt errorcode = iFs.Entry( uri, entry );
-        
-        if ( errorcode != KErrNone )
+        // If file could be opened, use file handle to fetch base data, otherwise
+        // attempt to fetch the data from TEntry 
+        if( error == KErrNone )
+            {
+            User::LeaveIfError( file.Modified( aVHD.iModified ) );
+            User::LeaveIfError( file.Size( aVHD.iFileSize ) );            
+            }
+        else
             {
-            WRITELOG1( "CHarvesterVideoPlugin - Error getting entry: %d", errorcode );
-            CleanupStack::PopAndDestroy( &file );
-            User::Leave( errorcode );
+            TEntry entry;
+            const TInt errorcode = iFs.Entry( uri, entry );
+        
+            if ( errorcode != KErrNone )
+                {
+                WRITELOG1( "CHarvesterVideoPlugin - Error getting entry: %d", errorcode );
+                CleanupStack::PopAndDestroy( &file );
+                User::Leave( errorcode );
+                }
+        
+            aVHD.iModified = entry.iModified;
+            aVHD.iFileSize = (TUint)entry.iSize;        
             }
         
-        aVHD.iModified = entry.iModified;
-        aVHD.iFileSize = (TUint)entry.iSize;
-        
         WRITELOG1( "CHarvesterVideoPlugin - File size: %d", aVHD.iFileSize );
         }
 
+    aVHD.iVideoObject = aMetadataObject.Def().Name().Compare( KVideo ) == 0;
+
+    if( error != KErrNone )
+        {
+        WRITELOG1( "CHarvesterVideoPlugin - File open error: %d", error );
+        CleanupStack::PopAndDestroy( &file );
+        User::Leave( KErrCompletion );
+        }
+    
     // now the minimum information has been harvested
     // from now on the harvested data should always be stored
 
@@ -574,15 +601,6 @@
     	CleanupStack::PopAndDestroy( &file );
     	User::Leave( KErrNotFound );
     	}
-
-    aVHD.iVideoObject = aMetadataObject.Def().Name().Compare( KVideo ) == 0;
-
-    if( error != KErrNone )
-        {
-        WRITELOG1( "CHarvesterVideoPlugin - File open error: %d", error );
-        CleanupStack::PopAndDestroy( &file );
-        User::Leave( KErrCompletion );
-        }
     
     if ( mapping->iHandler.iLibrary == TVideoMetadataHandling::EHexilMetadataHandling )
     	{
@@ -591,10 +609,10 @@
     	CleanupClosePushL( mimes );
 
         TPtrC ext;
-        MdsUtils::GetExt( uri, ext );
+        const TBool exists = MdsUtils::GetExt( uri, ext );
         
         // Check for possibly protected content
-        if( ext.CompareF( KExtensionWmv ) == 0 )
+        if( exists && ext.CompareF( KExtensionWmv ) == 0 )
             {
             ContentAccess::CContent* content = ContentAccess::CContent::NewLC( uri );
             ContentAccess::CData* data = content->OpenContentLC( ContentAccess::EPeek );
@@ -607,6 +625,9 @@
         CleanupStack::PushL( helixMetadata );
         
         TRAP( error, helixMetadata->OpenFileL( file ) );        
+
+        // No need for the file handle anymore so closing it
+        file.Close();
         
         if ( error == KErrNone )
         	{
@@ -789,6 +810,7 @@
         	aVHD.iMimeBuf = mime.Alloc();
         	}
         
+        helixMetadata->ResetL();
         CleanupStack::PopAndDestroy( helixMetadata );
         
         // don't destory mime type pointers just clean array
@@ -982,14 +1004,8 @@
     WRITELOG("CHarvesterVideoPlugin::HandleObjectPropertiesL ");
 
     CMdEObject& mdeObject = aHD.MdeObject();
-
-    if( !iPropDefs )
-    	{
-    	CMdEObjectDef& objectDef = mdeObject.Def();
-    	iPropDefs = CHarvesterVideoPluginPropertyDefs::NewL( objectDef );
-    	// Prefetch max text lengt for validity checking
-    	iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
-    	}
+    
+    InitPropDefsL( mdeObject.Def() );
 
     TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
     TTime localModifiedDate = aVHD.iModified + timeOffsetSeconds;
@@ -1217,9 +1233,6 @@
 	{
 	TBool possibleVideo = EFalse;
 
-	CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL();
-	CleanupStack::PushL( helixMetadata );
-
     TFileName tempName;
     TUint32 mediaId( 0 );
     TInt blackListError( KErrNone );
@@ -1227,9 +1240,12 @@
     blackListError = GetFileFullNameAndMediaId( aFile, tempName, mediaId );
     if( blackListError == KErrNone )
         {
-        AddFileToBlackList( tempName, mediaId );
+        blackListError = AddFileToBlackList( tempName, mediaId );
         }
 	
+    CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL();
+    CleanupStack::PushL( helixMetadata );
+    
 	TRAPD( err, helixMetadata->OpenFileL( aFile ) );
 
 	if( err == KErrNone )
@@ -1313,13 +1329,15 @@
 		{
 		aType.Copy( KVideo );
 		}
+
+	helixMetadata->ResetL();
+    CleanupStack::PopAndDestroy( helixMetadata );
 	
     if( blackListError == KErrNone )
         {
         RemoveFileFromBlackList( tempName, mediaId );
         }
     
-    CleanupStack::PopAndDestroy( helixMetadata );
 	}
 
 TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId )
@@ -1331,7 +1349,7 @@
     if( blackListError == KErrNone )
         {
         WRITELOG( "CHarvesterVideoPlugin::AddFileToBlackList - Adding URI to blacklist" );
-        iBlacklist->AddFile( aFullName, aMediaId, modified );
+        blackListError = iBlacklist->AddFile( aFullName, aMediaId, modified );
         }
 
     return blackListError;
@@ -1429,5 +1447,15 @@
     return;
     }
 
+void CHarvesterVideoPlugin::InitPropDefsL(CMdEObjectDef& aObjectDef)
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        // Prefetch max text lengt for validity checking
+        iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL();
+        }
+    }
+
 // End of file
 
--- a/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h	Wed Aug 18 10:12:07 2010 +0300
@@ -55,7 +55,8 @@
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterWmvPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+	    static CHarvesterWmvPluginPropertyDefs* NewL();
+	    void SetByObjectDefL( CMdEObjectDef& aObjectDef );
 	};
 
 /**
@@ -180,6 +181,7 @@
          CHarvesterWmvClipDetails& aClipDetails,
          TBool aIsAdd);
 
+    void InitPropDefsL( CMdEObjectDef& aObjectDef );
 
 private: // data
 	CHarvesterWmvPluginPropertyDefs* iPropDefs;
--- a/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -31,11 +31,24 @@
 #include "mdetextproperty.h"
 #include "mdeobjectwrapper.h"
 
-CHarvesterWmvPluginPropertyDefs::CHarvesterWmvPluginPropertyDefs() : CBase()
+CHarvesterWmvPluginPropertyDefs::CHarvesterWmvPluginPropertyDefs() : CBase(),
+    iCreationDatePropertyDef( NULL )
 	{
 	}
 
-void CHarvesterWmvPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
+void CHarvesterWmvPluginPropertyDefs::ConstructL( CMdEObjectDef& aObjectDef )
+    {
+    SetByObjectDefL( aObjectDef );
+    }
+
+CHarvesterWmvPluginPropertyDefs* CHarvesterWmvPluginPropertyDefs::NewL()
+    {
+    CHarvesterWmvPluginPropertyDefs* self = 
+        new (ELeave) CHarvesterWmvPluginPropertyDefs();
+    return self;
+    }
+
+void CHarvesterWmvPluginPropertyDefs::SetByObjectDefL( CMdEObjectDef& aObjectDef )
 	{
 	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
 	
@@ -55,16 +68,6 @@
     iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
 	}
 
-CHarvesterWmvPluginPropertyDefs* CHarvesterWmvPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterWmvPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterWmvPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
 // ======== MEMBER FUNCTIONS ========
 
 // ---------------------------------------------------------------------------
@@ -89,9 +92,12 @@
     {
     WRITELOG( "CHarvesterWMVPlugin::~CHarvesterWMVPlugin()" );
     delete iPropDefs;
+    iPropDefs = NULL;
     
     delete iPhoneVideosPath;
+    iPhoneVideosPath = NULL;
     delete iMmcVideosPath;
+    iMmcVideosPath = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -151,6 +157,7 @@
         {
         err = content->GetStringAttribute( ContentAccess::EMimeType, aMimeType );
         delete content;
+        content = NULL;
         }
     }
 
@@ -170,6 +177,8 @@
     {
     WRITELOG( "CHarvesterWMVPlugin::ConstructL()" );
     
+    iPropDefs = CHarvesterWmvPluginPropertyDefs::NewL();
+    
     TFileName videos = PathInfo::VideosPath();
     
     TFileName phonePath = PathInfo::PhoneMemoryRootPath();
@@ -294,13 +303,7 @@
     
     CMdEObject& mdeObject = aHD.MdeObject();
     
-    if( !iPropDefs )
-		{
-		CMdEObjectDef& objectDef = mdeObject.Def();
-		iPropDefs = CHarvesterWmvPluginPropertyDefs::NewL( objectDef );
-		// Prefetch max text lengt for validity checking
-		iMaxTextLength = iPropDefs->iGenrePropertyDef->MaxTextLengthL();
-		}
+    InitPropDefsL( mdeObject.Def() );
     
     if( ! mdeObject.Placeholder() )
     	{
@@ -366,3 +369,13 @@
         }   
     }
 
+void CHarvesterWMVPlugin::InitPropDefsL(CMdEObjectDef& aObjectDef)
+    {
+    if( !iPropDefs->iCreationDatePropertyDef )
+        {
+        iPropDefs->SetByObjectDefL( aObjectDef );
+        // Prefetch max text lengt for validity checking
+        iMaxTextLength = iPropDefs->iGenrePropertyDef->MaxTextLengthL();
+        }
+    }
+
--- a/harvester/monitorplugins/fileplugin/group/filemonitorplugin.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/group/filemonitorplugin.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -59,6 +59,7 @@
 LIBRARY		  harvesterdata.lib
 LIBRARY       harvestercommon.lib 
 LIBRARY       centralrepository.lib
+LIBRARY       platformenv.lib 
 
 OPTION ARMCC -O3 -OTime
 
--- a/harvester/monitorplugins/fileplugin/inc/fileeventhandlerao.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/inc/fileeventhandlerao.h	Wed Aug 18 10:12:07 2010 +0300
@@ -172,11 +172,13 @@
         void ReadCacheSizeFromCenrepL();
 
         /**
-        * Set MdE object's title with aNewUrl
+        * Update MDS objects data if needed
         */
        void SetTitleL( CMdEObject* aOldObject, const TDesC& aNewUrl );
        
        void SetModifiedTimeL( CMdEObject* aOldObject, const TDesC& aNewUrl );
+       
+       void CheckDefaultFolderL( CMdEObject* aOldObject );
         
     private:
         
@@ -237,6 +239,16 @@
         CMdEPropertyDef* iOriginPropertyDef;
         CMdEPropertyDef* iTitlePropertyDef;
         CMdEPropertyDef* iTimePropertyDef;
+        CMdEPropertyDef* iDefaultFolderPropertyDef;
+        
+        HBufC* iPhoneImagesPath;
+        HBufC* iMmcImagesPath;
+        
+        HBufC* iPhoneVideosPath;
+        HBufC* iMmcVideosPath;
+        
+        HBufC* iPhoneSoundsPath;
+        HBufC* iMmcSoundsPath;
     };
 
 #endif // __FILEEVENTHANDLERAO_H__
--- a/harvester/monitorplugins/fileplugin/src/FolderRenamer.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/FolderRenamer.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -38,7 +38,9 @@
 CRenameItem::~CRenameItem()
 	{
 	delete iOldName;
+	iOldName = NULL;
 	delete iNewName;
+	iNewName = NULL;
 	iFileEvents.ResetAndDestroy();
 	}
 	
@@ -63,9 +65,14 @@
 	{
 	TMdsFSPStatus* event = NULL;
 	event = new TMdsFSPStatus(aEvent);
+	
 	if (event)
 		{
-		iFileEvents.Append(event);
+		if(iFileEvents.Append(event) != KErrNone)
+		    {
+            delete event;
+            event = NULL;
+		    }
 		}
 	}
 
@@ -157,7 +164,10 @@
 			iRenamedFolders.Remove(0);
 			TRAP_IGNORE(currItem->HandleFileEventsL(iCFileEventHandlerAO));
 			delete currItem;
+			currItem = NULL;
+			
 			SetNextRequest(ERenameStateIdle);
+			
 			if (iRenamedFolders.Count() == 0)
 				{
 				iIsRunning = EFalse;
--- a/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -16,6 +16,7 @@
 
 #include <collate.h>
 #include <mdeobject.h>
+#include <pathinfo.h>
 
 #include "fileeventhandlerao.h"
 #include "harvesterlog.h"
@@ -83,12 +84,46 @@
     User::LeaveIfError( error );
     
     TRAP( error, ReadCacheSizeFromCenrepL() );
+	
     if ( error == KErrNone )
     	{
     	iQueue.Reserve( iCacheSize );
     	}
     
     iEventArray = new (ELeave) CArrayFixSeg< TMdsFSPStatus >( KMaxEventsGranularity );
+    
+    TFileName phoneRoot = PathInfo::PhoneMemoryRootPath();
+    TFileName mmcRoot = PathInfo::MemoryCardRootPath();
+    
+    TFileName images = PathInfo::ImagesPath();
+    
+    TFileName phoneImagePath( phoneRoot );
+    phoneImagePath.Append( images );
+    iPhoneImagesPath = phoneImagePath.AllocL();
+
+    TFileName mmcImagePath( mmcRoot );
+    mmcImagePath.Append( images );
+    iMmcImagesPath = mmcImagePath.Right( mmcImagePath.Length() - 1 ).AllocL();
+    
+    TFileName videos = PathInfo::VideosPath();
+    
+    TFileName phoneVideoPath( phoneRoot );
+    phoneVideoPath.Append( videos );
+    iPhoneVideosPath = phoneVideoPath.AllocL();
+
+    TFileName mmcVideoPath( mmcRoot );
+    mmcVideoPath.Append( videos );
+    iMmcVideosPath = mmcVideoPath.Right( mmcVideoPath.Length() - 1 ).AllocL();
+    
+    TFileName sounds = PathInfo::SoundsPath();
+    
+    TFileName phoneSoundPath( phoneRoot );
+    phoneSoundPath.Append( sounds );
+    iPhoneSoundsPath = phoneSoundPath.AllocL();
+
+    TFileName mmcSoundPath( mmcRoot );
+    mmcSoundPath.Append( sounds );
+    iMmcSoundsPath = mmcSoundPath.Right( mmcSoundPath.Length() - 1 ).AllocL();
     }
 
 // ---------------------------------------------------------------------------
@@ -104,16 +139,37 @@
     iFs.Close();
     
     delete iMapper;
+    iMapper = NULL;
+    
     delete iMoveTimer;
+    iMoveTimer = NULL;
+    
     delete iFolderRenamer;
+    iFolderRenamer = NULL;
     
     delete iEventArray;
+    iEventArray = NULL;
     
     iQueue.ResetAndDestroy();
     iQueue.Close();
 	
     iUriArray.ResetAndDestroy();
     iUriArray.Close();
+    
+    delete iPhoneImagesPath;
+	iPhoneImagesPath = NULL;
+    delete iMmcImagesPath;
+	iMmcImagesPath = NULL;
+    
+    delete iPhoneVideosPath;
+	iPhoneVideosPath = NULL;
+    delete iMmcVideosPath;
+	iMmcVideosPath = NULL;
+    
+    delete iPhoneSoundsPath;
+	iPhoneSoundsPath = NULL;
+    delete iMmcSoundsPath;
+	iMmcSoundsPath = NULL;
     }
 
 
@@ -146,6 +202,7 @@
     			ResetEvent();
     			item->GetAsFspStatus(iEvent);
     			delete item;
+    			item = NULL;
     			
     			if( iEvent.iFileEventType == EMdsFileDeleted )
     			    {
@@ -441,6 +498,7 @@
         		newObject->Id() );
         if ( removedId != KNoId )
         	{
+            SetTitleL( oldObject , aNewUrl );
 	        oldObject->SetUriL( aNewUrl );
 	        TUint32 mediaId = FSUtil::MediaID( iFs, aNewUrl );
 	        oldObject->SetMediaId( mediaId );
@@ -454,6 +512,7 @@
 
     if ( oldObject )
         {
+        CheckDefaultFolderL( oldObject );
         SetModifiedTimeL( oldObject, aNewUrl );
         TOrigin origin = OriginFromMdEObjectL( *oldObject );
         if( origin == MdeConstants::Object::EOther)
@@ -631,8 +690,10 @@
                     CleanupStack::PushL( oldObject );
                     SetTitleL( oldObject , aNewUrl );
         	        oldObject->SetUriL( aNewUrl );
+        	        CheckDefaultFolderL( oldObject );
         	        TUint32 mediaId = FSUtil::MediaID( iFs, aNewUrl );
         	        oldObject->SetMediaId( mediaId );
+        	        SetModifiedTimeL( oldObject, aNewUrl );
         	        TOrigin origin = OriginFromMdEObjectL( *oldObject );
         	        if( origin == MdeConstants::Object::EOther)
         	        	{
@@ -653,6 +714,7 @@
                 CleanupStack::PushL( oldObject );
                 SetTitleL( oldObject , aNewUrl );
     	        oldObject->SetUriL( aNewUrl );
+    	        CheckDefaultFolderL( oldObject );
     	        TUint32 mediaId = FSUtil::MediaID( iFs, aNewUrl );
     	        oldObject->SetMediaId( mediaId );
     	        SetModifiedTimeL( oldObject, aNewUrl );
@@ -973,3 +1035,60 @@
         }
     }
 
+//---------------------------------------------------------------------------
+// CFileEventHandlerAO::CheckDefaultFolderL()
+// ---------------------------------------------------------------------------
+//   
+void CFileEventHandlerAO::CheckDefaultFolderL( CMdEObject* aOldObject )
+    {
+    if( !iDefaultFolderPropertyDef )
+        {
+        iDefaultFolderPropertyDef = &aOldObject->Def().GetPropertyDefL( 
+                       MdeConstants::Object::KInDefaultFolder );
+        }
+    
+    CMdEProperty* folderProp = NULL;
+    aOldObject->Property( *iDefaultFolderPropertyDef, folderProp );
+    
+    TBool inDefaultFolder( EFalse );
+    TPtrC objectDefName( aOldObject->Def().Name() );
+    if( objectDefName == MdeConstants::Image::KImageObject )
+        {
+        const TDesC& uri = aOldObject->Uri();
+        if( uri.FindF( iMmcImagesPath->Des()) != KErrNotFound ||
+            uri.FindF( iPhoneImagesPath->Des()) != KErrNotFound ||
+            uri.FindF( KDCIMFolder ) != KErrNotFound )
+            {
+            inDefaultFolder = ETrue; 
+            }    
+        }
+    else if( objectDefName == MdeConstants::Video::KVideoObject )
+        {
+        const TDesC& uri = aOldObject->Uri();
+        if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound ||
+            uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound ||
+            uri.FindF( KDCIMFolder ) != KErrNotFound )
+            {
+            inDefaultFolder = ETrue; 
+            }    
+        }
+    else if( objectDefName == MdeConstants::Audio::KAudioObject )
+        {
+        const TDesC& uri = aOldObject->Uri();
+        if( uri.FindF( iMmcSoundsPath->Des()) != KErrNotFound ||
+            uri.FindF( iPhoneSoundsPath->Des()) != KErrNotFound )
+            {
+            inDefaultFolder = ETrue;
+            } 
+        }
+
+    if( folderProp )
+        {
+        folderProp->SetBoolValueL( inDefaultFolder );
+        }
+    else
+        {
+        aOldObject->AddBoolPropertyL( *iDefaultFolderPropertyDef, inDefaultFolder );
+        }
+    }
+
--- a/harvester/monitorplugins/fileplugin/src/filemonitorao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/filemonitorao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -71,6 +71,7 @@
     StopMonitoring();
 
     delete iMdeSession;
+    iMdeSession = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/harvester/monitorplugins/fileplugin/src/filemonitorplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/filemonitorplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -40,6 +40,7 @@
 CFileMonitorPlugin::~CFileMonitorPlugin() 
 	{
 	delete iFileMonitor;
+	iFileMonitor = NULL;
 	}
 
 // ---------------------------------------------------------------------------
@@ -67,6 +68,7 @@
 			TRAP( err, cenRepoUtil->AddIgnorePathsToFspL( KDrive, KMonitorPath ));
 			}
 		delete cenRepoUtil;
+		cenRepoUtil = NULL;
 		}
 	return success && err == KErrNone;
 	}
--- a/harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -59,6 +59,7 @@
 CProcessOriginMapper::~CProcessOriginMapper()
     {
     delete iLineBuffer;
+    iLineBuffer = NULL;
     iProcessOriginMap.Close();
     iReadStream.Close();
     iWriteStream.Close();
--- a/harvester/monitorplugins/inc/mdsfspqueue.inl	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/inc/mdsfspqueue.inl	Wed Aug 18 10:12:07 2010 +0300
@@ -15,7 +15,7 @@
 */
 
 
-#include "mdsfspqueue.h"
+
 
 //-----------------------------------------------------------------------------
 // CMdsFSPQueueItem::NewL()
@@ -67,10 +67,13 @@
 	if( iFileName ) 
 		{
 		delete iFileName;
+		iFileName = NULL;
 		}
+	
 	if( iNewFileName )
 		{
 		delete iNewFileName;
+		iNewFileName = NULL;
 		}
 	
 	iFileName = aStatus.iFileName.AllocL();
@@ -85,6 +88,8 @@
 CMdsFSPQueueItem::~CMdsFSPQueueItem()
 	{
 	delete iFileName;
+	iFileName = NULL;
 	delete iNewFileName;
+	iNewFileName = NULL;
 	}
-    
\ No newline at end of file
+    
--- a/harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -339,6 +339,7 @@
             		  {
             			fileEventType = EMdsFileCreated;
             			delete iCreatedFiles[i];
+            			iCreatedFiles[i] = NULL;
             			iCreatedFiles.Remove( i );
             			
 						//Have to check whether file has been hidden          			
@@ -433,6 +434,7 @@
                     if ( MdsUtils::Compare( iFileName, *(iModifiedFiles[i]) ) == 0 )
                       {
                         delete iModifiedFiles[i];
+                        iModifiedFiles[i] = NULL;
                         iModifiedFiles.Remove( i );
                         found = ETrue;
                         }
--- a/harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -64,7 +64,9 @@
 	{
 	WRITELOG("ENTER ~CMessageMonitorPlugin");
     delete iMsvSession;
+    iMsvSession = NULL;
     delete iMessageScannerAO;
+    iMessageScannerAO = NULL;
 	WRITELOG("END ~CMessageMonitorPlugin");	
 	}
 
@@ -465,6 +467,7 @@
 		
 		iMdeSession->AddEventL( *event );
 		delete event;
+		event = NULL;
     	}
     
     WRITELOG( "CMessageMonitorPlugin::RemoveObjectL return" );
--- a/harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h	Wed Aug 18 10:12:07 2010 +0300
@@ -46,8 +46,8 @@
 		static CMMCMountTaskAO* NewL();	
 		virtual ~CMMCMountTaskAO();
 		
-		void StartMount( TMountData& aMountData );
-		void StartUnmount( TMountData& aMountData );
+		void StartMountL( TMountData& aMountData );
+		void StartUnmountL( TMountData& aMountData );
 		void SetMonitorObserver( MMonitorPluginObserver& aObserver );
 		void SetMdeSession( CMdEHarvesterSession* aSession );
 		void SetHarvesterPluginFactory( CHarvesterPluginFactory* aPluginFactory );
--- a/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -94,7 +94,7 @@
 	
 	CleanupResetAndDestroyPushL( aEntryArray );
 	
-	CDesCArrayFlat* path = new(ELeave) CDesCArrayFlat( 10 );
+	CDesCArrayFlat* path = new(ELeave) CDesCArrayFlat( 30 );
 	CleanupStack::PushL( path );
 	TFileName firstPath;
 	firstPath.Copy( aDrivePath );
--- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -60,21 +60,26 @@
     	{
     	iMMCMonitor->StopMonitoring();
     	delete iMMCMonitor;
+    	iMMCMonitor = NULL;
     	}
     
 	if (iUsbMonitor)
     	{
     	iUsbMonitor->StopMonitoring();
     	delete iUsbMonitor;
+    	iUsbMonitor = NULL;
     	}
     
 	if (iMountTask)
     	{
     	delete iMountTask;
+    	iMountTask = NULL;
     	}
 	
 	delete iMmcScanner;
+	iMmcScanner = NULL;
 	delete iHddScanner;
+	iHddScanner = NULL;
 	
 	iFs.Close();
     }
@@ -219,6 +224,7 @@
 
     TMountData* mountData = NULL;
     mountData = new TMountData;
+    
     if ( !mountData )
         {
         return;
@@ -248,7 +254,56 @@
             {
             WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EMounted" );
             mountData->iMountType = TMountData::EMount;
-            iMountTask->StartMount( *mountData );
+            
+            // If mass storage mounting was delayed in boot so that mount event
+            // occures in mmc monitor, update the mass storage media id in the
+            // db in case factory settings were reseted and mass storage formatted
+            TInt drive( -1 );
+            TInt internalMassStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) );
+            if( internalMassStorageError == KErrNone )
+                {
+                TVolumeInfo internalMassStorageVolumeInfo;
+                internalMassStorageError = iFs.Volume( internalMassStorageVolumeInfo, drive );
+                if( internalMassStorageError == KErrNone )
+                    {
+                    const TUint32 massStorageMediaId( internalMassStorageVolumeInfo.iUniqueID );
+                    TUint32 mmcMediaId( 0 );
+                    TInt mmcError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ) );
+                    if( mmcError == KErrNone )
+                        {
+                        TVolumeInfo mmcVolumeInfo;
+                        mmcError = iFs.Volume( mmcVolumeInfo, drive );
+                        if( mmcError == KErrNone )
+                            {
+                            mmcMediaId = mmcVolumeInfo.iUniqueID;
+                            }
+                        }
+                    
+                    // If removable storage is not found, assume internal mass storage was mounted
+                    if( mmcError )
+                        {
+                        if( massStorageMediaId != 0 && 
+                            massStorageMediaId == aMediaID )
+                            {
+                            iMdEClient->CheckMassStorageMediaId( massStorageMediaId );
+                            }                    
+                        }
+                    else if( massStorageMediaId != mmcMediaId && 
+                                massStorageMediaId != 0 && 
+                                massStorageMediaId == aMediaID )
+                        {
+                        iMdEClient->CheckMassStorageMediaId( massStorageMediaId );
+                        }          
+                    }
+                }
+            
+            TRAPD(err, iMountTask->StartMountL( *mountData ))
+			
+            if(err != KErrNone )
+                {
+                delete mountData;
+                mountData = NULL;
+                }
             }
         break;
         
@@ -262,7 +317,13 @@
             	{
 	            WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EDismounted" );
 	            mountData->iMountType = TMountData::EUnmount;
-	            iMountTask->StartUnmount( *mountData );
+	            TRAPD(err, iMountTask->StartUnmountL( *mountData ));
+	            
+	            if(err != KErrNone )
+	                {
+	                delete mountData;
+	                mountData = NULL;
+	                }
             	}
             else
                 {
@@ -276,7 +337,13 @@
             {
             WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EFormatted" );
             mountData->iMountType = TMountData::EFormat;
-            iMountTask->StartUnmount( *mountData );
+            TRAPD(err, iMountTask->StartUnmountL( *mountData ));
+			
+            if(err != KErrNone)
+                {
+                delete mountData;
+                mountData = NULL;
+                }
             }
         break;
         
--- a/harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -79,6 +79,7 @@
 	iHarvestEntryArray.Close();
 	
 	delete iMdeSession;
+	iMdeSession = NULL;
   
 	Deinitialize();
 	
@@ -88,6 +89,7 @@
 		}
 	
 	delete iMmcFileList;
+	iMmcFileList = NULL;
 	iHdArray.ResetAndDestroy();
 	iHdArray.Close();
 	}
@@ -108,17 +110,19 @@
 	iHarvesterPluginFactory = aPluginFactory;
 	}
 	
-void CMMCMountTaskAO::StartMount( TMountData& aMountData )
+void CMMCMountTaskAO::StartMountL( TMountData& aMountData )
 	{
 	WRITELOG("CMMCMountTaskAO::StartMount");
-	iMountDataQueue.Append( &aMountData );
+	
+	User::LeaveIfError( iMountDataQueue.Append( &aMountData ));
+	
 	if ( iNextRequest == ERequestIdle )
 		{
 		SetNextRequest( ERequestStartTask );
 		}
 	}
 	
-void CMMCMountTaskAO::StartUnmount(TMountData& aMountData)
+void CMMCMountTaskAO::StartUnmountL(TMountData& aMountData)
 	{
 	WRITELOG("CMMCMountTaskAO::StartUnmount");
 	
@@ -132,7 +136,8 @@
 			}
 		}
 		
-	iMountDataQueue.Append( &aMountData );
+	User::LeaveIfError( iMountDataQueue.Append( &aMountData ));
+		
 	SetNextRequest( ERequestStartTask );
 	}
 	
@@ -146,7 +151,10 @@
 		{
 		if ( iMountData )
 			{
-			iMountDataQueue.Insert( iMountData, 0 );
+			if( iMountDataQueue.Insert( iMountData, 0 ) != KErrNone)
+			    {
+                delete iMountData;
+			    }
 			iMountData = NULL;
 			}
 		Deinitialize();
@@ -205,7 +213,11 @@
 			TRAPD( err, iMmcFileList->BuildFileListL( iFs, iMountData->iDrivePath, iEntryArray ));
 			if ( err == KErrNoMemory )
 				{
-				iMountDataQueue.Insert( iMountData, 0 );
+				if( iMountDataQueue.Insert( iMountData, 0 ) != KErrNone)
+				    {
+                    delete iMountData;
+				    }
+					
 				iMountData = NULL;
 				Deinitialize();
 				SetNextRequest( ERequestStartTask );
@@ -284,9 +296,14 @@
 					{
 					if( err == KErrNoMemory )
 						{
-						iMountDataQueue.Insert( iMountData, 0 );
+						if(iMountDataQueue.Insert( iMountData, 0 ) != KErrNone)
+						    {
+                            delete iMountData;
+						    }
+							
 						iMountData = NULL;
 						}
+						
 					Deinitialize();
 					SetNextRequest( ERequestStartTask );
 					break;
@@ -437,6 +454,7 @@
 			hd->SetEventType( EHarvesterEdit );
 			hd->SetObjectType( ENormal );
 			delete ei;
+			ei = NULL;
 			}
 		else
 			{
@@ -445,7 +463,12 @@
 			hd->SetClientData( ei );
 			}
 		
-		iHdArray.Append( hd );
+		if(iHdArray.Append( hd ) != KErrNone )
+		    {
+            delete hd;
+            hd = NULL;
+		    }
+			
 		aArray.Remove( i );
 		}
 	
--- a/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -82,6 +82,7 @@
 	// Delete instance variables if any
 	
 	delete iMmcFileList;
+	iMmcFileList = NULL;
 	
 	iEntryArray.ResetAndDestroy();
 	iEntryArray.Close();
@@ -248,6 +249,7 @@
 			hd->SetEventType( EHarvesterEdit );
 			hd->SetObjectType( ENormal );
 			delete ei;
+			ei = NULL;
 			}
 		else
 			{
@@ -255,7 +257,12 @@
 			hd->SetObjectType( EPlaceholder );
 			hd->SetClientData( ei );
 			}
-		iHdArray.Append( hd );
+			
+		if(iHdArray.Append( hd ) != KErrNone )
+		    {
+            delete hd;
+            hd = NULL;
+		    }
         iHarvestEntryArray.Remove( i );
         }
 
--- a/harvester/monitorplugins/monitorplugininterface/group/monitorplugininterface.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/monitorplugins/monitorplugininterface/group/monitorplugininterface.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -43,7 +43,7 @@
 
 #if defined(WINS)
     deffile ../bwincw/monitorplugininterfacewinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/monitorplugininterfacearm.def
 #endif
 nostrictdef
--- a/harvester/server/inc/harvesterao.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/inc/harvesterao.h	Wed Aug 18 10:12:07 2010 +0300
@@ -74,7 +74,8 @@
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterAoPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+        static CHarvesterAoPropertyDefs* NewL();
+        void SetByObjectDefL( CMdEObjectDef& aObjectDef );
 	};
 
 /**
@@ -555,8 +556,6 @@
         
         CHarvesterAoPropertyDefs* iPropDefs;
         
-        TBool iMassMemoryIdChecked;
-        
         // Own.
         CDesCArray* iCameraExtensionArray;
 
--- a/harvester/server/src/harvesterao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/harvesterao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -53,6 +53,7 @@
 
 const TInt KPlaceholderQueueSize = 99;
 const TInt KContainerPlaceholderQueueSize = 10;
+const TInt KReadyPlaceholderQueueSize = 10;
 const TInt KObjectDefStrSize = 20;
 
 _LIT( KTAGDaemonName, "ThumbAGDaemon" );
@@ -76,32 +77,34 @@
 
 void CHarvesterAoPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef)
 	{
-	CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
-
-	// Common property definitions
-	CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
-	iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
-	iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
-	iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
-	iOriginPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KOriginProperty );
-	iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
-	iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-	iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder );
-	
-	CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
-	iPreinstalledPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KPreinstalledProperty );
+    SetByObjectDefL( aObjectDef );
 	}
 
-CHarvesterAoPropertyDefs* CHarvesterAoPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterAoPropertyDefs* self = 
-		new (ELeave) CHarvesterAoPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
+CHarvesterAoPropertyDefs* CHarvesterAoPropertyDefs::NewL()
+    {
+    CHarvesterAoPropertyDefs* self = 
+        new (ELeave) CHarvesterAoPropertyDefs();
+    return self;
+    }
+
+void CHarvesterAoPropertyDefs::SetByObjectDefL(CMdEObjectDef& aObjectDef)
+    {
+    CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef();
 
+    // Common property definitions
+    CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
+    iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
+    iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
+    iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
+    iOriginPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KOriginProperty );
+    iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
+    iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
+    iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder );
+    
+    CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
+    iPreinstalledPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KPreinstalledProperty );
+    }
+	
 // ---------------------------------------------------------------------------
 // NewLC
 // ---------------------------------------------------------------------------
@@ -186,14 +189,18 @@
     DeleteComposers();
 
     delete iDiskFullNotifier;
+    iDiskFullNotifier = NULL;
 	delete iBackupSubscriber;
+	iBackupSubscriber = NULL;
     
     if (iBlacklist)
 		{
 		iBlacklist->CloseDatabase();
 		delete iBlacklist;
+		iBlacklist = NULL;
 		}
 	delete iReHarvester;
+	iReHarvester = NULL;
 
     if ( iHarvestFileMessages.Count() > 0 )
         {
@@ -222,26 +229,43 @@
     iTempReadyPHArray.Close();
     
 	delete iHarvesterOomAO;
+	iHarvesterOomAO = NULL;
     delete iRestoreWatcher;
+    iRestoreWatcher = NULL;
 	delete iOnDemandAO;
+	iOnDemandAO = NULL;
 	delete iMdEHarvesterSession;
+	iMdEHarvesterSession = NULL;
 	delete iMdESession;
+	iMdESession = NULL;
 	delete iQueue;
+	iQueue = NULL;
 	delete iHarvesterPluginFactory;
+	iHarvesterPluginFactory = NULL;
 	delete iMdeObjectHandler;
+	iMdeObjectHandler = NULL;
 	delete iUnmountHandlerAO;
+	iUnmountHandlerAO = NULL;
 	
 	delete iPropDefs;
+	iPropDefs = NULL;
 	delete iCameraExtensionArray;
+	iCameraExtensionArray = NULL;
 	
     delete iPhoneImagesPath;
+    iPhoneImagesPath = NULL;
     delete iMmcImagesPath;
+    iMmcImagesPath = NULL;
     
     delete iPhoneVideosPath;
+    iPhoneVideosPath = NULL;
     delete iMmcVideosPath;
+    iMmcVideosPath = NULL;
     
     delete iPhoneSoundsPath;
+    iPhoneSoundsPath = NULL;
     delete iMmcSoundsPath;
+    iMmcSoundsPath = NULL;
 	
 	RMediaIdUtil::ReleaseInstance();
     
@@ -293,6 +317,8 @@
     // Reset harvesting status for clients in case blacklisted file was handled
     iHarvesterPluginFactory->SendHarvestingStatusEventL( EFalse );
     
+    iPropDefs = CHarvesterAoPropertyDefs::NewL();
+	
     iCameraExtensionArray = new ( ELeave ) CDesCArraySeg( 6 );
     iCameraExtensionArray->InsertIsqL( KExtensionMp4 );
     iCameraExtensionArray->InsertIsqL( KExtensionMpg4 );
@@ -354,8 +380,7 @@
     CleanupStack::PushL( cleanupItem );
     
     CMonitorPlugin::ListImplementationsL( infoArray );
-    TInt count( 0 );
-    count = infoArray.Count();
+    const TInt count( infoArray.Count() );
     CMonitorPlugin* plugin = NULL;
     
     for ( TInt i = 0; i < count; i++ )
@@ -410,7 +435,6 @@
     {
     WRITELOG( "CHarvesterAO::StartMonitoring()" );
     OstTrace0( TRACE_NORMAL, CHARVESTERAO_STARTMONITORING, "CHarvesterAO::StartMonitoring" );    
-    
     const TInt count( iMonitorPluginArray.Count() );  
     
     for ( TInt i = 0; i < count; i++ )
@@ -429,10 +453,8 @@
     WRITELOG( "CHarvesterAO::StopMonitoring()" );
     
     OstTrace0( TRACE_NORMAL, CHARVESTERAO_STOPMONITORING, "CHarvesterAO::StopMonitoring" );
-
-    const TInt count( iMonitorPluginArray.Count() );
     
-    for ( TInt i = 0; i < count; i++ )
+    for( TInt i = iMonitorPluginArray.Count() - 1; i >=0; i-- )
         {
         iMonitorPluginArray[i]->StopMonitoring();
         }
@@ -447,12 +469,11 @@
     WRITELOG( "CHarvesterAO::PauseMonitoring()" );
     OstTrace0( TRACE_NORMAL, CHARVESTERAO_PAUSEMONITORING, "CHarvesterAO::PauseMonitoring" );
     
-    const TInt count( iMonitorPluginArray.Count() );
-    
-    for ( TInt i = 0; i<count; i++ )
+    for( TInt i = iMonitorPluginArray.Count() - 1; i >=0; i-- )
         {
         iMonitorPluginArray[i]->PauseMonitoring();
         }
+    
     OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_PAUSEMONITORING, "CHarvesterAO::PauseMonitoring - end" );    
     WRITELOG( "CHarvesterAO::PauseMonitoring() - end" );
     }
@@ -518,6 +539,7 @@
                 WRITELOG1( "CHarvesterAO::HandleUnmount() remove iReadyPHArray %d", i);
                 OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iReadyPHArray %d", i );
                 
+                HarvestCompleted( hd->ClientId(), hd->Uri(), KErrCancel );
                 delete hd;
                 hd = NULL;
                 iReadyPHArray.Remove( i );
@@ -555,6 +577,7 @@
                 WRITELOG1( "CHarvesterAO::HandleUnmount() remove iPHArray %d", i);
                 OstTrace1( TRACE_NORMAL, DUP5_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iPHArray %d", i );
                 
+                HarvestCompleted( hd->ClientId(), hd->Uri(), KErrCancel );
                 delete hd;
 				hd = NULL;
                 iPHArray.Remove( i );
@@ -591,6 +614,7 @@
                 WRITELOG1( "CHarvesterAO::HandleUnmount() remove iContainerPHArray %d", i);
                 OstTrace1( TRACE_NORMAL, DUP8_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iContainerPHArray %d", i );
                 
+                HarvestCompleted( hd->ClientId(), hd->Uri(), KErrCancel );
                 delete hd;
 				hd = NULL;
                 iContainerPHArray.Remove( i );
@@ -622,6 +646,7 @@
             if( err == KErrNone && mediaId == aMediaId )
                 {
                 WRITELOG1( "CHarvesterAO::HandleUnmount() remove iTempReadyPHArray %d", i);
+                HarvestCompleted( hd->ClientId(), hd->Uri(), KErrCancel );
                 delete hd;
                 hd = NULL;
                 iTempReadyPHArray.Remove( i );
@@ -681,6 +706,7 @@
 
 					TRAP_IGNORE( iMdESession->CancelObjectL( mdeobj ) );
 					
+					HarvestCompleted( hd->ClientId(), hd->Uri(), KErrCancel );
 					delete hd;
 					hd = NULL;
 					}
@@ -825,22 +851,31 @@
 				iPHArray.Count() < KPlaceholderQueueSize &&
 				hd->ObjectType() == EPlaceholder )
     		{
-        	iPHArray.Append( hd );
-        	if( hd->Origin() == MdeConstants::Object::ECamera || 
-        	    hd->ObjectType() == EFastHarvest  )
+        	if(iPHArray.Append( hd ) != KErrNone)
+        	    {
+        	    HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory );
+        	    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                delete hd;
+                hd = NULL;
+        	    }
+        	else
         	    {
-        	    if( !iFastHarvestNeeded )
-        	        {
-                    iFastHarvestNeeded = ETrue;
-                    // Fast harvest event must be handled even if MMC handling would be ongoing
-                    SetPriority( KHarvesterPriorityMonitorPlugin );
-        	        }
-        	    break;
-        	    }
-        	else if( iFastHarvestNeeded )
-        	    {
-        	    iFastHarvestNeeded = EFalse;
-        	    SetPriority( KHarvesterCustomImportantPriority );
+                if( hd->Origin() == MdeConstants::Object::ECamera || 
+                    hd->ObjectType() == EFastHarvest  )
+                    {
+                    if( !iFastHarvestNeeded )
+                        {
+                        iFastHarvestNeeded = ETrue;
+                        // Fast harvest event must be handled even if MMC handling would be ongoing
+                        SetPriority( KHarvesterPriorityMonitorPlugin );
+                        }
+                    break;
+                    }
+                else if( iFastHarvestNeeded )
+                    {
+                    iFastHarvestNeeded = EFalse;
+                    SetPriority( KHarvesterCustomImportantPriority );
+        	    	}
         	    }
         	hd = iQueue->GetNextItem();
     		}
@@ -849,11 +884,14 @@
     	    {
             TRAPD( err, HandlePlaceholdersL( ETrue ) );
 
-            // make sure that when HandlePlaceholdersL leaves, iPHArray is cleared
+            // make sure that when HandlePlaceholdersL leaves unexpectedly, iPHArray is cleared
             if ( err != KErrNone )
                 {
-                iPHArray.ResetAndDestroy();
-                iTempReadyPHArray.ResetAndDestroy();
+                if( err != KErrDiskFull )
+                    {
+                    iPHArray.ResetAndDestroy();
+                    iTempReadyPHArray.ResetAndDestroy();
+                    }
                 User::Leave( err );
                 }
             
@@ -877,16 +915,21 @@
     		{
 	    	if( hd->ObjectType() == EPlaceholder )
 	    		{
-	        	iPHArray.Append( hd );
+	        	if( iPHArray.Append( hd ) != KErrNone )
+	        	    {
+	        	    HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory ); 
+	        	    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                    delete hd;
+                    hd = NULL;
+	        	    }
 	    		}
 	    	else
 	    		{
-	    		CheckFileExtensionAndHarvestL( hd );
-	    		if( iUnmountDetected )
-	    		    {
-	    		    iQueue->Append( hd );
-	    		    return;
-	    		    }
+                if( iReadyPHArray.Append( hd ) != KErrNone)
+                    {
+                    delete hd;
+                    hd = NULL;
+                    }
 	    		}
     		}
 			
@@ -894,11 +937,14 @@
     		{
 	    	TRAPD( err, HandlePlaceholdersL( ETrue ) );
 
-	    	// make sure that when HandlePlaceholdersL leaves, iPHArray is cleared
+	    	// make sure that when HandlePlaceholdersL leaves unexpectedly, iPHArray is cleared
 	    	if ( err != KErrNone )
 	    		{
-	    		iPHArray.ResetAndDestroy();
-	    		iTempReadyPHArray.ResetAndDestroy();
+	    	    if( err != KErrDiskFull )
+	    	        {
+	    	        iPHArray.ResetAndDestroy();
+	    	        iTempReadyPHArray.ResetAndDestroy();
+	    	        }
 	    		User::Leave( err );
 	    		}
     		}
@@ -911,7 +957,7 @@
             }
         iHarvestingPlaceholders = EFalse;
         CheckFileExtensionAndHarvestL( hd );
-        if( iUnmountDetected )
+        if( iUnmountDetected && hd )
             {
             iQueue->Append( hd );
             }
@@ -932,6 +978,8 @@
 
 	TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
 	
+	CMdENamespaceDef& defNS = iMdESession->GetDefaultNamespaceDefL();
+	
 	TInt endindex( iPHArray.Count() );
 	for( TInt i = 0; i < endindex; i++ )
 		{
@@ -939,17 +987,25 @@
 		
 		if( aCheck && iHarvesterPluginFactory->IsContainerFileL( hd->Uri() ) )
 			{
-			iContainerPHArray.Append( hd );
+			if( iContainerPHArray.Append( hd ) != KErrNone )
+			    {
+			    HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory );
+			    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                delete hd;
+                hd = NULL;
+			    }
+
 			iPHArray.Remove( i );
-            i--;
-            endindex--;
+			i--;
+			endindex--;
 			continue;
 			}
+		
 		TBuf<KObjectDefStrSize> objDefStr;
 		
 		if( !CheckForCameraItem( hd, objDefStr ) )
 		    {
-		    iHarvesterPluginFactory->GetObjectDefL( *hd, objDefStr );
+		    iHarvesterPluginFactory->GetObjectDefL( hd, objDefStr );
 		    }
 		
 		// GetObjectDef can cause context switch, and if unmount happens when this execution is 
@@ -960,8 +1016,15 @@
 		    WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - Unmount detected during execution!" );
 		    for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- )
 		        {
-		        CHarvesterData* hd = iTempReadyPHArray[y];
-		        iPHArray.Insert( hd, 0 );
+		        CHarvesterData* tempHd = iTempReadyPHArray[y];
+				
+		        if(iPHArray.Insert( tempHd, 0 ) != KErrNone)
+		            {
+		            HarvestCompleted( tempHd->ClientId(), tempHd->Uri(), KErrNoMemory );
+		            iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                    delete tempHd;
+                    tempHd = NULL;
+		            }
 		        }
 		    iTempReadyPHArray.Reset();
 		    CleanupStack::PopAndDestroy( &mdeObjectArray );
@@ -976,21 +1039,41 @@
             const TInt currentPHArrayCount( iPHArray.Count() );
             for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- )
                 {
-                CHarvesterData* hd = iTempReadyPHArray[y];
-                if( currentPHArrayCount )
+                CHarvesterData* tempHd = iTempReadyPHArray[y];
+                if(iPHArray.Insert( tempHd, 0 ) != KErrNone)
                     {
-                    // Leave the first item in the array as it is the priority item
-                    iPHArray.Insert( hd, 1 );
-                    }
-                else
-                    {
-                    iPHArray.Insert( hd, 0 );
+                    HarvestCompleted( tempHd->ClientId(), tempHd->Uri(), KErrNoMemory );
+                    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                    delete tempHd;
+                    tempHd = NULL;
                     }
                 }
             iTempReadyPHArray.Reset();
             CleanupStack::PopAndDestroy( &mdeObjectArray );
             return;		
 		    }
+	    // Check if disk is full
+	    // If disk is detected to be full, no items can be added to MDS db, thus abort the run, and start over 
+		// when disk space is available to make sure the arrays are valid.
+		else if( iDiskFull )
+		    {
+            WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - No disk space available!" );
+            for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- )
+                {
+                CHarvesterData* tempHd = iTempReadyPHArray[y];
+            
+                if(iPHArray.Insert( tempHd, 0 ) != KErrNone)
+                    {
+                    HarvestCompleted( tempHd->ClientId(), tempHd->Uri(), KErrNoMemory );
+                    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                    delete tempHd;
+                    tempHd = NULL;
+                    }
+                }
+            iTempReadyPHArray.Reset();
+            CleanupStack::PopAndDestroy( &mdeObjectArray );
+            User::Leave( KErrDiskFull );
+		    }
 		
 		if( objDefStr.Length() == 0 ||
 		    ( objDefStr == KInUse ) )
@@ -1008,10 +1091,12 @@
 			continue;
 			}
 
-		CMdENamespaceDef& defNS = iMdESession->GetDefaultNamespaceDefL();
 		CMdEObjectDef& mdeObjectDef = defNS.GetObjectDefL( objDefStr );
 
-		CMdEObject* mdeObject = iMdESession->NewObjectL( mdeObjectDef, hd->Uri() );
+		HBufC* hdUri = hd->Uri().AllocL();
+		CleanupStack::PushL( hdUri );
+		CMdEObject* mdeObject = iMdESession->NewObjectL( mdeObjectDef, *hdUri );
+		CleanupStack::PopAndDestroy( hdUri );
 		CleanupStack::PushL( mdeObject );
 		
 		CPlaceholderData* phData = NULL;
@@ -1080,10 +1165,10 @@
 	    // set placeholder
 	    mdeObject->SetPlaceholder( ETrue );
 	    
-	    if( !iPropDefs )
-	    	{
-	    	iPropDefs = CHarvesterAoPropertyDefs::NewL( defNS.GetObjectDefL( MdeConstants::Object::KBaseObject ) );
-	    	}
+	    if( !iPropDefs->iCreationDatePropertyDef )
+	        {
+            iPropDefs->SetByObjectDefL( defNS.GetObjectDefL( MdeConstants::Object::KBaseObject ) );
+	        }
 
 	    // set file size
     	mdeObject->AddUint32PropertyL( *iPropDefs->iSizePropertyDef, phData->FileSize() );
@@ -1172,33 +1257,68 @@
 	    
 	    CleanupStack::Pop( mdeObject );
 		
-	    iTempReadyPHArray.Append( hd );
+	    if(iTempReadyPHArray.Append( hd ) != KErrNone)
+	        {
+	        HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory );
+            delete hd;
+            hd = NULL;
+	        }
 		iPHArray.Remove( i );
         i--;
         endindex--;
 		}
 	
-	const TInt tempArrayCount( iTempReadyPHArray.Count() );
-	for( TInt i( 0 ); i < tempArrayCount; i++ )
-	    {
-	    CHarvesterData* hd = iTempReadyPHArray[i];
-	    iReadyPHArray.Append( hd );
-	    }
-	iTempReadyPHArray.Reset();
-	
 	const TInt objectCount = mdeObjectArray.Count();  
 	
     if( objectCount > 0 )
 		{
 		// add object to mde
 		iMdEHarvesterSession->AutoLockL( mdeObjectArray );
-		const TInt addError( iMdESession->AddObjectsL( mdeObjectArray ) );
+		TInt addError( KErrNone );
+		TRAPD( addFailure, addError = iMdESession->AddObjectsL( mdeObjectArray ) );
+		if( addFailure == KErrDiskFull )
+		    {
+            WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - No disk space available!" );
+            for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- )
+                {
+                CHarvesterData* tempHd = iTempReadyPHArray[y];
+        
+                if(iPHArray.Insert( tempHd, 0 ) != KErrNone)
+                    {
+                    HarvestCompleted( tempHd->ClientId(), tempHd->Uri(), KErrNoMemory );
+                    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                    delete tempHd;
+                    tempHd = NULL;
+                    }
+                }
+            iTempReadyPHArray.Reset();
+            CleanupStack::PopAndDestroy( &mdeObjectArray );
+            User::Leave( KErrDiskFull );		
+		    }
+		else if( addFailure != KErrNone )
+		    {
+		    User::Leave( addFailure );      
+		    }
+		
 		if( addError != KErrNone )
 		    {
 		    // If some error occures, retry
 		    iMdESession->AddObjectsL( mdeObjectArray );
 		    }
 
+	    const TInt tempArrayCount( iTempReadyPHArray.Count() );
+	    for( TInt i( 0 ); i < tempArrayCount; i++ )
+	        {
+	        CHarvesterData* tempHd = iTempReadyPHArray[i];
+            if(iReadyPHArray.Append( tempHd ) != KErrNone)
+                 {
+                 HarvestCompleted( tempHd->ClientId(), tempHd->Uri(), KErrNoMemory );
+                 delete tempHd;
+                 tempHd = NULL;
+                 }
+	        }
+	    iTempReadyPHArray.Reset();
+		
 	    iHarvesterEventManager->IncreaseItemCount( EHEObserverTypePlaceholder, 
 		        objectCount );
 		iHarvesterEventManager->SendEventL( EHEObserverTypePlaceholder, EHEStateStarted, 
@@ -1234,17 +1354,17 @@
     const TDesC& uri = aHD->Uri();
     TBool objectExisted = ETrue;
     
-    if( ! mdeObject )
+    if( !mdeObject )
     	{
     	objectExisted = EFalse;
     	WRITELOG1( "CHarvesterAO::CheckFileExtensionAndHarvestL() - no mdeobject. URI: %S", &uri );
 	    TBuf<KObjectDefStrSize> objDefStr;
-		iHarvesterPluginFactory->GetObjectDefL( *aHD, objDefStr );
+		iHarvesterPluginFactory->GetObjectDefL( aHD, objDefStr );
 
         // GetObjectDef can cause context switch, and if unmount happens when this execution is 
         // interrupted, the ph data can be invalid. Thus, abort whole run, and start over to make sure 
         // the data is valid.
-        if( iUnmountDetected )
+        if( !aHD )
             {
             return;
             }
@@ -1349,9 +1469,16 @@
     	{
     	iMdESession->RemoveObjectL( aHD->Uri() );
     	}
+    
+    // If context swich occures just right due to RemoveObjectL, check aHD for validity
+    if( !aHD )
+        {
+        return;
+        }
 	
 	TInt pluginErr = KErrNone;
     TRAPD( err, pluginErr = iHarvesterPluginFactory->HarvestL( aHD ));
+    
     if ( err != KErrNone )
     	{
     	WRITELOG1( "CHarvesterAO::CheckFileExtensionAndHarvestL() - plugin error: %d", err );
@@ -1381,8 +1508,6 @@
     
     WRITELOG1("CHarvesterAO::CheckFileExtensionAndHarvestL() - ends with error %d", pluginErr );
     OstTrace1( TRACE_NORMAL, DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL) - ends with error %d", pluginErr );
-    
-    SetNextRequest( ERequestHarvest );
     }
 
 // ---------------------------------------------------------------------------
@@ -1512,8 +1637,6 @@
         OstTrace0( TRACE_NORMAL, DUP12_CHARVESTERAO_HARVESTINGCOMPLETED, "==============================ERROR done =========================" );
         
         }
-           
-    SetNextRequest( ERequestHarvest );
     }
 
 // ---------------------------------------------------------------------------
@@ -1660,25 +1783,41 @@
         TRAP_IGNORE( BootPartialRestoreScanL() );
 #endif
         
-        if( !iMassMemoryIdChecked )
+        // Store the internal mass memory media ID to DB, and update data if necessary
+        TInt drive( -1 );
+        TInt internalMassStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) );
+        if( internalMassStorageError == KErrNone )
             {
-            TInt drive( -1 );
-            TInt massStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) );
-            if( massStorageError == KErrNone )
+            TVolumeInfo internalMassStorageVolumeInfo;
+            internalMassStorageError = iFs.Volume( internalMassStorageVolumeInfo, drive );
+            if( internalMassStorageError == KErrNone )
                 {
-                TVolumeInfo massStorageVolumeInfo;
-                iFs.Volume( massStorageVolumeInfo, drive );
-                const TUint32 massStorageMediaId( massStorageVolumeInfo.iUniqueID );
-                massStorageError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive );
-                if( massStorageError == KErrNone )
+                const TUint32 massStorageMediaId( internalMassStorageVolumeInfo.iUniqueID );
+                TUint32 mmcMediaId( 0 );
+                TInt mmcError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ) );
+                if( mmcError == KErrNone )
                     {
-                    iFs.Volume( massStorageVolumeInfo, drive );
-                    // Update mass storage media id if the mass storage is not memory card
-                    if( massStorageVolumeInfo.iUniqueID != massStorageMediaId && massStorageMediaId != 0 )
+                    TVolumeInfo mmcVolumeInfo;
+                    mmcError = iFs.Volume( mmcVolumeInfo, drive );
+                    if( mmcError == KErrNone )
+                        {
+                        mmcMediaId = mmcVolumeInfo.iUniqueID;
+                        }
+                    }
+                
+                // If removable storage is not found, assume internal mass storage was mounted
+                if( mmcError )
+                    {
+                    if( massStorageMediaId != 0 )
                         {
                         iMdEHarvesterSession->CheckMassStorageMediaId( massStorageMediaId );
-                        }
+                        }                    
                     }
+                else if( massStorageMediaId != mmcMediaId && 
+                            massStorageMediaId != 0 )
+                    {
+                    iMdEHarvesterSession->CheckMassStorageMediaId( massStorageMediaId );
+                    }          
                 }
             }
         }
@@ -1818,7 +1957,7 @@
             WRITELOG( "CHarvesterAO::RunL - ERequestHarvest" );
             OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestHarvest" );
             
-            // harvest new items first...
+            // harvest new items first
             if ( iQueue->ItemsInQueue() > 0 )
                 {
                 WRITELOG( "CHarvesterAO::RunL - Items in queue - calling ReadItemFromQueueL()" );
@@ -1831,9 +1970,29 @@
             else
                 {
                 WRITELOG( "CHarvesterAO::RunL - No items in main queue" );
+                // If interrupts occured, check the normal placeholder array for possible items to
+                // be handled before moving on to container or ready placeholders
+                if( iPHArray.Count() > 0 )
+                    {
+                    WRITELOG( "CHarvesterAO::RunL - Items found in placeholder array" );
+                    TRAPD( err, HandlePlaceholdersL( ETrue ) );
+
+                    // make sure that when HandlePlaceholdersL leaves unexpectedly, iPHArray is cleared
+                    if ( err != KErrNone )
+                        {
+                        if( err != KErrDiskFull )
+                            {
+                            iPHArray.ResetAndDestroy();
+                            iTempReadyPHArray.ResetAndDestroy();
+                            }
+                        User::Leave( err );
+                        }
+                    SetNextRequest( ERequestHarvest );
+                    break;
+                    }
                 // All registered fast harvested items or placeholders handled at this point     
                 // if container files to harvest, handle those next
-                if( iContainerPHArray.Count() > 0 )
+                else if( iContainerPHArray.Count() > 0 )
                 	{
                     WRITELOG( "CHarvesterAO::RunL - Items in iContainterPHArray - requesting ERequestContainerPlaceholder handling" );
                     iFastHarvestNeeded = EFalse;
@@ -1864,8 +2023,8 @@
             		WRITELOG1("CHarvesterAO::RunL - items in ready pharray: %d", arrayCount );
             		OstTrace1( TRACE_NORMAL, DUP3_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - items in ready pharray: %d", arrayCount );
 #endif   		
-            		TInt endIndex( KPlaceholderQueueSize );
-            		if( arrayCount < KPlaceholderQueueSize )
+            		TInt endIndex( KReadyPlaceholderQueueSize );
+            		if( arrayCount < KReadyPlaceholderQueueSize )
             		    {
             		    endIndex = arrayCount;
             		    }
@@ -1913,14 +2072,17 @@
         		}
         	TRAPD( err, HandlePlaceholdersL( EFalse ) );
 
-	    	// make sure that when HandlePlaceholdersL leaves, iPHArray is cleared
-	    	if ( err != KErrNone )
-	    		{
-	    	    iContainerPHArray.ResetAndDestroy();
-	    		iPHArray.ResetAndDestroy();
-	    		iTempReadyPHArray.ResetAndDestroy();
-	    		User::Leave( err );
-	    		}
+            // make sure that when HandlePlaceholdersL leaves unexpectedly, iPHArray is cleared
+            if ( err != KErrNone )
+                {
+                if( err != KErrDiskFull )
+                    {
+                    iContainerPHArray.ResetAndDestroy();
+                    iPHArray.ResetAndDestroy();
+                    iTempReadyPHArray.ResetAndDestroy();
+                    }
+                User::Leave( err );
+                }
 	    	SetNextRequest( ERequestHarvest );
         	}
         break;
@@ -1980,7 +2142,7 @@
 //
 TInt CHarvesterAO::RunError( TInt aError )
     {
-    WRITELOG( "CHarvesterAO::RunError" );
+    WRITELOG1( "CHarvesterAO::RunError, error: %d", aError );
     OstTrace0( TRACE_NORMAL, CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError" );
     
     switch( iNextRequest )
@@ -1989,6 +2151,21 @@
             {
             WRITELOG( "CHarvesterAO::RunError - state ERequestHarvest" );
             OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError - state ERequestHarvest" );
+            if( aError == KErrDiskFull || aError == KErrNoMemory )
+                {
+                SetNextRequest( ERequestIdle );
+                }
+            }
+        break;
+        
+        case ERequestContainerPlaceholder:
+            {
+            WRITELOG( "CHarvesterAO::RunError - state ERequestContainerPlaceholder" );
+            OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError - state ERequestContainerPlaceholder" );
+            if( aError == KErrDiskFull || aError == KErrNoMemory )
+                {
+                SetNextRequest( ERequestIdle );
+                }
             }
         break;
         
@@ -2105,14 +2282,14 @@
     
     if( MMdSHarvesterDiskSpaceObserver::EMore == aDiskSpaceDirection )
         {
-        WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL() - disk full");
-        OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL - disk full" );        
+        WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL() - disk space available");
+        OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL - disk space available" );
         iDiskFull = EFalse;
         }
     else
         {
-        WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL() - disk space available");
-        OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL - disk space available" );
+        WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL() - disk full");
+        OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL - disk full" );        
         iDiskFull = ETrue;
         if( iServerPaused )
             {
@@ -2320,6 +2497,7 @@
     else
         {
         delete hd;
+        hd = NULL;
         err = KErrUnknown;
         }
     
@@ -2327,6 +2505,10 @@
         {
         aMessage.Complete( err );
         }
+    else if( err != KErrNone )
+        {
+        HarvestCompleted( aMessage.Identity(), uri->Des(), err );
+        }
     
     albumIds.Close();
     }
@@ -2517,6 +2699,7 @@
     else
         {
         delete hd;
+        hd = NULL;
         err = KErrUnknown;
         }
 
@@ -2524,6 +2707,10 @@
         {
         aMessage.Complete( err );
         }
+    else if( err != KErrNone )
+        {
+        HarvestCompleted( aMessage.Identity(), uri->Des(), err );
+        }
     
     albumIds.Close();
     }
@@ -2941,25 +3128,6 @@
 	{
 	WRITELOG("CHarvesterAO::BootScanL() - begin");
     OstTrace0( TRACE_NORMAL, CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - begin" );
-    	
-    TInt drive( -1 );
-    TInt massStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) );
-    if( massStorageError == KErrNone )
-        {
-        TVolumeInfo massStorageVolumeInfo;
-        iFs.Volume( massStorageVolumeInfo, drive );
-        const TUint32 massStorageMediaId( massStorageVolumeInfo.iUniqueID );
-        massStorageError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive );
-        if( massStorageError == KErrNone )
-            {
-            iFs.Volume( massStorageVolumeInfo, drive );
-            // Update mass storage media id if the mass storage is not memory card
-            if( massStorageVolumeInfo.iUniqueID != massStorageMediaId && massStorageMediaId != 0 )
-                {
-                iMdEHarvesterSession->CheckMassStorageMediaId( massStorageMediaId );
-                }
-            }
-        }
 	
 	TVolumeInfo volumeInfo;
 	iFs.Volume( volumeInfo, EDriveC );
@@ -3041,9 +3209,11 @@
 						WRITELOG("CHarvesterAO::BootScanL() - scanFolders.AppendL");
 						OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - scanFolders.AppendL" );
 						TScanItem* item = new (ELeave) TScanItem();
+						CleanupStack::PushL( item );
 						item->iPath = name->AllocL();
 						item->iPreinstalled = MdeConstants::MediaObject::ENotPreinstalled;
-						aScanItems.AppendL( item );
+						CleanupStack::Pop( item );
+						aScanItems.AppendL( item ); // ownership is transferred
 						}
 					}
 				else
@@ -3103,7 +3273,12 @@
 	                        hd->SetClientData( phData );
 
 	                        CleanupStack::Pop( phData );
-	                        hdArray.Append( hd );
+							
+	                        if(hdArray.Append( hd ) != KErrNone )
+	                            {
+                                delete hd;
+                                hd = NULL;
+	                            }
 						    }
 						CleanupStack::PopAndDestroy( &results );
 						CleanupStack::PopAndDestroy( &fileInfos );
@@ -3128,8 +3303,6 @@
 
 	iMdEHarvesterSession->RemoveFilesNotPresent( volumeInfo.iUniqueID, ETrue );
 	
-	iMassMemoryIdChecked = ETrue;
-	
 	WRITELOG("CHarvesterAO::BootScanL() - end");
 	OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - end" );
 	}
--- a/harvester/server/src/harvesterqueue.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/harvesterqueue.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -174,6 +174,7 @@
     if ( aItem->ObjectType() == EFastHarvest || aItem->Origin() == MdeConstants::Object::ECamera )
     	{
     	err = iItemQueue.Insert( aItem, 0 );
+    	
     	if( !iHarvesterAO->IsActive() )
     	    {
             iHarvesterAO->SetPriority( KHarvesterPriorityMonitorPlugin );
--- a/harvester/server/src/harvesterserver.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/harvesterserver.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -162,7 +162,7 @@
     WRITELOG( "CHarvesterServer::NewLC() - begin" );
     
 	CHarvesterServer* self = new (ELeave) CHarvesterServer(
-			CActive::EPriorityUserInput, KHarvesterServerPolicy, 
+	        KHarvesterServerSessionPriority, KHarvesterServerPolicy, 
 			ESharableSessions );
 	CleanupStack::PushL( self );
 	self->ConstructL();
@@ -444,8 +444,11 @@
     OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_CHARVESTERSERVER, "CHarvesterServer::~CHarvesterServer" );
     
     delete iHarvesterAO;
+    iHarvesterAO = NULL;
     delete iPauseObserverAO;
+    iPauseObserverAO = NULL;
     delete iShutdownObserver;
+    iShutdownObserver = NULL;
     OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_CHARVESTERSERVER, "CHarvesterServer::~CHarvesterServer end" );
     
     WRITELOG( "CHarvesterServer::~CHarvesterServer() end" );
--- a/harvester/server/src/mdeobjecthandler.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/mdeobjecthandler.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -126,7 +126,7 @@
                 CMdERelation* relation =  
                		iMdeSession->NewRelationLC(
                 		albumRelationDef, albumId, objectId, 0 );
-                relationEventArray.Append( STATIC_CAST( CMdEInstanceItem*, relation ) );
+                relationEventArray.AppendL( STATIC_CAST( CMdEInstanceItem*, relation ) );
                 CleanupStack::Pop(); //relation
                 }
             }
@@ -140,7 +140,7 @@
             {
             CMdEEvent* event = iMdeSession->NewEventLC( 
             		*eventDef, objectId, time );
-            relationEventArray.Append( STATIC_CAST( CMdEInstanceItem*, event ) );
+            relationEventArray.AppendL( STATIC_CAST( CMdEInstanceItem*, event ) );
             CleanupStack::Pop(); // event
             }
         }
--- a/harvester/server/src/ondemandao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/ondemandao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -64,6 +64,7 @@
 	if( iMdEHarvesterSession )
 		{
 		delete iMdEHarvesterSession;
+		iMdEHarvesterSession = NULL;
 		}
 	// Delete instance variables if any
 	}
@@ -115,8 +116,14 @@
 							hd->SetEventType( EHarvesterEdit );
 							hd->SetObjectType( EFastHarvest );
 							queue.Remove( k );
-							queue.Insert( hd, 0 );
-							found = ETrue;
+
+							if(queue.Insert( hd, 0 ) != KErrNone)
+							    {
+                                delete hd;
+                                hd = NULL;
+							    }
+							
+                            found = ETrue;
 							}							
 						}
 					}
--- a/harvester/server/src/reharvesterao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/src/reharvesterao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -19,8 +19,8 @@
 #include "mdeobject.h"
 #include "mdsutils.h"
 
-const TInt KResumeTime = 2000000;  //microseconds
-const TInt KTimeIncrease = 500000; //microseconds
+const TInt KResumeTime = 3000000;  //microseconds
+const TInt KTimeIncrease = 1000000; //microseconds
 const TInt KTimeLimit = 30000000;    //microseconds
 
 // ---------------------------------------------------------------------------
@@ -165,6 +165,7 @@
             WRITELOG1("CReHarvesterAO::AddItem() - %S already exists in re-harvester queue", &aItem->Uri() );
 #endif
             delete aItem;
+            aItem = NULL;
             return;
             }
         }
@@ -173,11 +174,16 @@
     if( mdeObject )
     	{
     	delete mdeObject;
+    	mdeObject = NULL;
     	aItem->SetMdeObject( NULL );
     	}
     
-    iItems.Append( aItem );
-    
+    if(iItems.Append( aItem ) != KErrNone )
+        {
+        delete aItem;
+        aItem = NULL;
+        }
+
     iDelay = KResumeTime;
     const TTimeIntervalMicroSeconds32 delay = TTimeIntervalMicroSeconds32( iDelay );
     
@@ -206,6 +212,7 @@
         // found matching item
 	    iItems.Remove( i );
 	    delete item;
+	    item = NULL;
         }
     
     if ( iItems.Count() == 0 )
--- a/harvester/server/traces/fixed_id.definitions	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/traces/fixed_id.definitions	Wed Aug 18 10:12:07 2010 +0300
@@ -1,197 +1,198 @@
 #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BACKUPRESTOREREADY=0x63
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BACKUPRESTORESTART=0x62
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BOOTPARTIALRESTORESCANL=0x95
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BOOTROMSCANL=0x94
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BOOTSCANL=0x97
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CHARVESTERAO=0x3
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x26
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CONSTRUCTL=0x5
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4b
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8c
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_DELETECOMPOSERS=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_DELETEMONITORPLUGINS=0x9
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_DOCANCEL=0x5a
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_GETLASTOBSERVERID=0x8b
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x64
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x22
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLESESSIONERROR=0x4a
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLESESSIONOPENED=0x3c
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLEUNMOUNT=0x10
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTCOMPLETED=0x92
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTFILE=0x67
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTFILEWITHUID=0x72
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTINGCOMPLETED=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_ISCOMPOSINGREADY=0x20
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_ISSERVERPAUSED=0x61
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_LOADMONITORPLUGINSL=0x7
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_MEMORYGOOD=0x9e
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_MEMORYLOW=0x9d
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_NEWL=0x2
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_NEWLC=0x1
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_PAUSEHARVESTER=0x4e
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_PAUSEMONITORING=0xd
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_READITEMFROMQUEUEL=0x21
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_REGISTERHARVESTCOMPLETE=0x87
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_REGISTERHARVESTEREVENT=0x89
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7d
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RESUMEHARVESTERL=0x50
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RESUMEMONITORING=0xf
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RUNERROR=0x5b
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RUNL=0x51
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_SETNEXTREQUEST=0x60
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STARTCOMPOSERSL=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STARTMONITORING=0xb
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STOPCOMPOSERS=0x1e
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STOPMONITORING=0xc
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_UNREGISTERHARVESTCOMPLETE=0x88
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_UNREGISTERHARVESTEREVENT=0x8a
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x83
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION=0xc0
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_CONSTRUCTL=0xbf
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_DISCONNECT=0xc3
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_NEWL=0xbd
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_NEWLC=0xbe
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_SERVICEL=0xc2
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_CHARVESTERSERVER=0xb1
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_CONSTRUCTL=0x9f
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_HARVESTFILE=0xa9
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_HARVESTFILEWITHUID=0xaa
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_NEWSESSIONL=0xb5
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PANICCLIENT=0xb3
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PANICSERVER=0xb4
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PAUSE=0xa1
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PAUSEREADY=0xa5
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_REGISTERHARVESTCOMPLETE=0xad
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_REGISTERHARVESTEREVENT=0xaf
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_REGISTERPROCESSORIGIN=0xab
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RESTARTNOTIFICATION=0xa8
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RESUME=0xa2
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RESUMEREADY=0xa6
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RUNERROR=0xb7
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_SHUTDOWNNOTIFICATION=0xa7
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_THREADFUNCTION=0xba
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_THREADFUNCTIONL=0xb8
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE=0xae
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_UNREGISTERHARVESTEREVENT=0xb0
-[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_UNREGISTERPROCESSORIGIN=0xac
-[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HANDLESESSIONOPENED=0x46
-[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HANDLEUNMOUNT=0x19
-[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HARVESTFILE=0x71
-[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HARVESTFILEWITHUID=0x7c
-[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HARVESTINGCOMPLETED=0x39
-[TRACE]TRACE_NORMAL[0x86]_DUP11_CHARVESTERAO_HANDLESESSIONOPENED=0x47
-[TRACE]TRACE_NORMAL[0x86]_DUP11_CHARVESTERAO_HANDLEUNMOUNT=0x1a
-[TRACE]TRACE_NORMAL[0x86]_DUP11_CHARVESTERAO_HARVESTINGCOMPLETED=0x3a
-[TRACE]TRACE_NORMAL[0x86]_DUP12_CHARVESTERAO_HANDLESESSIONOPENED=0x48
-[TRACE]TRACE_NORMAL[0x86]_DUP12_CHARVESTERAO_HANDLEUNMOUNT=0x1b
-[TRACE]TRACE_NORMAL[0x86]_DUP12_CHARVESTERAO_HARVESTINGCOMPLETED=0x3b
-[TRACE]TRACE_NORMAL[0x86]_DUP13_CHARVESTERAO_HANDLESESSIONOPENED=0x49
-[TRACE]TRACE_NORMAL[0x86]_DUP13_CHARVESTERAO_HANDLEUNMOUNT=0x1c
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL=0x96
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_BOOTSCANL=0x98
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CHARVESTERAO=0x4
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x27
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CONSTRUCTL=0x6
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4c
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8d
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_DELETEMONITORPLUGINS=0xa
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x65
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x23
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLESESSIONOPENED=0x3d
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLEUNMOUNT=0x11
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTCOMPLETED=0x93
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTFILE=0x68
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTFILEWITHUID=0x73
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTINGCOMPLETED=0x38
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_LOADMONITORPLUGINSL=0x8
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_PAUSEHARVESTER=0x4f
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_PAUSEMONITORING=0xe
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7e
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_RUNERROR=0x5c
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_RUNL=0x52
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x84
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION=0xc1
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_CHARVESTERSERVER=0xb2
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_CONSTRUCTL=0xa0
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_NEWSESSIONL=0xb6
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_PAUSE=0xa3
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_RESUME=0xa4
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_THREADFUNCTION=0xbb
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_THREADFUNCTIONL=0xb9
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_BOOTSCANL=0x99
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x28
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4d
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8e
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x66
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x24
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLESESSIONOPENED=0x3e
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLEUNMOUNT=0x12
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HARVESTFILE=0x69
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HARVESTFILEWITHUID=0x74
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HARVESTINGCOMPLETED=0x30
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7f
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_RUNERROR=0x5d
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_RUNL=0x53
-[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x85
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_BOOTSCANL=0x9a
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x29
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8f
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x25
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HANDLESESSIONOPENED=0x3f
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HANDLEUNMOUNT=0x13
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HARVESTFILE=0x6a
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HARVESTFILEWITHUID=0x75
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HARVESTINGCOMPLETED=0x31
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN=0x80
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_RUNERROR=0x5e
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_RUNL=0x54
-[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x86
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_BOOTSCANL=0x9b
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2a
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x90
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HANDLESESSIONOPENED=0x40
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HANDLEUNMOUNT=0x14
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HARVESTFILE=0x6b
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HARVESTFILEWITHUID=0x76
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HARVESTINGCOMPLETED=0x32
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN=0x81
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_RUNERROR=0x5f
-[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_RUNL=0x55
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_BOOTSCANL=0x9c
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2b
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x91
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HANDLESESSIONOPENED=0x41
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HANDLEUNMOUNT=0x15
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HARVESTFILE=0x6c
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HARVESTFILEWITHUID=0x77
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HARVESTINGCOMPLETED=0x33
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN=0x82
-[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_RUNL=0x56
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2c
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HANDLESESSIONOPENED=0x42
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HANDLEUNMOUNT=0x16
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HARVESTFILE=0x6d
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HARVESTFILEWITHUID=0x78
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HARVESTINGCOMPLETED=0x34
-[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_RUNL=0x57
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2d
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HANDLESESSIONOPENED=0x43
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HANDLEUNMOUNT=0x17
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HARVESTFILE=0x6e
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HARVESTFILEWITHUID=0x79
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HARVESTINGCOMPLETED=0x35
-[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_RUNL=0x58
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2e
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HANDLESESSIONOPENED=0x44
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HANDLEUNMOUNT=0x18
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HARVESTFILE=0x6f
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HARVESTFILEWITHUID=0x7a
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HARVESTINGCOMPLETED=0x36
-[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_RUNL=0x59
-[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HANDLESESSIONOPENED=0x45
-[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HARVESTFILE=0x70
-[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HARVESTFILEWITHUID=0x7b
-[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HARVESTINGCOMPLETED=0x37
-[TRACE]TRACE_NORMAL[0x86]__E32MAIN=0xbc
+[GROUP]TRACE_NORMAL=0x3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_BACKUPRESTOREREADY=0x63
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_BACKUPRESTORESTART=0x62
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_BOOTPARTIALRESTORESCANL=0x95
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_BOOTROMSCANL=0x94
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_BOOTSCANL=0x97
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_CHARVESTERAO=0x3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x26
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_CONSTRUCTL=0x5
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4b
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8c
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_DELETECOMPOSERS=0x1f
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_DELETEMONITORPLUGINS=0x9
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_DOCANCEL=0x5a
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_GETLASTOBSERVERID=0x8b
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x64
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x22
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HANDLESESSIONERROR=0x4a
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HANDLESESSIONOPENED=0x3c
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HANDLEUNMOUNT=0x10
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HARVESTCOMPLETED=0x92
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HARVESTFILE=0x67
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HARVESTFILEWITHUID=0x72
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_HARVESTINGCOMPLETED=0x2f
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_ISCOMPOSINGREADY=0x20
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_ISSERVERPAUSED=0x61
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_LOADMONITORPLUGINSL=0x7
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_MEMORYGOOD=0x9e
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_MEMORYLOW=0x9d
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_NEWL=0x2
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_NEWLC=0x1
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_PAUSEHARVESTER=0x4e
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_PAUSEMONITORING=0xd
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_READITEMFROMQUEUEL=0x21
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_REGISTERHARVESTCOMPLETE=0x87
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_REGISTERHARVESTEREVENT=0x89
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7d
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_RESUMEHARVESTERL=0x50
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_RESUMEMONITORING=0xf
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_RUNERROR=0x5b
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_RUNL=0x51
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_SETNEXTREQUEST=0x60
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_STARTCOMPOSERSL=0x1d
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_STARTMONITORING=0xb
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_STOPCOMPOSERS=0x1e
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_STOPMONITORING=0xc
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_UNREGISTERHARVESTCOMPLETE=0x88
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_UNREGISTERHARVESTEREVENT=0x8a
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x83
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION=0xc0
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVERSESSION_CONSTRUCTL=0xbf
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVERSESSION_DISCONNECT=0xc3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVERSESSION_NEWL=0xbd
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVERSESSION_NEWLC=0xbe
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVERSESSION_SERVICEL=0xc2
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_CHARVESTERSERVER=0xb1
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_CONSTRUCTL=0x9f
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_HARVESTFILE=0xa9
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_HARVESTFILEWITHUID=0xaa
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_NEWSESSIONL=0xb5
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_PANICCLIENT=0xb3
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_PANICSERVER=0xb4
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_PAUSE=0xa1
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_PAUSEREADY=0xa5
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_REGISTERHARVESTCOMPLETE=0xad
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_REGISTERHARVESTEREVENT=0xaf
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_REGISTERPROCESSORIGIN=0xab
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_RESTARTNOTIFICATION=0xa8
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_RESUME=0xa2
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_RESUMEREADY=0xa6
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_RUNERROR=0xb7
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_SHUTDOWNNOTIFICATION=0xa7
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_THREADFUNCTION=0xba
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_THREADFUNCTIONL=0xb8
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE=0xae
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_UNREGISTERHARVESTEREVENT=0xb0
+[TRACE]TRACE_NORMAL[0x3]_CHARVESTERSERVER_UNREGISTERPROCESSORIGIN=0xac
+[TRACE]TRACE_NORMAL[0x3]_DUP10_CHARVESTERAO_HANDLESESSIONOPENED=0x46
+[TRACE]TRACE_NORMAL[0x3]_DUP10_CHARVESTERAO_HANDLEUNMOUNT=0x19
+[TRACE]TRACE_NORMAL[0x3]_DUP10_CHARVESTERAO_HARVESTFILE=0x71
+[TRACE]TRACE_NORMAL[0x3]_DUP10_CHARVESTERAO_HARVESTFILEWITHUID=0x7c
+[TRACE]TRACE_NORMAL[0x3]_DUP10_CHARVESTERAO_HARVESTINGCOMPLETED=0x39
+[TRACE]TRACE_NORMAL[0x3]_DUP11_CHARVESTERAO_HANDLESESSIONOPENED=0x47
+[TRACE]TRACE_NORMAL[0x3]_DUP11_CHARVESTERAO_HANDLEUNMOUNT=0x1a
+[TRACE]TRACE_NORMAL[0x3]_DUP11_CHARVESTERAO_HARVESTINGCOMPLETED=0x3a
+[TRACE]TRACE_NORMAL[0x3]_DUP12_CHARVESTERAO_HANDLESESSIONOPENED=0x48
+[TRACE]TRACE_NORMAL[0x3]_DUP12_CHARVESTERAO_HANDLEUNMOUNT=0x1b
+[TRACE]TRACE_NORMAL[0x3]_DUP12_CHARVESTERAO_HARVESTINGCOMPLETED=0x3b
+[TRACE]TRACE_NORMAL[0x3]_DUP13_CHARVESTERAO_HANDLESESSIONOPENED=0x49
+[TRACE]TRACE_NORMAL[0x3]_DUP13_CHARVESTERAO_HANDLEUNMOUNT=0x1c
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL=0x96
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_BOOTSCANL=0x98
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_CHARVESTERAO=0x4
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x27
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_CONSTRUCTL=0x6
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4c
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8d
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_DELETEMONITORPLUGINS=0xa
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x65
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x23
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HANDLESESSIONOPENED=0x3d
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HANDLEUNMOUNT=0x11
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HARVESTCOMPLETED=0x93
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HARVESTFILE=0x68
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HARVESTFILEWITHUID=0x73
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_HARVESTINGCOMPLETED=0x38
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_LOADMONITORPLUGINSL=0x8
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_PAUSEHARVESTER=0x4f
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_PAUSEMONITORING=0xe
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7e
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_RUNERROR=0x5c
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_RUNL=0x52
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x84
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION=0xc1
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_CHARVESTERSERVER=0xb2
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_CONSTRUCTL=0xa0
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_NEWSESSIONL=0xb6
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_PAUSE=0xa3
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_RESUME=0xa4
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_THREADFUNCTION=0xbb
+[TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERSERVER_THREADFUNCTIONL=0xb9
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_BOOTSCANL=0x99
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x28
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4d
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8e
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x66
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x24
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HANDLESESSIONOPENED=0x3e
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HANDLEUNMOUNT=0x12
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HARVESTFILE=0x69
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HARVESTFILEWITHUID=0x74
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_HARVESTINGCOMPLETED=0x30
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7f
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_RUNERROR=0x5d
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_RUNL=0x53
+[TRACE]TRACE_NORMAL[0x3]_DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x85
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_BOOTSCANL=0x9a
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x29
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8f
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x25
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_HANDLESESSIONOPENED=0x3f
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_HANDLEUNMOUNT=0x13
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_HARVESTFILE=0x6a
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_HARVESTFILEWITHUID=0x75
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_HARVESTINGCOMPLETED=0x31
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN=0x80
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_RUNERROR=0x5e
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_RUNL=0x54
+[TRACE]TRACE_NORMAL[0x3]_DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x86
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_BOOTSCANL=0x9b
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2a
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x90
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_HANDLESESSIONOPENED=0x40
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_HANDLEUNMOUNT=0x14
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_HARVESTFILE=0x6b
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_HARVESTFILEWITHUID=0x76
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_HARVESTINGCOMPLETED=0x32
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN=0x81
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_RUNERROR=0x5f
+[TRACE]TRACE_NORMAL[0x3]_DUP4_CHARVESTERAO_RUNL=0x55
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_BOOTSCANL=0x9c
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2b
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x91
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_HANDLESESSIONOPENED=0x41
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_HANDLEUNMOUNT=0x15
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_HARVESTFILE=0x6c
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_HARVESTFILEWITHUID=0x77
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_HARVESTINGCOMPLETED=0x33
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN=0x82
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_RUNERROR=0xc4
+[TRACE]TRACE_NORMAL[0x3]_DUP5_CHARVESTERAO_RUNL=0x56
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2c
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_HANDLESESSIONOPENED=0x42
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_HANDLEUNMOUNT=0x16
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_HARVESTFILE=0x6d
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_HARVESTFILEWITHUID=0x78
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_HARVESTINGCOMPLETED=0x34
+[TRACE]TRACE_NORMAL[0x3]_DUP6_CHARVESTERAO_RUNL=0x57
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2d
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_HANDLESESSIONOPENED=0x43
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_HANDLEUNMOUNT=0x17
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_HARVESTFILE=0x6e
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_HARVESTFILEWITHUID=0x79
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_HARVESTINGCOMPLETED=0x35
+[TRACE]TRACE_NORMAL[0x3]_DUP7_CHARVESTERAO_RUNL=0x58
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2e
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_HANDLESESSIONOPENED=0x44
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_HANDLEUNMOUNT=0x18
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_HARVESTFILE=0x6f
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_HARVESTFILEWITHUID=0x7a
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_HARVESTINGCOMPLETED=0x36
+[TRACE]TRACE_NORMAL[0x3]_DUP8_CHARVESTERAO_RUNL=0x59
+[TRACE]TRACE_NORMAL[0x3]_DUP9_CHARVESTERAO_HANDLESESSIONOPENED=0x45
+[TRACE]TRACE_NORMAL[0x3]_DUP9_CHARVESTERAO_HARVESTFILE=0x70
+[TRACE]TRACE_NORMAL[0x3]_DUP9_CHARVESTERAO_HARVESTFILEWITHUID=0x7b
+[TRACE]TRACE_NORMAL[0x3]_DUP9_CHARVESTERAO_HARVESTINGCOMPLETED=0x37
+[TRACE]TRACE_NORMAL[0x3]__E32MAIN=0xbc
--- a/harvester/server/traces/harvesteraoTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/traces/harvesteraoTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTERAOTRACES_H__
@@ -6,164 +6,165 @@
 
 #define KOstTraceComponentID 0x200009f5
 
-#define CHARVESTERAO_NEWLC 0x860001
-#define CHARVESTERAO_NEWL 0x860002
-#define CHARVESTERAO_CHARVESTERAO 0x860003
-#define DUP1_CHARVESTERAO_CHARVESTERAO 0x860004
-#define CHARVESTERAO_CONSTRUCTL 0x860005
-#define DUP1_CHARVESTERAO_CONSTRUCTL 0x860006
-#define CHARVESTERAO_LOADMONITORPLUGINSL 0x860007
-#define DUP1_CHARVESTERAO_LOADMONITORPLUGINSL 0x860008
-#define CHARVESTERAO_DELETEMONITORPLUGINS 0x860009
-#define DUP1_CHARVESTERAO_DELETEMONITORPLUGINS 0x86000a
-#define CHARVESTERAO_STARTMONITORING 0x86000b
-#define CHARVESTERAO_STOPMONITORING 0x86000c
-#define CHARVESTERAO_PAUSEMONITORING 0x86000d
-#define DUP1_CHARVESTERAO_PAUSEMONITORING 0x86000e
-#define CHARVESTERAO_RESUMEMONITORING 0x86000f
-#define CHARVESTERAO_HANDLEUNMOUNT 0x860010
-#define DUP1_CHARVESTERAO_HANDLEUNMOUNT 0x860011
-#define DUP2_CHARVESTERAO_HANDLEUNMOUNT 0x860012
-#define DUP3_CHARVESTERAO_HANDLEUNMOUNT 0x860013
-#define DUP4_CHARVESTERAO_HANDLEUNMOUNT 0x860014
-#define DUP5_CHARVESTERAO_HANDLEUNMOUNT 0x860015
-#define DUP6_CHARVESTERAO_HANDLEUNMOUNT 0x860016
-#define DUP7_CHARVESTERAO_HANDLEUNMOUNT 0x860017
-#define DUP8_CHARVESTERAO_HANDLEUNMOUNT 0x860018
-#define DUP10_CHARVESTERAO_HANDLEUNMOUNT 0x860019
-#define DUP11_CHARVESTERAO_HANDLEUNMOUNT 0x86001a
-#define DUP12_CHARVESTERAO_HANDLEUNMOUNT 0x86001b
-#define DUP13_CHARVESTERAO_HANDLEUNMOUNT 0x86001c
-#define CHARVESTERAO_STARTCOMPOSERSL 0x86001d
-#define CHARVESTERAO_STOPCOMPOSERS 0x86001e
-#define CHARVESTERAO_DELETECOMPOSERS 0x86001f
-#define CHARVESTERAO_ISCOMPOSINGREADY 0x860020
-#define CHARVESTERAO_READITEMFROMQUEUEL 0x860021
-#define CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860022
-#define DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860023
-#define DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860024
-#define DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860025
-#define CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860026
-#define DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860027
-#define DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860028
-#define DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860029
-#define DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002a
-#define DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002b
-#define DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002c
-#define DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002d
-#define DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002e
-#define CHARVESTERAO_HARVESTINGCOMPLETED 0x86002f
-#define DUP2_CHARVESTERAO_HARVESTINGCOMPLETED 0x860030
-#define DUP3_CHARVESTERAO_HARVESTINGCOMPLETED 0x860031
-#define DUP4_CHARVESTERAO_HARVESTINGCOMPLETED 0x860032
-#define DUP5_CHARVESTERAO_HARVESTINGCOMPLETED 0x860033
-#define DUP6_CHARVESTERAO_HARVESTINGCOMPLETED 0x860034
-#define DUP7_CHARVESTERAO_HARVESTINGCOMPLETED 0x860035
-#define DUP8_CHARVESTERAO_HARVESTINGCOMPLETED 0x860036
-#define DUP9_CHARVESTERAO_HARVESTINGCOMPLETED 0x860037
-#define DUP1_CHARVESTERAO_HARVESTINGCOMPLETED 0x860038
-#define DUP10_CHARVESTERAO_HARVESTINGCOMPLETED 0x860039
-#define DUP11_CHARVESTERAO_HARVESTINGCOMPLETED 0x86003a
-#define DUP12_CHARVESTERAO_HARVESTINGCOMPLETED 0x86003b
-#define CHARVESTERAO_HANDLESESSIONOPENED 0x86003c
-#define DUP1_CHARVESTERAO_HANDLESESSIONOPENED 0x86003d
-#define DUP2_CHARVESTERAO_HANDLESESSIONOPENED 0x86003e
-#define DUP3_CHARVESTERAO_HANDLESESSIONOPENED 0x86003f
-#define DUP4_CHARVESTERAO_HANDLESESSIONOPENED 0x860040
-#define DUP5_CHARVESTERAO_HANDLESESSIONOPENED 0x860041
-#define DUP6_CHARVESTERAO_HANDLESESSIONOPENED 0x860042
-#define DUP7_CHARVESTERAO_HANDLESESSIONOPENED 0x860043
-#define DUP8_CHARVESTERAO_HANDLESESSIONOPENED 0x860044
-#define DUP9_CHARVESTERAO_HANDLESESSIONOPENED 0x860045
-#define DUP10_CHARVESTERAO_HANDLESESSIONOPENED 0x860046
-#define DUP11_CHARVESTERAO_HANDLESESSIONOPENED 0x860047
-#define DUP12_CHARVESTERAO_HANDLESESSIONOPENED 0x860048
-#define DUP13_CHARVESTERAO_HANDLESESSIONOPENED 0x860049
-#define CHARVESTERAO_HANDLESESSIONERROR 0x86004a
-#define CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x86004b
-#define DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x86004c
-#define DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x86004d
-#define CHARVESTERAO_PAUSEHARVESTER 0x86004e
-#define DUP1_CHARVESTERAO_PAUSEHARVESTER 0x86004f
-#define CHARVESTERAO_RESUMEHARVESTERL 0x860050
-#define CHARVESTERAO_RUNL 0x860051
-#define DUP1_CHARVESTERAO_RUNL 0x860052
-#define DUP2_CHARVESTERAO_RUNL 0x860053
-#define DUP3_CHARVESTERAO_RUNL 0x860054
-#define DUP4_CHARVESTERAO_RUNL 0x860055
-#define DUP5_CHARVESTERAO_RUNL 0x860056
-#define DUP6_CHARVESTERAO_RUNL 0x860057
-#define DUP7_CHARVESTERAO_RUNL 0x860058
-#define DUP8_CHARVESTERAO_RUNL 0x860059
-#define CHARVESTERAO_DOCANCEL 0x86005a
-#define CHARVESTERAO_RUNERROR 0x86005b
-#define DUP1_CHARVESTERAO_RUNERROR 0x86005c
-#define DUP2_CHARVESTERAO_RUNERROR 0x86005d
-#define DUP3_CHARVESTERAO_RUNERROR 0x86005e
-#define DUP4_CHARVESTERAO_RUNERROR 0x86005f
-#define CHARVESTERAO_SETNEXTREQUEST 0x860060
-#define CHARVESTERAO_ISSERVERPAUSED 0x860061
-#define CHARVESTERAO_BACKUPRESTORESTART 0x860062
-#define CHARVESTERAO_BACKUPRESTOREREADY 0x860063
-#define CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x860064
-#define DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x860065
-#define DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x860066
-#define CHARVESTERAO_HARVESTFILE 0x860067
-#define DUP1_CHARVESTERAO_HARVESTFILE 0x860068
-#define DUP2_CHARVESTERAO_HARVESTFILE 0x860069
-#define DUP3_CHARVESTERAO_HARVESTFILE 0x86006a
-#define DUP4_CHARVESTERAO_HARVESTFILE 0x86006b
-#define DUP5_CHARVESTERAO_HARVESTFILE 0x86006c
-#define DUP6_CHARVESTERAO_HARVESTFILE 0x86006d
-#define DUP7_CHARVESTERAO_HARVESTFILE 0x86006e
-#define DUP8_CHARVESTERAO_HARVESTFILE 0x86006f
-#define DUP9_CHARVESTERAO_HARVESTFILE 0x860070
-#define DUP10_CHARVESTERAO_HARVESTFILE 0x860071
-#define CHARVESTERAO_HARVESTFILEWITHUID 0x860072
-#define DUP1_CHARVESTERAO_HARVESTFILEWITHUID 0x860073
-#define DUP2_CHARVESTERAO_HARVESTFILEWITHUID 0x860074
-#define DUP3_CHARVESTERAO_HARVESTFILEWITHUID 0x860075
-#define DUP4_CHARVESTERAO_HARVESTFILEWITHUID 0x860076
-#define DUP5_CHARVESTERAO_HARVESTFILEWITHUID 0x860077
-#define DUP6_CHARVESTERAO_HARVESTFILEWITHUID 0x860078
-#define DUP7_CHARVESTERAO_HARVESTFILEWITHUID 0x860079
-#define DUP8_CHARVESTERAO_HARVESTFILEWITHUID 0x86007a
-#define DUP9_CHARVESTERAO_HARVESTFILEWITHUID 0x86007b
-#define DUP10_CHARVESTERAO_HARVESTFILEWITHUID 0x86007c
-#define CHARVESTERAO_REGISTERPROCESSORIGIN 0x86007d
-#define DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN 0x86007e
-#define DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN 0x86007f
-#define DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN 0x860080
-#define DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN 0x860081
-#define DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN 0x860082
-#define CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860083
-#define DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860084
-#define DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860085
-#define DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860086
-#define CHARVESTERAO_REGISTERHARVESTCOMPLETE 0x860087
-#define CHARVESTERAO_UNREGISTERHARVESTCOMPLETE 0x860088
-#define CHARVESTERAO_REGISTERHARVESTEREVENT 0x860089
-#define CHARVESTERAO_UNREGISTERHARVESTEREVENT 0x86008a
-#define CHARVESTERAO_GETLASTOBSERVERID 0x86008b
-#define CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008c
-#define DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008d
-#define DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008e
-#define DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008f
-#define DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x860090
-#define DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x860091
-#define CHARVESTERAO_HARVESTCOMPLETED 0x860092
-#define DUP1_CHARVESTERAO_HARVESTCOMPLETED 0x860093
-#define CHARVESTERAO_BOOTROMSCANL 0x860094
-#define CHARVESTERAO_BOOTPARTIALRESTORESCANL 0x860095
-#define DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL 0x860096
-#define CHARVESTERAO_BOOTSCANL 0x860097
-#define DUP1_CHARVESTERAO_BOOTSCANL 0x860098
-#define DUP2_CHARVESTERAO_BOOTSCANL 0x860099
-#define DUP3_CHARVESTERAO_BOOTSCANL 0x86009a
-#define DUP4_CHARVESTERAO_BOOTSCANL 0x86009b
-#define DUP5_CHARVESTERAO_BOOTSCANL 0x86009c
-#define CHARVESTERAO_MEMORYLOW 0x86009d
-#define CHARVESTERAO_MEMORYGOOD 0x86009e
+#define CHARVESTERAO_NEWLC 0x30001
+#define CHARVESTERAO_NEWL 0x30002
+#define CHARVESTERAO_CHARVESTERAO 0x30003
+#define DUP1_CHARVESTERAO_CHARVESTERAO 0x30004
+#define CHARVESTERAO_CONSTRUCTL 0x30005
+#define DUP1_CHARVESTERAO_CONSTRUCTL 0x30006
+#define CHARVESTERAO_LOADMONITORPLUGINSL 0x30007
+#define DUP1_CHARVESTERAO_LOADMONITORPLUGINSL 0x30008
+#define CHARVESTERAO_DELETEMONITORPLUGINS 0x30009
+#define DUP1_CHARVESTERAO_DELETEMONITORPLUGINS 0x3000a
+#define CHARVESTERAO_STARTMONITORING 0x3000b
+#define CHARVESTERAO_STOPMONITORING 0x3000c
+#define CHARVESTERAO_PAUSEMONITORING 0x3000d
+#define DUP1_CHARVESTERAO_PAUSEMONITORING 0x3000e
+#define CHARVESTERAO_RESUMEMONITORING 0x3000f
+#define CHARVESTERAO_HANDLEUNMOUNT 0x30010
+#define DUP1_CHARVESTERAO_HANDLEUNMOUNT 0x30011
+#define DUP2_CHARVESTERAO_HANDLEUNMOUNT 0x30012
+#define DUP3_CHARVESTERAO_HANDLEUNMOUNT 0x30013
+#define DUP4_CHARVESTERAO_HANDLEUNMOUNT 0x30014
+#define DUP5_CHARVESTERAO_HANDLEUNMOUNT 0x30015
+#define DUP6_CHARVESTERAO_HANDLEUNMOUNT 0x30016
+#define DUP7_CHARVESTERAO_HANDLEUNMOUNT 0x30017
+#define DUP8_CHARVESTERAO_HANDLEUNMOUNT 0x30018
+#define DUP10_CHARVESTERAO_HANDLEUNMOUNT 0x30019
+#define DUP11_CHARVESTERAO_HANDLEUNMOUNT 0x3001a
+#define DUP12_CHARVESTERAO_HANDLEUNMOUNT 0x3001b
+#define DUP13_CHARVESTERAO_HANDLEUNMOUNT 0x3001c
+#define CHARVESTERAO_STARTCOMPOSERSL 0x3001d
+#define CHARVESTERAO_STOPCOMPOSERS 0x3001e
+#define CHARVESTERAO_DELETECOMPOSERS 0x3001f
+#define CHARVESTERAO_ISCOMPOSINGREADY 0x30020
+#define CHARVESTERAO_READITEMFROMQUEUEL 0x30021
+#define CHARVESTERAO_HANDLEPLACEHOLDERSL 0x30022
+#define DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x30023
+#define DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x30024
+#define DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x30025
+#define CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x30026
+#define DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x30027
+#define DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x30028
+#define DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x30029
+#define DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x3002a
+#define DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x3002b
+#define DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x3002c
+#define DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x3002d
+#define DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x3002e
+#define CHARVESTERAO_HARVESTINGCOMPLETED 0x3002f
+#define DUP2_CHARVESTERAO_HARVESTINGCOMPLETED 0x30030
+#define DUP3_CHARVESTERAO_HARVESTINGCOMPLETED 0x30031
+#define DUP4_CHARVESTERAO_HARVESTINGCOMPLETED 0x30032
+#define DUP5_CHARVESTERAO_HARVESTINGCOMPLETED 0x30033
+#define DUP6_CHARVESTERAO_HARVESTINGCOMPLETED 0x30034
+#define DUP7_CHARVESTERAO_HARVESTINGCOMPLETED 0x30035
+#define DUP8_CHARVESTERAO_HARVESTINGCOMPLETED 0x30036
+#define DUP9_CHARVESTERAO_HARVESTINGCOMPLETED 0x30037
+#define DUP1_CHARVESTERAO_HARVESTINGCOMPLETED 0x30038
+#define DUP10_CHARVESTERAO_HARVESTINGCOMPLETED 0x30039
+#define DUP11_CHARVESTERAO_HARVESTINGCOMPLETED 0x3003a
+#define DUP12_CHARVESTERAO_HARVESTINGCOMPLETED 0x3003b
+#define CHARVESTERAO_HANDLESESSIONOPENED 0x3003c
+#define DUP1_CHARVESTERAO_HANDLESESSIONOPENED 0x3003d
+#define DUP2_CHARVESTERAO_HANDLESESSIONOPENED 0x3003e
+#define DUP3_CHARVESTERAO_HANDLESESSIONOPENED 0x3003f
+#define DUP4_CHARVESTERAO_HANDLESESSIONOPENED 0x30040
+#define DUP5_CHARVESTERAO_HANDLESESSIONOPENED 0x30041
+#define DUP6_CHARVESTERAO_HANDLESESSIONOPENED 0x30042
+#define DUP7_CHARVESTERAO_HANDLESESSIONOPENED 0x30043
+#define DUP8_CHARVESTERAO_HANDLESESSIONOPENED 0x30044
+#define DUP9_CHARVESTERAO_HANDLESESSIONOPENED 0x30045
+#define DUP10_CHARVESTERAO_HANDLESESSIONOPENED 0x30046
+#define DUP11_CHARVESTERAO_HANDLESESSIONOPENED 0x30047
+#define DUP12_CHARVESTERAO_HANDLESESSIONOPENED 0x30048
+#define DUP13_CHARVESTERAO_HANDLESESSIONOPENED 0x30049
+#define CHARVESTERAO_HANDLESESSIONERROR 0x3004a
+#define CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x3004b
+#define DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x3004c
+#define DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x3004d
+#define CHARVESTERAO_PAUSEHARVESTER 0x3004e
+#define DUP1_CHARVESTERAO_PAUSEHARVESTER 0x3004f
+#define CHARVESTERAO_RESUMEHARVESTERL 0x30050
+#define CHARVESTERAO_RUNL 0x30051
+#define DUP1_CHARVESTERAO_RUNL 0x30052
+#define DUP2_CHARVESTERAO_RUNL 0x30053
+#define DUP3_CHARVESTERAO_RUNL 0x30054
+#define DUP4_CHARVESTERAO_RUNL 0x30055
+#define DUP5_CHARVESTERAO_RUNL 0x30056
+#define DUP6_CHARVESTERAO_RUNL 0x30057
+#define DUP7_CHARVESTERAO_RUNL 0x30058
+#define DUP8_CHARVESTERAO_RUNL 0x30059
+#define CHARVESTERAO_DOCANCEL 0x3005a
+#define CHARVESTERAO_RUNERROR 0x3005b
+#define DUP1_CHARVESTERAO_RUNERROR 0x3005c
+#define DUP2_CHARVESTERAO_RUNERROR 0x3005d
+#define DUP3_CHARVESTERAO_RUNERROR 0x3005e
+#define DUP4_CHARVESTERAO_RUNERROR 0x3005f
+#define CHARVESTERAO_SETNEXTREQUEST 0x30060
+#define CHARVESTERAO_ISSERVERPAUSED 0x30061
+#define CHARVESTERAO_BACKUPRESTORESTART 0x30062
+#define CHARVESTERAO_BACKUPRESTOREREADY 0x30063
+#define CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x30064
+#define DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x30065
+#define DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x30066
+#define CHARVESTERAO_HARVESTFILE 0x30067
+#define DUP1_CHARVESTERAO_HARVESTFILE 0x30068
+#define DUP2_CHARVESTERAO_HARVESTFILE 0x30069
+#define DUP3_CHARVESTERAO_HARVESTFILE 0x3006a
+#define DUP4_CHARVESTERAO_HARVESTFILE 0x3006b
+#define DUP5_CHARVESTERAO_HARVESTFILE 0x3006c
+#define DUP6_CHARVESTERAO_HARVESTFILE 0x3006d
+#define DUP7_CHARVESTERAO_HARVESTFILE 0x3006e
+#define DUP8_CHARVESTERAO_HARVESTFILE 0x3006f
+#define DUP9_CHARVESTERAO_HARVESTFILE 0x30070
+#define DUP10_CHARVESTERAO_HARVESTFILE 0x30071
+#define CHARVESTERAO_HARVESTFILEWITHUID 0x30072
+#define DUP1_CHARVESTERAO_HARVESTFILEWITHUID 0x30073
+#define DUP2_CHARVESTERAO_HARVESTFILEWITHUID 0x30074
+#define DUP3_CHARVESTERAO_HARVESTFILEWITHUID 0x30075
+#define DUP4_CHARVESTERAO_HARVESTFILEWITHUID 0x30076
+#define DUP5_CHARVESTERAO_HARVESTFILEWITHUID 0x30077
+#define DUP6_CHARVESTERAO_HARVESTFILEWITHUID 0x30078
+#define DUP7_CHARVESTERAO_HARVESTFILEWITHUID 0x30079
+#define DUP8_CHARVESTERAO_HARVESTFILEWITHUID 0x3007a
+#define DUP9_CHARVESTERAO_HARVESTFILEWITHUID 0x3007b
+#define DUP10_CHARVESTERAO_HARVESTFILEWITHUID 0x3007c
+#define CHARVESTERAO_REGISTERPROCESSORIGIN 0x3007d
+#define DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN 0x3007e
+#define DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN 0x3007f
+#define DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN 0x30080
+#define DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN 0x30081
+#define DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN 0x30082
+#define CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x30083
+#define DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x30084
+#define DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x30085
+#define DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x30086
+#define CHARVESTERAO_REGISTERHARVESTCOMPLETE 0x30087
+#define CHARVESTERAO_UNREGISTERHARVESTCOMPLETE 0x30088
+#define CHARVESTERAO_REGISTERHARVESTEREVENT 0x30089
+#define CHARVESTERAO_UNREGISTERHARVESTEREVENT 0x3008a
+#define CHARVESTERAO_GETLASTOBSERVERID 0x3008b
+#define CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x3008c
+#define DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x3008d
+#define DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x3008e
+#define DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x3008f
+#define DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x30090
+#define DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x30091
+#define CHARVESTERAO_HARVESTCOMPLETED 0x30092
+#define DUP1_CHARVESTERAO_HARVESTCOMPLETED 0x30093
+#define CHARVESTERAO_BOOTROMSCANL 0x30094
+#define CHARVESTERAO_BOOTPARTIALRESTORESCANL 0x30095
+#define DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL 0x30096
+#define CHARVESTERAO_BOOTSCANL 0x30097
+#define DUP1_CHARVESTERAO_BOOTSCANL 0x30098
+#define DUP2_CHARVESTERAO_BOOTSCANL 0x30099
+#define DUP3_CHARVESTERAO_BOOTSCANL 0x3009a
+#define DUP4_CHARVESTERAO_BOOTSCANL 0x3009b
+#define DUP5_CHARVESTERAO_BOOTSCANL 0x3009c
+#define CHARVESTERAO_MEMORYLOW 0x3009d
+#define CHARVESTERAO_MEMORYGOOD 0x3009e
+#define DUP5_CHARVESTERAO_RUNERROR 0x300c4
 
 
 #endif
--- a/harvester/server/traces/harvesterserverTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/traces/harvesterserverTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTERSERVERTRACES_H__
@@ -6,36 +6,36 @@
 
 #define KOstTraceComponentID 0x200009f5
 
-#define CHARVESTERSERVER_CONSTRUCTL 0x86009f
-#define DUP1_CHARVESTERSERVER_CONSTRUCTL 0x8600a0
-#define CHARVESTERSERVER_PAUSE 0x8600a1
-#define CHARVESTERSERVER_RESUME 0x8600a2
-#define DUP1_CHARVESTERSERVER_PAUSE 0x8600a3
-#define DUP1_CHARVESTERSERVER_RESUME 0x8600a4
-#define CHARVESTERSERVER_PAUSEREADY 0x8600a5
-#define CHARVESTERSERVER_RESUMEREADY 0x8600a6
-#define CHARVESTERSERVER_SHUTDOWNNOTIFICATION 0x8600a7
-#define CHARVESTERSERVER_RESTARTNOTIFICATION 0x8600a8
-#define CHARVESTERSERVER_HARVESTFILE 0x8600a9
-#define CHARVESTERSERVER_HARVESTFILEWITHUID 0x8600aa
-#define CHARVESTERSERVER_REGISTERPROCESSORIGIN 0x8600ab
-#define CHARVESTERSERVER_UNREGISTERPROCESSORIGIN 0x8600ac
-#define CHARVESTERSERVER_REGISTERHARVESTCOMPLETE 0x8600ad
-#define CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE 0x8600ae
-#define CHARVESTERSERVER_REGISTERHARVESTEREVENT 0x8600af
-#define CHARVESTERSERVER_UNREGISTERHARVESTEREVENT 0x8600b0
-#define CHARVESTERSERVER_CHARVESTERSERVER 0x8600b1
-#define DUP1_CHARVESTERSERVER_CHARVESTERSERVER 0x8600b2
-#define CHARVESTERSERVER_PANICCLIENT 0x8600b3
-#define CHARVESTERSERVER_PANICSERVER 0x8600b4
-#define CHARVESTERSERVER_NEWSESSIONL 0x8600b5
-#define DUP1_CHARVESTERSERVER_NEWSESSIONL 0x8600b6
-#define CHARVESTERSERVER_RUNERROR 0x8600b7
-#define CHARVESTERSERVER_THREADFUNCTIONL 0x8600b8
-#define DUP1_CHARVESTERSERVER_THREADFUNCTIONL 0x8600b9
-#define CHARVESTERSERVER_THREADFUNCTION 0x8600ba
-#define DUP1_CHARVESTERSERVER_THREADFUNCTION 0x8600bb
-#define _E32MAIN 0x8600bc
+#define CHARVESTERSERVER_CONSTRUCTL 0x3009f
+#define DUP1_CHARVESTERSERVER_CONSTRUCTL 0x300a0
+#define CHARVESTERSERVER_PAUSE 0x300a1
+#define CHARVESTERSERVER_RESUME 0x300a2
+#define DUP1_CHARVESTERSERVER_PAUSE 0x300a3
+#define DUP1_CHARVESTERSERVER_RESUME 0x300a4
+#define CHARVESTERSERVER_PAUSEREADY 0x300a5
+#define CHARVESTERSERVER_RESUMEREADY 0x300a6
+#define CHARVESTERSERVER_SHUTDOWNNOTIFICATION 0x300a7
+#define CHARVESTERSERVER_RESTARTNOTIFICATION 0x300a8
+#define CHARVESTERSERVER_HARVESTFILE 0x300a9
+#define CHARVESTERSERVER_HARVESTFILEWITHUID 0x300aa
+#define CHARVESTERSERVER_REGISTERPROCESSORIGIN 0x300ab
+#define CHARVESTERSERVER_UNREGISTERPROCESSORIGIN 0x300ac
+#define CHARVESTERSERVER_REGISTERHARVESTCOMPLETE 0x300ad
+#define CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE 0x300ae
+#define CHARVESTERSERVER_REGISTERHARVESTEREVENT 0x300af
+#define CHARVESTERSERVER_UNREGISTERHARVESTEREVENT 0x300b0
+#define CHARVESTERSERVER_CHARVESTERSERVER 0x300b1
+#define DUP1_CHARVESTERSERVER_CHARVESTERSERVER 0x300b2
+#define CHARVESTERSERVER_PANICCLIENT 0x300b3
+#define CHARVESTERSERVER_PANICSERVER 0x300b4
+#define CHARVESTERSERVER_NEWSESSIONL 0x300b5
+#define DUP1_CHARVESTERSERVER_NEWSESSIONL 0x300b6
+#define CHARVESTERSERVER_RUNERROR 0x300b7
+#define CHARVESTERSERVER_THREADFUNCTIONL 0x300b8
+#define DUP1_CHARVESTERSERVER_THREADFUNCTIONL 0x300b9
+#define CHARVESTERSERVER_THREADFUNCTION 0x300ba
+#define DUP1_CHARVESTERSERVER_THREADFUNCTION 0x300bb
+#define _E32MAIN 0x300bc
 
 
 #endif
--- a/harvester/server/traces/harvesterserversessionTraces.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/server/traces/harvesterserversessionTraces.h	Wed Aug 18 10:12:07 2010 +0300
@@ -1,4 +1,4 @@
-// Created by TraceCompiler 2.2.3
+// Created by TraceCompiler 1.3.1
 // DO NOT EDIT, CHANGES WILL BE LOST
 
 #ifndef __HARVESTERSERVERSESSIONTRACES_H__
@@ -6,13 +6,13 @@
 
 #define KOstTraceComponentID 0x200009f5
 
-#define CHARVESTERSERVERSESSION_NEWL 0x8600bd
-#define CHARVESTERSERVERSESSION_NEWLC 0x8600be
-#define CHARVESTERSERVERSESSION_CONSTRUCTL 0x8600bf
-#define CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION 0x8600c0
-#define DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION 0x8600c1
-#define CHARVESTERSERVERSESSION_SERVICEL 0x8600c2
-#define CHARVESTERSERVERSESSION_DISCONNECT 0x8600c3
+#define CHARVESTERSERVERSESSION_NEWL 0x300bd
+#define CHARVESTERSERVERSESSION_NEWLC 0x300be
+#define CHARVESTERSERVERSESSION_CONSTRUCTL 0x300bf
+#define CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION 0x300c0
+#define DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION 0x300c1
+#define CHARVESTERSERVERSESSION_SERVICEL 0x300c2
+#define CHARVESTERSERVERSESSION_DISCONNECT 0x300c3
 
 
 #endif
--- a/iadstoprestart/src/iadrestart.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/iadstoprestart/src/iadrestart.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -55,6 +55,7 @@
     TRAP(err, MainL());
 
     delete cleanup;
+    cleanup = NULL;
     __UHEAP_MARKEND;
     return err;
     }
--- a/iadstoprestart/src/iadstop.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/iadstoprestart/src/iadstop.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -158,6 +158,7 @@
     TRAP(err, MainL());
 
     delete cleanup;
+    cleanup = NULL;
     __UHEAP_MARKEND;
     return err;
     }
--- a/inc/mdscommoninternal.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/inc/mdscommoninternal.h	Wed Aug 18 10:12:07 2010 +0300
@@ -50,7 +50,7 @@
 
 const TInt KMaxTitleFieldLength = 255;
 
-const TInt KTriggerDbMaintenanceTreasholdValue( 2500 );
+const TInt KTriggerDbMaintenanceTreasholdValue( 3000 );
 
 _LIT( KMdSServerName,"!MdSServer" ); // Server name
 _LIT( KMdSServerProcessString,"!MdSServer*" ); 
--- a/inc/mdssqliteconnection.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/inc/mdssqliteconnection.h	Wed Aug 18 10:12:07 2010 +0300
@@ -237,11 +237,15 @@
 
         /**
         * cleanup method (from TBase)
-        * according to status does Commit/Rollback/nothing
+        * according to status does Rollback or nothing if commit was succesfull
         */
         inline void Close()
             {
-            if ( iErrorState != KErrNone )
+            // Internal error state is KErrNone if the transaction could be created successfully,
+            // and the state is resetted if the transaction is committed succesfully. Only if the
+            // transaction is started succesfully but not committed, it needs to be rolled back
+            // to close the ongoing transaction
+            if ( iErrorState == KErrNone )
                 {
                 TRAP( iErrorState, iConnection.TransactionRollbackL() );
                 }
@@ -259,17 +263,6 @@
             }
 
         /**
-        * Rolls back the transaction explicitly
-        * - possibility to receive leave
-        * eliminates actions on destructor.
-        */
-        inline void RollbackL()
-            {
-            iConnection.TransactionRollbackL();
-            Reset();
-            }
-
-        /**
         * Resets the transaction
         * (does not commit or rollback or do anything)
         */
--- a/locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss	Wed Aug 18 10:12:07 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-#include <ecom/RegistryInfo.rh>
+#include <ecom/registryinfo.rh>
 
 RESOURCE REGISTRY_INFO theInfo
     {
--- a/locationmanager/ReverseGeoCoderPlugin/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeoCoderPlugin/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -19,7 +19,7 @@
 
 
 PRJ_EXPORTS
-
+       
 
 PRJ_MMPFILES
 reversegeocoderplugin.mmp
--- a/locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -25,15 +25,15 @@
 UID 0x10009D8D 0x2002DD11
 CAPABILITY CAP_ECOM_PLUGIN
 
-SOURCEPATH      ..\src
+SOURCEPATH      ../src
 SOURCE		proxy.cpp
 SOURCE		reversegeocoderplugin.cpp
 
 
-USERINCLUDE     ..\inc
-USERINCLUDE     ..\..\inc
-USERINCLUDE     ..\..\..\inc
-USERINCLUDE     ..\..\ReverseGeocode\inc
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+USERINCLUDE     ../../../inc
+USERINCLUDE     ../../ReverseGeocode/inc
 
 
 MW_LAYER_SYSTEMINCLUDE
@@ -41,7 +41,7 @@
 
 
 SOURCEPATH      ../data
-START RESOURCE  2002DD11.RSS
+START RESOURCE  2002DD11.rss
 TARGET          reversegeocoderplugin.rsc
 END
 
Binary file locationmanager/ReverseGeoCoderPlugin/sis/ReverseGeoCoderPlugin_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/ReverseGeoCoderPlugin/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for ReverseGeoCoderPlugin</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/ReverseGeoCoderPlugin/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"ReverseGeoCoder Plugin Patch"},(0x2002DD11), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll"
+"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/ReverseGeoCoderPlugin/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"reversegeocoderplugin"}, (0x2002DD11), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/ReverseGeocode/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeocode/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -19,6 +19,8 @@
 DEFAULT
 
 PRJ_EXPORTS
+     
 
 PRJ_MMPFILES
-ReverseGeocode.mmp
+reversegeocode.mmp
+
--- a/locationmanager/ReverseGeocode/group/reversegeocode.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeocode/group/reversegeocode.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -20,7 +20,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/reversegeocodewinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/reversegeocodearm.def
 #endif
 nostrictdef
--- a/locationmanager/ReverseGeocode/inc/internalreversegeocode.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeocode/inc/internalreversegeocode.h	Wed Aug 18 10:12:07 2010 +0300
@@ -33,72 +33,70 @@
                     public MConnectionTimeoutHandlerInterface
     {
 public:
-    /**
-        * Factory function to create the instance
-        * @param aObserver The observer instance that is to be notified when reverse geocoding is over
-        * @return A pointer to the CInternalReverseGeocode instance
-        */
+   /**
+    * Factory function to create the instance
+    * @param aObserver The observer instance that is to be notified when reverse geocoding is over
+    * @return A pointer to the CInternalReverseGeocode instance
+    */
     static CInternalReverseGeocode* NewL( MReverseGeocodeObserver& aObserver );
 
-    /**
-        * Gets the address for the given geo-coordinaates.
-        * @param aLocality  The locality information
-        *		   aOption    The connection option whether 	its silent or not
-        */			
+   /**
+    * Gets the address for the given geo-coordinaates.
+    * @param aLocality  The locality information
+    *		   aOption    The connection option whether 	its silent or not
+    */			
     virtual void GetAddressByCoordinateL( TLocality aLocality, const TConnectionOption aOption );
 
     /**
-        * Checks if a silent connection is allowed
-        * @return ETrue If silentconnection is allowed
-        */	
+     * Checks if a silent connection is allowed
+     * @return ETrue If silentconnection is allowed
+     */	
     virtual TBool SilentConnectionAllowed();
-    
-    
-    /**
-        * Helper function to get the appropriate language for the request.
-        * @param aLanguage  The language for the request 
-        */    
+   
+   /**
+    * Helper function to get the appropriate language for the request.
+    * @param aLanguage  The language for the request 
+    */    
     void GetLanguageForTheRequest( TDes8& aLanguage );
 
 
-    /**
-        * destructor
-        *
-        */	
+   /**
+    * destructor
+    *
+    */	
     ~CInternalReverseGeocode();
 
-    // MConnectionTimeoutHandlerInterface
-    /**
-        * Closes the connection once it times out
-        * @param aErrorCode The Error code
-        */    
+   // MConnectionTimeoutHandlerInterface
+   /**
+    * Closes the connection once it times out
+    * @param aErrorCode The Error code
+    */    
     void HandleTimedoutEvent(TInt aErrorCode);
     
 protected:
    
-    /**
-        * Second phase construction
-        */    
+   /**
+    * Second phase construction
+    */    
     void ConstructL();
-        
-    
+  
     /**
-        * First phase construction.
-        * @param aObserver The observer instance that is to be notified when reverse geocoding is over
-        */    
+    * First phase construction.
+    * @param aObserver The observer instance that is to be notified when reverse geocoding is over
+    */    
     CInternalReverseGeocode( MReverseGeocodeObserver& aObserver );
         
     //From MClientObserver
     /**
-        * callback which notifies progess of HTTP request
-        * @param aEvent The Httpstatus
-        */    
+    * callback which notifies progess of HTTP request
+    * @param aEvent The Httpstatus
+    */    
     void ClientEvent( const THttpStatus& aEvent );
 	
     /**
-        * callback through which the HTTP body data is recieved. 
-        * @param aBodyData The body recieved
-        */	
+    * callback through which the HTTP body data is recieved. 
+    * @param aBodyData The body recieved
+    */	
     void ClientBodyReceived(const TDesC8& aBodyData);
 
     /*
@@ -110,10 +108,10 @@
 
     //From MXmlHandlerObserver    
     /**
-        * callback which notifys the completion of parsing.
-        * @param aError The err code
-        * 		   aAddressInfo The address info obtained after parsing
-        */    
+    * callback which notifys the completion of parsing.
+    * @param aError The err code
+    * 		   aAddressInfo The address info obtained after parsing
+    */    
     void OnParseCompletedL( TInt aError, MAddressInfo& aAddressInfo ); 
     
     /*
@@ -135,13 +133,13 @@
 private:
 
     /**
-        * Starts the timer
-        */		
+     * Starts the timer
+     */		
     void StartTimer();
 
     /**
-        * Closes the http connection and notifies the observer
-        */	
+     * Closes the http connection and notifies the observer
+     */	
     void CloseConnection();
 
 private:
Binary file locationmanager/ReverseGeocode/sis/ReverseGeocode_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/ReverseGeocode/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for ReverseGeocode</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/ReverseGeocode/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"ReverseGeocode Patch"},(0xEF7E39A4), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/ReverseGeocode/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"reversegeocode"}, (0xEF7E39A4), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -46,7 +46,7 @@
     CConnectionTimerHandler* self = new( ELeave ) CConnectionTimerHandler(aConnectionTimeoutHandlerInterface);
        CleanupStack::PushL( self );
        self->ConstructL();
-       CleanupStack::Pop();
+       CleanupStack::Pop(); // self
        
        return self;
     }
--- a/locationmanager/ReverseGeocode/src/internalreversegeocode.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeocode/src/internalreversegeocode.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -281,8 +281,8 @@
 // ---------------------------------------------------------------------------- 
 void CInternalReverseGeocode::ClientEvent( const THttpStatus& aEvent )
     {
-    LOG( "CInternalReverseGeocode::ClientEvent,begin" );
-    TInt err;
+    LOG1( "CInternalReverseGeocode::ClientEvent,begin. Err - %d", aEvent);
+    TInt err = KErrNone;
     //Have a Switch here
     switch( aEvent )
         {
@@ -319,6 +319,11 @@
             iObserver.ReverseGeocodeComplete( err , *iAddressInfo );
             break;
         }
+    if(err != KErrNone)
+        {
+        LOG("Error occur while getting data.");
+        StartTimer();
+        }
 	LOG( "CInternalReverseGeocode::ClientEvent,end" );
     }
 
@@ -420,7 +425,6 @@
     return retVal;
     }
 
-
 // ----------------------------------------------------------------------------
 // CInternalReverseGeocode::GetCurrentRegisterNw()
 // ---------------------------------------------------------------------------- 
--- a/locationmanager/ReverseGeocode/src/xmlhandler.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/ReverseGeocode/src/xmlhandler.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -44,7 +44,7 @@
     {
     LOG("CXmlHandler::NewL ,begin");
     CXmlHandler* self = CXmlHandler::NewLC( aObserver, aAddressInfo );
-    CleanupStack::Pop();
+    CleanupStack::Pop(); //self
     return self;
     }
 
--- a/locationmanager/client/group/locationmanagerclient.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/client/group/locationmanagerclient.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -20,7 +20,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/locationmanagerclientwinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/locationmanagerclientarm.def
 #endif
 nostrictdef
@@ -52,7 +52,6 @@
 LIBRARY	    lbs.lib
 LIBRARY	    mdccommon.lib
 
-DEBUGLIBRARY   flogger.lib
 PAGED
 BYTEPAIRCOMPRESSTARGET
 OPTION ARMCC -O3 -OTime
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/client/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for MdS LocationManager Client</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
Binary file locationmanager/client/sis/locationmanagerclient_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/client/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"LocationManagerClient Patch"},(0x200071BF), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/client/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"LocationManagerClient"}, (0x200071BF), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/client/src/rlocationmanager.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/client/src/rlocationmanager.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -33,19 +33,31 @@
     {
     LOG( "RLocationManager::LaunchServer begin" );
 
-    // DLL launch
-    RProcess server;
-    TInt ret = server.Create( KLocServerFileName, KNullDesC );
+    TFindServer findLocServer( KLocServerName );
+    TFullName name;
 
-    if ( ret != KErrNone )  // Loading failed.
+    TInt result = findLocServer.Next( name );
+    if ( result == KErrNone )
         {
-        return ret;
+        LOG( "StartServer() - Server already running" );
+        
+        // Server already running
+        return KErrNone;
         }
     
-    TRequestStatus status( KErrNone );
-    server.Rendezvous( status );
-
-    if ( status != KRequestPending )
+    RProcess server;
+    result = server.Create( KLocServerFileName, KNullDesC );   
+    if ( result != KErrNone )
+        {
+        LOG1( "CreateServerProcess() - failed to create server process, error: %d", result );
+        return result;
+        }
+ 
+    // Process created successfully
+    TRequestStatus stat( KErrNone );
+    server.Rendezvous( stat );
+    
+    if ( stat != KRequestPending )
         {
         LOG( "RLocationManager::LaunchServer Failed" );
         server.Kill( 0 );     // Abort startup.
@@ -54,15 +66,17 @@
         {
         server.Resume();    // Logon OK - start the server.
         }
-        
-    User::WaitForRequest( status ); // wait for start or death
+    
+    User::WaitForRequest( stat ); // wait for start or death
     // we can't use the 'exit reason' if the server panicked as this
     // is the panic 'reason' and may be '0' wehich cannot be distinguished
     // from KErrNone
-    ret = ( server.ExitType() == EExitPanic ) ? KErrCommsBreak : status.Int();
+    result = ( server.ExitType() == EExitPanic ) ? KErrCommsBreak : stat.Int();
     server.Close();
+    
     LOG( "RLocationManager::LaunchServer end" );
-    return ret;    
+    
+    return result;       
     }
 
 // --------------------------------------------------------------------------
--- a/locationmanager/client/src/rlocationobjectmanipulator.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/client/src/rlocationobjectmanipulator.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -114,6 +114,7 @@
         }
     
     delete paramBuf;
+    paramBuf = NULL;
 	LOG( "RLocationObject::CopyLocationData end" );
 	}
 // --------------------------------------------------------------------------
@@ -146,6 +147,7 @@
         {
         LOG( "RLocationObject::CopyLocationData CMdCSerializationBuffer creation failed" );
         delete uriBuffer;
+        uriBuffer = NULL;
         CompleteRequest( aStatus, error );
         return;
         }
@@ -177,6 +179,7 @@
         }
     
     delete uriBuffer;
+    uriBuffer = NULL;
     LOG( "RLocationObject::CopyLocationData end" );
 	}
 
--- a/locationmanager/client/src/rlocationtrail.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/client/src/rlocationtrail.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -31,6 +31,7 @@
 EXPORT_C RLocationTrail::~RLocationTrail()
 	{
 	delete iCurrentLocData;
+	iCurrentLocData = NULL;
 	}
 
 // --------------------------------------------------------------------------
@@ -148,6 +149,7 @@
     LOG( "RLocationTrail::CurrentLocation(), begin" );
     
     delete iCurrentLocData;
+    iCurrentLocData = NULL;
     iCurrentLocData = new TPckg<TLocationData>( aLocationData );
     
     if ( iHandle && iCurrentLocData )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/data/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* 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:  Build information file
+*
+*/
+#include "../inc/locplatsupport.mmh"
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+200071BE.txt /epoc32/data/z/private/10202BE9/200071BE.txt
+200071BE.txt /epoc32/WINSCW/C/private/10202BE9/200071BE.txt
+../sis/locationmanager_stub.sis  /epoc32/data/z/system/install/locationmanager_stub.sis
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
+
--- a/locationmanager/geoconverter/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geoconverter/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -2,9 +2,9 @@
 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
@@ -26,3 +26,4 @@
 
 PRJ_TESTEXPORTS
 
+
--- a/locationmanager/geoconverter/group/geoconverter.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geoconverter/group/geoconverter.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -30,7 +30,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/geoconverterwinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/geoconverterarm.def
 #endif
 nostrictdef
@@ -58,7 +58,6 @@
 LIBRARY         lbslocationinfodatatypes.lib
 #endif
 LIBRARY         lbs.lib
-DEBUGLIBRARY flogger.lib
 LIBRARY           libc.lib
 
 PAGED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geoconverter/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for MdS GeoConverter</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
Binary file locationmanager/geoconverter/sis/geoconverter_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geoconverter/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"GeoConverter Patch"},(0x2002E6A1), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geoconverter/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"geoconverter"}, (0x2002E6A1), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/geoconverter/src/cgeoconverter.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geoconverter/src/cgeoconverter.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -31,7 +31,7 @@
     CGeoConverter* self = new( ELeave ) CGeoConverter( aObserver );
     CleanupStack::PushL( self );
     self->ConstructL();
-    CleanupStack::Pop();
+    CleanupStack::Pop(); // self
     return self;
     }
 
@@ -135,12 +135,12 @@
     
     //Set mobile country code
     TLex lexer( aNetworkInfo.iCountryCode );
-    TUint countryCode;
+    TUint countryCode = 0;
     
     User::LeaveIfError( lexer.Val( countryCode, EDecimal) );
     //Set mobile network code
     lexer = aNetworkInfo.iNetworkId;
-    TUint networkCode;
+    TUint networkCode = 0;
     User::LeaveIfError( lexer.Val( networkCode, EDecimal) );
     LOG1("Network mode - %d", aNetworkInfo.iMode);
     CLbsAreaInfoBase* areaInfoBase = NULL;
@@ -185,14 +185,18 @@
         default:
             LOG("Unknown network mode");
             User::Leave(KErrNotSupported);
-            break;
         }
     //Add the cell information to the location info class. This class
     //would be sent to the Location Monitor server that would perform the
     //requested conversion and update the position estimate
     if(areaInfoBase != NULL) // self check
         {
+        // reset previous one.. to clear the local info.
+        iLocInfo->ResetAreaInfo(CLbsLocationInfo::ELbsAreaInfoAll);
         iLocInfo->AddAreaInfoL( areaInfoBase ); 
+        //ownership is transferred.
+        iWcdmaCellInfo = NULL;
+        iGsmCellInfo = NULL;
         //Request conversion of GSM cell information to corresponding coordinate information
         iLocConverter->ConvertLocationInfoL( *iLocInfo, ELbsConversionSilent, 
                                                 ELbsConversionOutputPosition  );
--- a/locationmanager/geotagger/group/geotagger.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geotagger/group/geotagger.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -28,7 +28,7 @@
 CAPABILITY 	    CAP_GENERAL_DLL
 
 #if defined(WINSCW)
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/geotaggerarm.def
 #endif
 nostrictdef
@@ -38,15 +38,17 @@
 USERINCLUDE     ../../../inc
 
 
-USERINCLUDE     ../../tagcreator/inc
-
 #ifdef     _LOC_GEOTAGGING_CELLID
 MACRO LOC_GEOTAGGING_CELLID
 USERINCLUDE     ../../geoconverter/inc
 #endif
 
-USERINCLUDE     ../../reversegeocode/inc
-USERINCLUDE	../../reversegeocoderplugin/inc
+#ifdef _LOC_REVERSEGEOCODE
+MACRO LOC_REVERSEGEOCODE
+USERINCLUDE     ../../tagcreator/inc
+USERINCLUDE     ../../ReverseGeocode/inc
+USERINCLUDE	../../ReverseGeoCoderPlugin/inc
+#endif
 
 
 SOURCEPATH      ../src
@@ -66,18 +68,17 @@
 LIBRARY         estor.lib
 LIBRARY	        platformenv.lib
 
-DEBUGLIBRARY    flogger.lib
-LIBRARY         tagcreator.lib 
 LIBRARY         ecom.lib 
 LIBRARY	        libc.lib
 
-LIBRARY         reversegeocode.lib
-
-
 #ifdef     _LOC_GEOTAGGING_CELLID
 LIBRARY         geoconverter.lib
 #endif
 
+#ifdef _LOC_REVERSEGEOCODE
+LIBRARY        reversegeocode.lib 
+LIBRARY        tagcreator.lib 
+#endif
 
 PAGED
 BYTEPAIRCOMPRESSTARGET
--- a/locationmanager/geotagger/inc/cinternalgeotagger.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geotagger/inc/cinternalgeotagger.h	Wed Aug 18 10:12:07 2010 +0300
@@ -24,7 +24,6 @@
 #include <locationdatatype.h>
 #include <geotagger.h>
 
-#include "reversegeocode.h"
 #include "mdccommon.h"
 #include "mdesession.h"
 #include "mdenamespacedef.h"
@@ -32,13 +31,17 @@
 #include "mdepropertydef.h"
 #include "mderelation.h"
 #include "mdequery.h"
-#include "ctagcreator.h"
 
 #ifdef LOC_GEOTAGGING_CELLID
 #include "cgeoconverter.h"
 #endif
 
+#ifdef LOC_REVERSEGEOCODE
+#include "ctagcreator.h"
+#include "reversegeocode.h"
 class CReverseGeoCoderPlugin;
+#endif
+
 
 /**
  *  GeoTagger converts a given cell ID(CGI Info) to geo-coordinates.
@@ -49,11 +52,13 @@
  
 class CInternalGeoTagger : public CGeoTagger,
                    public MMdESessionObserver,
-                   public MMdEQueryObserver,
-                   public MReverseGeocodeObserver
+                   public MMdEQueryObserver
 #ifdef LOC_GEOTAGGING_CELLID	
                    ,public MGeoConverterObserver
 #endif				   
+#ifdef LOC_REVERSEGEOCODE
+                   ,public MReverseGeocodeObserver
+#endif
     {
 public:  
     
@@ -106,8 +111,17 @@
       */    
       void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);
     
+
+#ifdef LOC_REVERSEGEOCODE
+    /**
+       * Get location objects, where lat, long not populated.
+      * @param  aCountryTagId The country tagId
+      * @param aCityTagId  The city tagId
+      */        
+    void AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId );
+
+    
     //MReverseGeocodeObserver
-
     /**
       * This method is called when reverse geocoding is completed
       *@param  aErrorcode  Error if any
@@ -138,6 +152,7 @@
     const RMobilePhone::TMobilePhoneNetworkInfoV1& 
         GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag);
     
+#endif //LOC_REVERSEGEOCODE
     
     // From MMdESessionObserver
 
@@ -155,7 +170,7 @@
       */    
     void HandleSessionError(CMdESession& aSession, TInt aError);
 
-#ifdef LOC_GEOTAGGING_CELLID	
+#ifdef LOC_GEOTAGGING_CELLID
 public:     // MGeoConverterObserver
         /**
          * This method is used for notifying completion of geotagging
@@ -170,8 +185,15 @@
 		* @param aError the error code
 		*/
 	 void HandleConversionError(TInt aError);
+        
+private:
+       /**
+       * Update media object with GPS info.
+       */
+    void UpdateGPSInfoL(const TLocality& aPosition);
+    
+#endif //LOC_GEOTAGGING_CELLID
 
-#endif    
 private:    
     
     /**
@@ -204,13 +226,6 @@
     void GetAllLocationsL( );
 
     /**
-       * Get location objects, where lat, long not populated.
-      * @param  aCountryTagId The country tagId
-      * @param aCityTagId  The city tagId
-      */        
-    void AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId );
-
-    /**
        * checks if the session is ready
       * @return ETrue If the session is ready
       */        
@@ -267,7 +282,6 @@
     
     TConnectionOption iConnectionOption;
     
-    CTagCreator* iTagCreator;
     
     /**
      * An active scheduler wait loop for waiting a session to MdE to open.
@@ -275,14 +289,17 @@
     CActiveSchedulerWait* iASW;
     TBool iMdeSessionOwnFlag;
     TBool iTagPendingHandlerFlag;
-    CReverseGeoCoderPlugin* iRevGeocoderPlugin;
-    TUid iDtorKey;
 #ifdef LOC_GEOTAGGING_CELLID	
     /*
        * Geo converter
        */
 	CGeoConverter* iGeoConverter;
 #endif
+#ifdef LOC_REVERSEGEOCODE
+        CTagCreator* iTagCreator;
+        CReverseGeoCoderPlugin* iRevGeocoderPlugin;
+        TUid iDtorKey;
+#endif //LOC_REVERSEGEOCODE
     };
 
 #endif // C_CGEOTAGGER_H 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geotagger/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for MdS GeoTagger</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
Binary file locationmanager/geotagger/sis/geotagger_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geotagger/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"GeoTagger Patch"},(0x2002700E), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geotagger/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"geotagger"}, (0x2002700E), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/geotagger/src/cinternalgeotagger.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geotagger/src/cinternalgeotagger.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -24,12 +24,16 @@
 #include "mdeconstants.h"
 #include "mdesession.h"
 #include "cinternalgeotagger.h"
+#ifdef LOC_REVERSEGEOCODE
 #include "reversegeocoderplugin.h"
+const TUid KReverseGeoCodeUid = {0x2002DD12};
+#endif
 
 using namespace MdeConstants;
 
 _LIT ( KCountry, "country:");   // country:india 
-const TUid KReverseGeoCodeUid = {0x2002DD12};
+
+const TReal64 KZeroLatLon (0.000000 );
 
 // --------------------------------------------------------------------------
 // CInternalGeoTagger::NewL
@@ -59,13 +63,15 @@
                         iIndex(0),
                         iSessionReady( EFalse ),
                         iObserver( aObserver ),
-                        iTagCreator(NULL),
                         iASW(NULL),
-                        iTagPendingHandlerFlag(EFalse),
-                        iRevGeocoderPlugin(NULL)
-#ifdef LOC_GEOTAGGING_CELLID	
+                        iTagPendingHandlerFlag(EFalse)
+#ifdef LOC_GEOTAGGING_CELLID
 						,iGeoConverter(NULL)
 #endif						
+#ifdef LOC_REVERSEGEOCODE
+                        ,iTagCreator(NULL)
+                        ,iRevGeocoderPlugin(NULL)
+#endif						
     {
     iMdeSessionOwnFlag = (iMdeSession == NULL);
     }
@@ -82,10 +88,12 @@
 		LOG("Not owning mds session");
         iMdeSessionOwnFlag = EFalse;
         //object is not owning iMdeSession
+        iSessionReady = ETrue;
+#ifdef LOC_REVERSEGEOCODE
         iTagCreator = CTagCreator::NewL();
-        iSessionReady = ETrue;
         
         iTagCreator->SetSession( iMdeSession );
+#endif //LOC_REVERSEGEOCODE
         }
     else
         {
@@ -93,7 +101,9 @@
         iASW = new (ELeave) CActiveSchedulerWait();
         iMdeSession = CMdESession::NewL( *this );
         //for creating tags
+#ifdef LOC_REVERSEGEOCODE
         iTagCreator = CTagCreator::NewL();
+#endif
         
         iASW->Start();
         delete iASW;
@@ -102,20 +112,16 @@
     
     //for reverse geocoding (geo-tagging)
     
-    if (!iRevGeocoderPlugin)
-            {
-           
-		   TRAP_IGNORE(
-            iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
-               REComSession::CreateImplementationL(KReverseGeoCodeUid, iDtorKey));)
- 
-            if(iRevGeocoderPlugin)
-            	{
-               	iRevGeocoderPlugin->AddObserverL(*this); 
- 
-              }
- 
-            }
+#ifdef LOC_REVERSEGEOCODE
+      
+	   TRAP_IGNORE(
+        iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
+           REComSession::CreateImplementationL(KReverseGeoCodeUid, iDtorKey));)
+
+        iRevGeocoderPlugin->AddObserverL(*this); 
+
+
+#endif //LOC_REVERSEGEOCODE
 
     LOG("CInternalGeoTagger::ConstructL ,end");
     }
@@ -152,9 +158,13 @@
 		iTagQuery->Cancel();
 		delete iTagQuery;
 		}	
+#ifdef LOC_REVERSEGEOCODE
+    delete iTagCreator;
+    iTagCreator = NULL;
     delete iRevGeocoderPlugin;
     iRevGeocoderPlugin = NULL;
     REComSession::DestroyedImplementation(iDtorKey);	
+#endif //LOC_REVERSEGEOCODE
     if(iMdeSessionOwnFlag)
         {
     	delete iMdeSession;
@@ -189,7 +199,7 @@
 void CInternalGeoTagger::HandleSessionOpened(CMdESession& /*aSession*/, TInt aError)
     {
     LOG("CInternalGeoTagger::HandleSessionOpened ,begin");
-    if ( iMdeSessionOwnFlag && iASW && iASW->IsStarted() )
+    if ( iASW && iASW->IsStarted() )
         {
         iASW->AsyncStop();
         }
@@ -198,9 +208,11 @@
         {
         iSessionReady = ETrue;
         
+#ifdef LOC_REVERSEGEOCODE
         iTagCreator->SetSession( iMdeSession );
+#endif
         }
-    else if(iMdeSessionOwnFlag)
+    else 
         {
         delete iMdeSession;
         iMdeSession = NULL;
@@ -215,16 +227,15 @@
 void CInternalGeoTagger::HandleSessionError(CMdESession& /*aSession*/, TInt /*aError*/)
     {
     LOG("CInternalGeoTagger::HandleSessionError ,begin");
-    if ( iMdeSessionOwnFlag && iASW && iASW->IsStarted() )
+    if (iASW && iASW->IsStarted() )
         {
         iASW->AsyncStop();
         }
     iSessionReady = EFalse;
-    if(iMdeSessionOwnFlag)
-    	{
-	    delete iMdeSession;
-	    iMdeSession = NULL;
-    	}
+
+	delete iMdeSession;
+	iMdeSession = NULL;
+
     LOG("CInternalGeoTagger::HandleSessionError ,end");
     }
 
@@ -355,6 +366,7 @@
             if(GPSInfoExists())
                 {
                 // GPS info exist go for reverse geo coding.
+#ifdef LOC_REVERSEGEOCODE
                 if(iRevGeocoderPlugin)
     			    {
                     TRAP_IGNORE( 
@@ -362,6 +374,7 @@
     				   ( iLocationData.iPosition, iConnectionOption ) );
     				}
     			else
+#endif //LOC_REVERSEGEOCODE
     			    {
                     IterateNextLocation();  //Go through next location
     			    }
@@ -369,7 +382,6 @@
     		else
     		    {
         		if ( iLocationData.iNetworkInfo.iCellId > 0 && 
-        				iLocationData.iNetworkInfo.iLocationAreaCode > 0 &&
         				iLocationData.iNetworkInfo.iCountryCode.Length() > 0 &&
         				iLocationData.iNetworkInfo.iNetworkId.Length() > 0 )
         			{
@@ -383,8 +395,21 @@
                    
                     if(err == KErrNone && iGeoConverter != NULL)
                        {
+                       // there is no field to store type of network. 
+                       // but it's safe to take decission based on area code.
+                       if(iLocationData.iNetworkInfo.iLocationAreaCode > 0)
+                           {
+                           LOG("Valid areacode. Treat as GSM n/w");
+                           iLocationData.iNetworkInfo.iAccess = CTelephony::ENetworkAccessGsm;
+                           }
+                       else
+                           {
+                           LOG("Areacode is 0. Treat as 3G n/w");
+                           iLocationData.iNetworkInfo.iAccess = CTelephony::ENetworkAccessUtran;
+                           }
                        TRAP(err, iGeoConverter->ConvertL(iLocationData.iNetworkInfo);)
                        }
+                    LOG1("Error - %d", err);
                    if(err != KErrNone)
                        {
                        HandleConversionError(err);	
@@ -415,7 +440,9 @@
     LOG("CInternalGeoTagger::GPSInfoExists");
     TBool gpsInfoExists = EFalse;
     if ( !Math::IsNaN( iLocationData.iPosition.Latitude() ) && 
-                !Math::IsNaN( iLocationData.iPosition.Longitude() ))  //lat, long is there
+                !Math::IsNaN( iLocationData.iPosition.Longitude() ) &&
+                KZeroLatLon != iLocationData.iPosition.Latitude() && 
+                KZeroLatLon != iLocationData.iPosition.Longitude() )  //lat, long is there
         {
         
 		LOG("Valid lat/lon\n");
@@ -424,6 +451,7 @@
     return gpsInfoExists;
     }
 
+
 // --------------------------------------------------------------------------
 // CInternalGeoTagger::StartGeoTagging()
 // --------------------------------------------------------------------------
@@ -481,20 +509,43 @@
         iLocationData.iPosition.SetCoordinate( latProp->Real64ValueL(), 
                                                lonProp->Real64ValueL() );
         }
+    else
+        {
+        iLocationData.iPosition.SetCoordinate( KZeroLatLon, 
+                                               KZeroLatLon );
+        }
     
     locationObject->Property( cellIdDef, cellProp, 0 );
     locationObject->Property( lacCodeDef, lacProp, 0 );
     locationObject->Property( countryCodeDef, countryProp, 0 );
     locationObject->Property( networkCodeDef, networkProp, 0 );
-    if ( cellProp && lacProp && countryProp && networkProp)
+    if ( cellProp && countryProp && networkProp)
         {
         iLocationData.iNetworkInfo.iCellId = cellProp->Uint32ValueL();
-        iLocationData.iNetworkInfo.iLocationAreaCode = lacProp->Uint32ValueL();
         iLocationData.iNetworkInfo.iCountryCode = countryProp->TextValueL();
         iLocationData.iNetworkInfo.iNetworkId = networkProp->TextValueL();
-        
+        }
+    else
+        {
+        // set to invalid values.
+        iLocationData.iNetworkInfo.iCellId = 0;
+        iLocationData.iNetworkInfo.iAccess = CTelephony::ENetworkAccessUnknown;
+        iLocationData.iNetworkInfo.iLocationAreaCode = 0;
+        iLocationData.iNetworkInfo.iAreaKnown = EFalse;
+        iLocationData.iNetworkInfo.iCountryCode.Zero();
+        iLocationData.iNetworkInfo.iNetworkId.Zero();
         }
 
+    iLocationData.iNetworkInfo.iAreaKnown = EFalse;
+    if(lacProp)
+        {
+        iLocationData.iNetworkInfo.iLocationAreaCode = lacProp->Uint32ValueL();
+        if(iLocationData.iNetworkInfo.iLocationAreaCode > 0)
+            {
+            iLocationData.iNetworkInfo.iAreaKnown = ETrue;
+            }
+        }
+    delete locationObject;
 	LOG("CInternalGeoTagger::GetLocationInfoL ,end");
     }
 
@@ -517,12 +568,16 @@
         TItemId tagId = relation.RightObjectId(); 
         CMdEObject* object = NULL;
         TRAP_IGNORE( object = iMdeSession->GetObjectL( tagId ) );
-        
-        error = object->Uri().Find( KCountry );
-        if ( error == KErrNone )
+        if(object)
             {
-            i = count;
-            tagFound = ETrue;
+            error = object->Uri().Find( KCountry );
+            delete object;
+            if ( error == KErrNone )
+                {
+                i = count;
+                tagFound = ETrue;
+                break;
+                }
             }
         }
                 
@@ -532,36 +587,6 @@
 
     }
 
-// --------------------------------------------------------------------------
-// CInternalGeoTagger::AddressInfo()
-// --------------------------------------------------------------------------
-//
-void CInternalGeoTagger::AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId )
-    {
-    LOG("CInternalGeoTagger::AddressInfoL ,begin");
-                               
-    const TInt count = iRelationQuery->Count();
-    
-    for ( TInt i = 0; i < count; i++ )
-        {
-        CMdERelation& relation = iRelationQuery->Result( i );
-        TItemId imageId = relation.LeftObjectId(); 
-        
-        if ( !GPSInfoExists() )   //to update EXIF
-            {
-            // update relation timestamp, composer will then update exif data   
-            TTime timestamp( 0 );
-            timestamp.UniversalTime();
-            relation.SetLastModifiedDate( timestamp );     
-            iMdeSession->UpdateRelationL( relation );
-            }
-        
-        iTagCreator->AttachTagsL( imageId, aCountryTagId, aCityTagId  );
-        }
-
-   LOG("CInternalGeoTagger::AddressInfoL ,end");
-    }
-
 
 // --------------------------------------------------------------------------
 // CInternalGeoTagger::IterateNextLocation()
@@ -626,42 +651,6 @@
   LOG("CInternalGeoTagger::GetAllLocationsL ,end");
     }
 
-// --------------------------------------------------------------------------
-// CInternalGeoTagger::ReverseGeocodeComplete()
-//  Get address details like street, city, state, etc.
-// --------------------------------------------------------------------------
-//
-void CInternalGeoTagger::ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo )
-    {
-    LOG("CInternalGeoTagger::ReverseGeocodeComplete ,begin");
-    TItemId countryTagId(0);
-    TItemId cityTagId(0);
-    
-    // create country and city tags
-    if( aErrorcode == KErrNone )
-        {
-        TPtrC countryPtr( aAddressInfo.GetCountryName() ); 
-        TPtrC cityPtr( aAddressInfo.GetCity() );
-        
-        TRAP_IGNORE( iTagCreator->CreateLocationTagsL( countryPtr, countryTagId, cityPtr, cityTagId ) );
-		
-        TRAP_IGNORE(AddressInfoL( countryTagId, cityTagId ));
-        
-        IterateNextLocation();
-        }
-    else
-        {
-        //handle error
-        if ( iObserver )
-            {
-            iIndex = 0;
-            iObserver->GeoTaggingCompleted( aErrorcode );
-            }
-        }
-   
-    
-    LOG("CInternalGeoTagger::ReverseGeocodeComplete ,end");
-    }
 
 // --------------------------------------------------------------------------
 // CInternalGeoTagger::GetTagsL()
@@ -702,6 +691,82 @@
     }
 
 #ifdef LOC_GEOTAGGING_CELLID	
+
+// --------------------------------------------------------------------------
+// CInternalGeoTagger::UpdateGPSInfoL()
+// --------------------------------------------------------------------------
+//
+void CInternalGeoTagger::UpdateGPSInfoL(const TLocality& aPosition)
+	{
+	
+    LOG("CInternalGeoTagger::UpdateGPSInfoL ,start");
+    if(Math::IsNaN( aPosition.Latitude()) ||
+        Math::IsNaN( aPosition.Longitude()) )
+        {
+        LOG("Not a valid location info.");
+        LOG("CInternalGeoTagger::UpdateGPSInfoL ,end");
+        return;
+        }
+    
+	CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL();
+	CMdEObjectDef& locObjDef = namespaceDef.GetObjectDefL( Location::KLocationObject );
+	CMdEObject* location = iMdeSession->OpenObjectL(iLocationId, locObjDef);
+	CleanupStack::PushL( location );
+	
+	CMdEPropertyDef& propLatDef = locObjDef.GetPropertyDefL( Location::KLatitudeProperty );
+	CMdEPropertyDef& propLongDef = locObjDef.GetPropertyDefL( Location::KLongitudeProperty );
+	CMdEPropertyDef& propAltDef = locObjDef.GetPropertyDefL( Location::KAltitudeProperty );
+	CMdEPropertyDef& qualityDef = locObjDef.GetPropertyDefL( Location::KQualityProperty );
+
+	if (location->PropertyCount(propLatDef) == 0)
+		{
+		location->AddReal64PropertyL(propLatDef, aPosition.Latitude() ); //iLatitude
+		}
+	if (location->PropertyCount(propLongDef) == 0)
+		{
+		location->AddReal64PropertyL(propLongDef, aPosition.Longitude() ); //iLongitude
+		}
+	if (location->PropertyCount(propAltDef) == 0 &&
+        !Math::IsNaN( aPosition.Altitude()) )
+		{
+		location->AddReal64PropertyL(propAltDef, aPosition.Altitude());
+		}
+    LOG1( "Updating quality - %d", aPosition.HorizontalAccuracy());
+	if (location->PropertyCount(qualityDef) == 0 )
+		{
+		location->AddReal32PropertyL(qualityDef, aPosition.HorizontalAccuracy());
+		}
+	
+	CMdEProperty* modProp = NULL;
+	CMdEObjectDef& objImageDef = namespaceDef.GetObjectDefL( Image::KImageObject );
+	CMdEPropertyDef& propModifiedDef = objImageDef.GetPropertyDefL( Object::KLastModifiedDateProperty );
+	location->Property( propModifiedDef, modProp, 0 );
+	if ( modProp )
+		{
+		TTime timestamp( 0 );
+		timestamp.UniversalTime();
+		modProp->SetTimeValueL( timestamp );
+		}
+	// commit to DB
+	iMdeSession->CommitObjectL(*location);
+	CleanupStack::PopAndDestroy( location );
+
+    // update the relation
+    const TInt count = iRelationQuery->Count();
+    LOG1("Relation count - %d", count);
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CMdERelation& relation = iRelationQuery->Result( i );
+        // update relation timestamp, composer will then update exif data   
+        
+        TTime timestamp( 0 );
+        timestamp.UniversalTime();
+        relation.SetLastModifiedDate( timestamp );     
+        iMdeSession->UpdateRelationL( relation );
+        }
+    LOG("CInternalGeoTagger::UpdateGPSInfoL ,end");
+	}
+
 // --------------------------------------------------------------------------
 // CInternalGeoTagger::ConversionCompletedL()
 // --------------------------------------------------------------------------
@@ -714,13 +779,17 @@
     if(aError == KErrNone)
         {
         iLocationData.iPosition.SetCoordinate
-                ( aPosition.Latitude(), aPosition.Longitude());
+                ( aPosition.Latitude(), aPosition.Longitude(), aPosition.Altitude());
+        iLocationData.iQuality = aPosition.HorizontalAccuracy();
+        UpdateGPSInfoL(aPosition);
+#ifdef LOC_REVERSEGEOCODE
         if(iRevGeocoderPlugin)
 		    {
            	iRevGeocoderPlugin->GetAddressByCoordinateL
 			   ( iLocationData.iPosition, iConnectionOption ) ;
 			}
 		else
+#endif //LOC_REVERSEGEOCODE
 		    {
             IterateNextLocation();  //Go through next location
 		    }
@@ -745,7 +814,7 @@
     LOG("CInternalGeoTagger::HandleConversionError, end");
 	}
 
-#endif
+#endif //LOC_GEOTAGGING_CELLID
 
 // --------------------------------------------------------------------------
 // CInternalGeoTagger::PendingGeoTagsL()
@@ -764,7 +833,7 @@
         }
     else
         {
-        if(!iTagPendingHandlerFlag)
+        if(!iTagPendingHandlerFlag && iIndex <= 0)
             {
             LOG("Processing the request.\n");
             // tag pending request is not going on
@@ -781,6 +850,73 @@
     LOG("CInternalGeoTagger::PendingGeoTagsL ,end");
     }
 
+
+#ifdef LOC_REVERSEGEOCODE
+// --------------------------------------------------------------------------
+// CInternalGeoTagger::AddressInfo()
+// --------------------------------------------------------------------------
+//
+void CInternalGeoTagger::AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId )
+    {
+    LOG("CInternalGeoTagger::AddressInfoL ,begin");
+                               
+    const TInt count = iRelationQuery->Count();
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CMdERelation& relation = iRelationQuery->Result( i );
+        TItemId imageId = relation.LeftObjectId(); 
+        
+        if ( !GPSInfoExists() )   //to update EXIF
+            {
+            // update relation timestamp, composer will then update exif data   
+            TTime timestamp( 0 );
+            timestamp.UniversalTime();
+            relation.SetLastModifiedDate( timestamp );     
+            iMdeSession->UpdateRelationL( relation );
+            }
+        
+        iTagCreator->AttachTagsL( imageId, aCountryTagId, aCityTagId  );
+        }
+
+   LOG("CInternalGeoTagger::AddressInfoL ,end");
+    }
+
+
+// --------------------------------------------------------------------------
+// CInternalGeoTagger::ReverseGeocodeComplete()
+//  Get address details like street, city, state, etc.
+// --------------------------------------------------------------------------
+//
+void CInternalGeoTagger::ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo )
+    {
+    LOG("CInternalGeoTagger::ReverseGeocodeComplete ,begin");
+    TItemId countryTagId(0);
+    TItemId cityTagId(0);
+    
+    // create country and city tags
+    if( aErrorcode == KErrNone )
+        {
+        TPtrC countryPtr( aAddressInfo.GetCountryName() ); 
+        TPtrC cityPtr( aAddressInfo.GetCity() );
+        
+        TRAP_IGNORE( iTagCreator->CreateLocationTagsL( countryPtr, countryTagId, cityPtr, cityTagId ) );
+		
+        TRAP_IGNORE(AddressInfoL( countryTagId, cityTagId ));
+        
+        IterateNextLocation();
+        }
+    else
+        {
+        LOG1("Reverse geocode err - %d", aErrorcode);
+
+        IterateNextLocation();
+        }
+   
+    
+    LOG("CInternalGeoTagger::ReverseGeocodeComplete ,end");
+    }
+
 // ----------------------------------------------------------------------------
 // CInternalGeoTagger::GetCurrentRegisterNw()
 // ---------------------------------------------------------------------------- 
@@ -809,5 +945,7 @@
     return iObserver->GetHomeNetworkInfo(aHomeNwInfoAvailableFlag);
     }
 
+#endif //LOC_REVERSEGEOCODE
+
 // End of file
 
--- a/locationmanager/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -14,7 +14,8 @@
 * Description:  Build information file
 *
 */
-#include "../inc/locplatsupport.mmh"
+
+#include "../data/bld.inf"
 
 #ifdef _LOC_GEOTAGGING_CELLID
 #include "../geoconverter/group/bld.inf"
@@ -24,10 +25,9 @@
 #include "../tagcreator/group/bld.inf"
 #include "../ReverseGeocode/group/bld.inf"
 #include "../ReverseGeoCoderPlugin/group/bld.inf"
-#include "../geotagger/group/bld.inf"
 #endif
 
-
+#include "../geotagger/group/bld.inf"
 #include "../locationtrail/group/bld.inf"
 #include "../server/group/bld.inf"
 #include "../client/group/bld.inf"
@@ -36,9 +36,6 @@
     DEFAULT
 
 PRJ_EXPORTS
-../data/200071BE.txt /epoc32/data/z/private/10202BE9/200071BE.txt
-../data/200071BE.txt /epoc32/WINSCW/C/private/10202BE9/200071BE.txt
-../sis/locationmanager_stub.sis  /epoc32/data/z/system/install/locationmanager_stub.sis
 
 PRJ_MMPFILES
 
--- a/locationmanager/inc/locationmanagerdefs.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/inc/locationmanagerdefs.h	Wed Aug 18 10:12:07 2010 +0300
@@ -18,7 +18,7 @@
 #ifndef __LOCATIONMANAGERDEFS_H__
 #define __LOCATIONMANAGERDEFS_H__
 
-_LIT( KLocServerFileName, "LocationManagerServer.exe");
+_LIT( KLocServerFileName, "locationmanagerserver.exe");
 _LIT( KLocServerName,     "LocationManagerServer" );
 
 const TInt KLocationManagerServerMinor = 0;
@@ -66,6 +66,8 @@
     EArgumentState
     };
 
+const TInt KLocManagerSessionPriority = 5;
+
 #endif // __LOCATIONMANAGERDEFS_H__
 
 // End of file.
--- a/locationmanager/locationtrail/group/locationtrail.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/locationtrail/group/locationtrail.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -29,7 +29,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/locationtrailwinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/locationtrailarm.def
 #endif
 nostrictdef
@@ -77,13 +77,12 @@
 LIBRARY         ecom.lib
 LIBRARY         commsdat.lib
 
+LIBRARY        geotagger.lib
+LIBRARY        libc.lib
 
-DEBUGLIBRARY flogger.lib
-LIBRARY        libc.lib
 #ifdef _LOC_REVERSEGEOCODE
 LIBRARY        reversegeocode.lib 
 LIBRARY        tagcreator.lib 
-LIBRARY        geotagger.lib
 #endif
 
 #ifdef     _LOC_GEOTAGGING_CELLID
--- a/locationmanager/locationtrail/inc/clocationrecord.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/locationtrail/inc/clocationrecord.h	Wed Aug 18 10:12:07 2010 +0300
@@ -743,6 +743,11 @@
      */
    	CTagCreator *iTagCreator;
     /*
+     * Flag to track last reverse geocode failure sceenario
+     */
+	TBool iLastReverseGeocodeFails;
+
+    /*
      * Reverse geo coder plugin object
      */
 	CReverseGeoCoderPlugin* iRevGeocoderPlugin;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/locationtrail/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for MdS LocationTrail</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
Binary file locationmanager/locationtrail/sis/locationtrail_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/locationtrail/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"LocationTrail Patch"},(0x200071BD), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/locationtrail/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"locationtrail"}, (0x200071BD), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/locationtrail/src/cgpxconverterao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/locationtrail/src/cgpxconverterao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -82,11 +82,14 @@
     iBoundQueue.Close();
 
     delete iTempFile;
+    iTempFile = NULL;
     delete iBoundaries;
+    iBoundaries = NULL;
         
     delete iWriteBuf;
+    iWriteBuf = NULL;
     delete iFormatBuf;
-
+    iFormatBuf = NULL;
 	LOG( "CGpxConverterAO::~CGpxConverterAO ,end" );
     }
 
@@ -179,7 +182,9 @@
 				TInt err;
 				iFixLost = ETrue;
                 delete iTempFile;
+                iTempFile = NULL;
                 delete iBoundaries;
+                iBoundaries = NULL;
 				// get next temp-file from queue
 				iTempFile = iFileQueue[0];
 				iBoundaries = iBoundQueue[0];
--- a/locationmanager/locationtrail/src/clocationrecord.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/locationtrail/src/clocationrecord.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -21,6 +21,9 @@
 #include <ecom.h>
 #include <centralrepository.h>
 #include <hwrmpowerstatesdkpskeys.h>
+#ifdef LOC_GEOTAGGING_CELLID
+#include <lbslocationinfo.h>
+#endif //LOC_GEOTAGGING_CELLID
 
 #include "rlocationtrail.h"
 #include "clocationrecord.h"
@@ -101,6 +104,7 @@
 	,iImageQuery(NULL)
 	,iTagQuery(NULL)
     ,iTagCreator( NULL )
+    ,iLastReverseGeocodeFails(EFalse)
 	,iRevGeocoderPlugin( NULL )
 #endif
     {
@@ -132,16 +136,12 @@
 #ifdef LOC_REVERSEGEOCODE
     iTagCreator = CTagCreator::NewL();
 
+    iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
+          REComSession::CreateImplementationL(KReverseGeoCodeUid,iDtorKey));
 
-    if (!iRevGeocoderPlugin)
-        {
-        iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
-              REComSession::CreateImplementationL(KReverseGeoCodeUid,iDtorKey));
-        if(iRevGeocoderPlugin)
-            {
-            iRevGeocoderPlugin->AddObserverL(*this);
-            }
-         }
+     iRevGeocoderPlugin->AddObserverL(*this);
+
+
  
  #endif
 
@@ -201,8 +201,11 @@
     iLocationItems.Close();
 #endif    
     delete iNetworkInfoChangeListener;
+    iNetworkInfoChangeListener = NULL;
     delete iPositionInfo;
+    iPositionInfo = NULL;
     delete iNetworkInfoTimer;
+    iNetworkInfoTimer = NULL;
 #ifdef LOC_GEOTAGGING_CELLID
     if(iGeoConverter)
         {
@@ -355,7 +358,7 @@
     LOG1( "CLocationRecord::GetLocationByTimeL - aTime: %Ld", aTime.Int64() );
     TBuf<DateTimeStrMaxLength> str1;
     aTime.FormatL( str1, KDateTimeFormat );
-   // LOG1( "CLocationRecord::GetLocationByTimeL - aTime: %S", &str1 );
+    LOG1( "CLocationRecord::GetLocationByTimeL - aTime: %S", &str1 );
 #endif
 
     TTimeIntervalSeconds interval;
@@ -370,7 +373,7 @@
         LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %Ld", iTrail[i]->iTimeStamp.Int64() );
         TBuf<DateTimeStrMaxLength> str;
         iTrail[i]->iTimeStamp.FormatL( str, KDateTimeFormat );
-        //LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %S", &str );
+        LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %S", &str );
         LOG1( "CLocationRecord::GetLocationByTimeL - timeDiff: %d", timeDiff );
 #endif
 
@@ -707,10 +710,12 @@
         	{
         	iNetwork.iLocationAreaCode = 0;
         	}
+#ifdef LOC_GEOTAGGING_CELLID
         if ( iState == RLocationTrail::ETrailStarting && iTrailStarted )
         	{
         	SetCurrentState( RLocationTrail::ETrailStarted );
         	}
+#endif        
         }
     else
         {
@@ -797,13 +802,16 @@
     if( iTrailStarted )
         {
         // Set the property only when trail is started to avoid icon flickering and wrong icon update in UI
-        if( iGpsDataAvailableFlag  || 
-            iNetwork.iCellId > 0 && 
+        if( iGpsDataAvailableFlag  
+#ifdef LOC_GEOTAGGING_CELLID
+            || ( iNetwork.iCellId > 0 && 
             ((iNetwork.iLocationAreaCode == 0 && iNetwork.iAccess == CTelephony::ENetworkAccessUtran) || // 3G
             (iNetwork.iLocationAreaCode > 0 && (iNetwork.iAccess == CTelephony::ENetworkAccessGsm ||  // 2G
             						iNetwork.iAccess == CTelephony::ENetworkAccessGsmCompact)))  &&
             iNetwork.iCountryCode.Length() > 0 &&
             iNetwork.iNetworkId.Length() > 0 )
+#endif // LOC_GEOTAGGING_CELLID            
+            )
             {
             // set the value 3 to have Geo tag available icon else not available.
             iProperty.Set( KPSUidLocationTrail, KLocationTrailState, 
@@ -1053,7 +1061,11 @@
 			{
 			
 			// if both locations have valid coordinates, calculate distance between points
-			if ( !Math::IsNaN( lastLocationData.iPosition.Latitude() ) && 
+			if (
+#ifdef LOC_REVERSEGEOCODE
+                !iLastReverseGeocodeFails &&
+#endif //LOC_REVERSEGEOCODE
+                !Math::IsNaN( lastLocationData.iPosition.Latitude() ) && 
 					!Math::IsNaN( lastLocationData.iPosition.Longitude() ) && 
 					!Math::IsNaN( locationData.iPosition.Latitude() ) && 
 					!Math::IsNaN( locationData.iPosition.Longitude() ))
@@ -1191,8 +1203,6 @@
      const TReal64 KMeterInDegrees = 0.000009;
      const TReal64 KPi = 3.14159265358979;
      const TReal32 K180Degrees = 180.0;
-     
-     //TLocationData locationData = iMediaItems[0].iLocationData;
             
      TReal64 latitude = iMediaItems[0]->iLocationData.iPosition.Latitude();
      TReal64 longitude = iMediaItems[0]->iLocationData.iPosition.Longitude();
@@ -1322,6 +1332,8 @@
 	if ( !Math::IsNaN( aLocationData.iPosition.Latitude() ) && 
 		 !Math::IsNaN( aLocationData.iPosition.Longitude() ))
 		{
+        LOG1("Lan - %f", aLocationData.iPosition.Latitude());
+        LOG1("Lon - %f", aLocationData.iPosition.Longitude());
 		locationObject->AddReal64PropertyL( *iLatitudeDef, aLocationData.iPosition.Latitude() );
 		locationObject->AddReal64PropertyL( *iLongitudeDef, aLocationData.iPosition.Longitude() );
 
@@ -1344,36 +1356,46 @@
 		}
 
 	// network related properties
-	if ( aLocationData.iNetworkInfo.iAreaKnown )
+	if ( aLocationData.iNetworkInfo.iAccess != CTelephony::ENetworkAccessUnknown )
+		{
+		LOG1("Cell id - %d", aLocationData.iNetworkInfo.iCellId);
+		locationObject->AddUint32PropertyL( cellIdDef, aLocationData.iNetworkInfo.iCellId );
+		}
+	if ( aLocationData.iNetworkInfo.iAreaKnown && 
+        aLocationData.iNetworkInfo.iLocationAreaCode != 0 &&
+		aLocationData.iNetworkInfo.iAccess != CTelephony::ENetworkAccessUnknown )
 		{
-		if ( aLocationData.iNetworkInfo.iAccess != CTelephony::ENetworkAccessUnknown )
-			{
-			locationObject->AddUint32PropertyL( cellIdDef, aLocationData.iNetworkInfo.iCellId );
-			
-			}
-		if ( aLocationData.iNetworkInfo.iLocationAreaCode != 0 &&
-			aLocationData.iNetworkInfo.iAccess != CTelephony::ENetworkAccessUnknown )
-			{
-			locationObject->AddUint32PropertyL( locationCodeDef, 
-					aLocationData.iNetworkInfo.iLocationAreaCode );
-			
-			}
-		if ( aLocationData.iNetworkInfo.iCountryCode.Length() > 0 )
-			{
-			locationObject->AddTextPropertyL( countryCodeDef, 
-					aLocationData.iNetworkInfo.iCountryCode );
-			
-			}
-		if ( aLocationData.iNetworkInfo.iNetworkId.Length() > 0 )
-			{
-			locationObject->AddTextPropertyL(networkCodeDef, aLocationData.iNetworkInfo.iNetworkId);
-			
-			}
+		LOG1("Areacode - %d", aLocationData.iNetworkInfo.iLocationAreaCode);
+		locationObject->AddUint32PropertyL( locationCodeDef, 
+				aLocationData.iNetworkInfo.iLocationAreaCode );
+		}
+#ifdef _DEBUG
+    TLex lexer( aLocationData.iNetworkInfo.iCountryCode );
+    TUint countryCode = 0;
+    
+    User::LeaveIfError( lexer.Val( countryCode, EDecimal) );
+    LOG1("Country code - %d", countryCode);
+    
+    //Set mobile network code
+    lexer = aLocationData.iNetworkInfo.iNetworkId;
+    TUint networkCode = 0;
+    User::LeaveIfError( lexer.Val( networkCode, EDecimal) );
+    LOG1("Network id - %d", networkCode);
+#endif
+	if ( aLocationData.iNetworkInfo.iCountryCode.Length() > 0 )
+		{
+		locationObject->AddTextPropertyL( countryCodeDef, 
+				aLocationData.iNetworkInfo.iCountryCode );
+		}
+
+	if ( aLocationData.iNetworkInfo.iNetworkId.Length() > 0 )
+		{
+		locationObject->AddTextPropertyL(networkCodeDef, aLocationData.iNetworkInfo.iNetworkId);
 		}
 	        
 	// Add the location object to the database.
 	locationObjectId = iMdeSession->AddObjectL( *locationObject );
-
+    LOG1("Location id - %d", locationObjectId);
 	CleanupStack::PopAndDestroy( locationObject );
     LOG( "CLocationRecord::DoCreateLocationL(), end" );
 
@@ -1553,7 +1575,6 @@
     LOG( "CLocationRecord::HandleFindLocationFromDB(), begin" );    
 	if ( iMediaItems.Count() > 0 )
 	   {
-		//TODO: by module owner
 		TInt trapErr = KErrNone;
 		TRAP(trapErr,FindLocationFromDBL());
 		// no memory, don't proceed further
@@ -1824,10 +1845,21 @@
             iMediaHandlingFlag &= ~KSnapGeoConvertInPendingState;
             }
 #else
+        // cell id based geo tagging is not supported.. go for remapping.
         locationId = DoCreateLocationL( iMediaItems[0]->iLocationData );
         iMediaItems[0]->iLocationId = locationId;
-        CreateRelationL( iMediaItems[0]->iObjectId, locationId );
+        TItemId relationId = CreateRelationL( iMediaItems[0]->iObjectId, locationId );
         TLocationSnapshotItem* firstPtr = iMediaItems[0];
+
+        // Go for remapping.. get locationdata from trail with object time
+        TTime timestamp = GetMdeObjectTimeL( iMediaItems[0]->iObjectId );
+        TRemapItem remapItem;
+        remapItem.iObjectId = iMediaItems[0]->iObjectId;
+        remapItem.iTime = timestamp;
+        remapItem.iLocationId = locationId;
+        remapItem.iRelationId = relationId;
+        iRemapper->Append( remapItem );
+        
         iMediaItems.Remove(0);
         delete firstPtr;
         iMediaItems.Compress();
@@ -1881,7 +1913,6 @@
             iNewItem.iLocationData.iQuality = aPosition.HorizontalAccuracy();
             TItemId locationId = DoCreateLocationL( iNewItem.iLocationData );
             iRemapper->UpdateRelationsL( locationId ); 
-            // TODO: remap.
 #ifdef LOC_REVERSEGEOCODE
             if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress))
                 {
@@ -1911,7 +1942,17 @@
            TLocationSnapshotItem* item = iMediaItems[0];
            TItemId locationId = DoCreateLocationL( iMediaItems[0]->iLocationData );
            iMediaItems[0]->iLocationId = locationId;
-           CreateRelationL( iMediaItems[0]->iObjectId, locationId );
+           TItemId relationId = CreateRelationL( iMediaItems[0]->iObjectId, locationId );
+
+           // Go for remapping.. get locationdata from trail with object time
+           TTime timestamp = GetMdeObjectTimeL( iMediaItems[0]->iObjectId );
+           TRemapItem remapItem;
+           remapItem.iObjectId = iMediaItems[0]->iObjectId;
+           remapItem.iTime = timestamp;
+           remapItem.iLocationId = locationId;
+           remapItem.iRelationId = relationId;
+           iRemapper->Append( remapItem );
+
            if((iMediaItems[0]->iFlag & KSnapMediaFile) > 0)
                {
                iLastMediaItem = *(iMediaItems[0]);
@@ -1952,6 +1993,20 @@
             else if ( iMediaItems.Count() > 0 )
                 {
                 TLocationSnapshotItem* item = iMediaItems[0];
+                // Fails may be becuase of n/w reason..create location + relation so that we can handle at 3:00 AM.
+                TItemId locationId = DoCreateLocationL( iMediaItems[0]->iLocationData );
+                iMediaItems[0]->iLocationId = locationId;
+                TItemId relationId = CreateRelationL( iMediaItems[0]->iObjectId, locationId );
+
+                // Go for remapping.. get locationdata from trail with object time
+                TTime timestamp = GetMdeObjectTimeL( iMediaItems[0]->iObjectId );
+                TRemapItem remapItem;
+                remapItem.iObjectId = iMediaItems[0]->iObjectId;
+                remapItem.iTime = timestamp;
+                remapItem.iLocationId = locationId;
+                remapItem.iRelationId = relationId;
+                iRemapper->Append( remapItem );
+
                 iMediaItems.Remove(0);
                 iMediaItems.Compress();
                 iMediaHandlingFlag &= ~KLocationQueryInProgress;
@@ -2209,7 +2264,6 @@
             
         iNetLocationQuery->FindL(1, 1); 
         iMediaHandlingFlag |= KLocationQueryInProgress;
-    //    iMediaHandlingFlag |= KNetQueryInProgress;
         }
     else
         {
@@ -2461,8 +2515,10 @@
     
     iMediaHandlingFlag &= (~KReverseGeoCodingInProgress);
 	TLocationSnapshotItem* snapshotItem = NULL;
+    LOG1("Error - %d", aErrorcode);
     if( aErrorcode == KErrNone )
         {
+        iLastReverseGeocodeFails = EFalse;
         TPtrC countryPtr( aAddressInfo.GetCountryName() );
         TPtrC cityPtr( aAddressInfo.GetCity() );
         TRAP_IGNORE( iTagCreator->CreateLocationTagsL( countryPtr, countryTagId, 
@@ -2482,19 +2538,16 @@
                 
                 TRAP_IGNORE( iTagCreator->AttachTagsL( 
                                 iLocationItems[0]->iObjectId, countryTagId, cityTagId  ) );
+                if ( (iLastMediaItem.iFlag & KSnapMediaFile) > 0 
+                    && iLastMediaItem.iLocationId == iLastLocationItem.iLocationId )
+                    {
+                    LOG("Updating country/city\n");
+                    iLastMediaItem.iCountryTagId = countryTagId;
+                    iLastMediaItem.iCityTagId = cityTagId;
+                    }
+                
                 }
             }
-        if(iLastMediaItem.iFlag == 0)
-            {
-            LOG("Last media item is null\n");
-            }
-        if ( iLastMediaItem.iFlag > 0 && iLastMediaItem.iLocationId == iLastLocationItem.iLocationId )
-            {
-            LOG("Updating country/city\n");
-            iLastMediaItem.iCountryTagId = countryTagId;
-            iLastMediaItem.iCityTagId = cityTagId;
-            }
-        
         //check other items in the array has same location 
         for ( TInt index = iLocationItems.Count() - 1; index > 0; index--)
             {
@@ -2512,6 +2565,8 @@
     else
         {
         //handle error
+        LOG("Reverse geo coding fails");
+        iLastReverseGeocodeFails = ETrue;
         }
     
     //irrespective of error or not, remove current(first) item to proceed further
--- a/locationmanager/locationtrail/src/ctracklog.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/locationtrail/src/ctracklog.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -68,6 +68,7 @@
 EXPORT_C CTrackLog::~CTrackLog()
 	{
 	delete iGpxConverter;
+	iGpxConverter = NULL;
 	iFs.Close();
 	}
 
@@ -201,6 +202,7 @@
 				if ( err == KErrNone )
 					{
 					delete lastCoords;
+					lastCoords = NULL;
 					lastCoords = new TCoordinate( aTrailItem.iLocationData.iPosition );
 					iBoundaries->distance += distance;
 					}
@@ -221,6 +223,8 @@
 	RFile64 file;
 	RFileWriteStream writer;
 	
+	CleanupClosePushL( writer );
+	
 	TInt err;
 	err = file.Open( iFs, iTmpFileName, EFileRead );
 	if ( err != KErrNone )
@@ -247,8 +251,6 @@
 		writer.Sink()->SeekL( MStreamBuf::EWrite, TStreamPos( endpos ));
 		}
 	
-	CleanupClosePushL( writer );
-	
 	TInt count = iTrackLogItemArray.Count();
 	
 	for( TInt i = 0; i < count; i++ )
@@ -306,7 +308,9 @@
 			}
 		}
 	delete filename;
+	filename = NULL;
 	delete files;
+	files = NULL;
 	}
 
 void CTrackLog::ReadCenRepValueL(TInt aKey, TInt& aValue)
--- a/locationmanager/locationtrail/src/locationremappingao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/locationtrail/src/locationremappingao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -385,12 +385,14 @@
 		relation = iMdEClient->GetRelationL( iRemapItems[i].iRelationId );
 		
 		if(relation)
-		    {   
+		    {
+		    CleanupStack::PushL(relation);
             TTime timestamp( 0 );
             timestamp.UniversalTime();
             relation->SetLastModifiedDate( timestamp );
     	
             iMdEClient->UpdateRelationL( *relation );
+		    CleanupStack::PopAndDestroy(relation);
 		    }
 		}
 	
@@ -460,14 +462,16 @@
 						iRemapItems[i].iObjectId, aLocationId, 0 );
 				iMdEClient->AddRelationL( *relationObject );
 				CleanupStack::PopAndDestroy( relationObject );
-				LOG("CLocationRemappingAO::UpdateRelationsL - new relation created");
+				LOG("new relation created");
 				}
 			else
 				{
 				CMdERelation* relationObject = iMdEClient->GetRelationL( iRemapItems[i].iRelationId );
+                CleanupStack::PushL(relationObject);
 				relationObject->SetRightObjectIdL( aLocationId );
 				iMdEClient->UpdateRelationL( *relationObject );
-				LOG("CLocationRemappingAO::UpdateRelationsL - old relation updated");
+                CleanupStack::PopAndDestroy(relationObject);
+				LOG("old relation updated");
 				}
 			iRemapItems.Remove( i );
 			}
--- a/locationmanager/server/group/locationmanagerserver.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/group/locationmanagerserver.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -44,11 +44,14 @@
 #ifdef _LOC_REVERSEGEOCODE
 MACRO LOC_REVERSEGEOCODE
 USERINCLUDE     ../../tagcreator/inc
-USERINCLUDE     ../../reversegeocode/inc 
+USERINCLUDE     ../../ReverseGeocode/inc 
 #endif
 
+#ifdef     _LOC_GEOTAGGING_CELLID
+MACRO LOC_GEOTAGGING_CELLID
+USERINCLUDE     ../../geoconverter/inc
+#endif
 
-USERINCLUDE     ../../geoconverter/inc
 
 SYSTEMINCLUDE     /epoc32/include/platform/lbs
 SYSTEMINCLUDE     /epoc32/include/stdapis
@@ -58,9 +61,7 @@
 SOURCEPATH      ../src
 SOURCE	    clocationmanagerserver.cpp
 SOURCE	    clocationmanagersession.cpp
-#ifdef _LOC_REVERSEGEOCODE
 SOURCE	    clocationgeotagtimerao.cpp 
-#endif
 SOURCE	    clocationservertimerhandler.cpp
 SOURCE      nwregistrationstatushandler.cpp
 
@@ -79,9 +80,7 @@
 LIBRARY         etelmm.lib
 LIBRARY         commsdat.lib
 
-#ifdef _LOC_REVERSEGEOCODE
 LIBRARY         geotagger.lib
-#endif
 
 PAGED
 BYTEPAIRCOMPRESSTARGET
--- a/locationmanager/server/inc/clocationmanagerserver.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/inc/clocationmanagerserver.h	Wed Aug 18 10:12:07 2010 +0300
@@ -41,9 +41,7 @@
 #include "clocationservertimerhandler.h"
 
 class CMdESession;
-#ifdef LOC_REVERSEGEOCODE
 class CLocationGeoTagTimerAO;
-#endif
 class CGeoTagger;
 class REComSession;
 class CNwRegistrationStatusHandler;
@@ -590,6 +588,11 @@
       * Retrieve home network
       */  
     void RetrieveHomeNetwork();
+    
+    /**
+      * Stop the server (if possible)
+      */  
+    void StopServer();
 
 private:
     /**
@@ -671,8 +674,9 @@
     RMobilePhone::TMobilePhoneNetworkInfoV1 iHomeNetwork;
     TBool iHomeNwInfoAvailableFlag;
   
+    CLocationGeoTagTimerAO* iGeoTagTimer;
+    
 #ifdef LOC_REVERSEGEOCODE
-    CLocationGeoTagTimerAO* iGeoTagTimer;
     CGeoTagger* iGeoTaggingPendingReqObj;
     RMessage2 iTagPendingMessage;
     RMessage2 iGeoTaggingMessage;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/server/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for MdS Location Manager Server</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
Binary file locationmanager/server/sis/locationmanagerserver_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/server/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"LocationManagerServer Patch"},(0x200071BE), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/server/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"locationmanagerserver"}, (0x200071BE), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
--- a/locationmanager/server/src/clocationgeotagtimerao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/src/clocationgeotagtimerao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -70,7 +70,7 @@
             new( ELeave ) CLocationGeoTagTimerAO(aMdeSession, aObserver);
        CleanupStack::PushL( self );
        self->ConstructL();
-       CleanupStack::Pop();
+       CleanupStack::Pop(); //self
        
        return self;
     }
@@ -108,11 +108,11 @@
         
         //3 AM in seconds
         TInt targetTimeInSeconds = GEOTAGGING_TIME_IN_HOURS * HOUR_VALUE_IN_SECONDS;
-        TInt timeDifference;
+        TInt timeDifference = 0;
         
         //Find the time difference in seconds between current time to 3.00 AM 
         //Either on same day or next day.
-        if ( currentHr <= GEOTAGGING_TIME_IN_HOURS )
+        if ( currentHr < GEOTAGGING_TIME_IN_HOURS )
         {
            timeDifference = targetTimeInSeconds - 
                     ( ( currentHr * HOUR_VALUE_IN_SECONDS  ) + ( currentMin * HOUR_VALUE_IN_MINUTES ) + currentSec );
@@ -145,30 +145,26 @@
     {
     LOG ("CLocationGeoTagTimerAO::RunL(), begin");
     TInt status = iStatus.Int();
+    LOG1 ("Timedout error - %d", status);
    
     switch( status )
         {
-        case KErrAbort:
-            StartTimer();
-            break;
-        case KErrUnderflow:
-        case KErrOverflow:
-            StartTimer();
-            break;
         case KErrNone:
             {
             //Trigger the reverse geocoding and start the timer again
             //Create the instance of geotagger class
-            if(iGeoTagger)
+            if(iGeoTagger != NULL)
                 {
                 delete iGeoTagger;
                 iGeoTagger = NULL;
                 }
             iGeoTagger = CGeoTagger::NewL( this, NULL );
             iGeoTagger->CreateGeoTagsL();
+            LOG ("Started 3:00 AM geotagging.");
             break;
             }
         default:
+            StartTimer();
             break;      
        }
     LOG ("CLocationGeoTagTimerAO::RunL(), end");
@@ -181,8 +177,6 @@
 void CLocationGeoTagTimerAO::GeoTaggingCompleted(  const TInt aError )
     {    
     LOG ("CLocationGeoTagTimerAO::GeoTaggingCompleted(), begin");
-    delete iGeoTagger;
-    iGeoTagger = NULL;
     StartTimer();
     iObserver.GeoTaggingCompleted(aError);
     LOG ("CLocationGeoTagTimerAO::GeoTaggingCompleted(), end");
--- a/locationmanager/server/src/clocationmanagerserver.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/src/clocationmanagerserver.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -33,9 +33,7 @@
 #include "mdeobjectdef.h"
 #include "mdepropertydef.h"
 #include "mdcserializationbuffer.h"
-#ifdef LOC_REVERSEGEOCODE
 #include "clocationgeotagtimerao.h"
-#endif //LOC_REVERSEGEOCODE
 #include "nwregistrationstatushandler.h"
 
 using namespace MdeConstants;
@@ -78,6 +76,7 @@
         {
         TRAP( ret, RunServerL() );
         delete cleanup;
+        cleanup = NULL;
         }
     return ret;
     }
@@ -101,7 +100,7 @@
 // --------------------------------------------------------------------------
 //
 CLocationManagerServer::CLocationManagerServer() 
-    : CPolicyServer( CActive::EPriorityStandard, 
+    : CPolicyServer( KLocManagerSessionPriority, 
                      KLocationManagerPolicy, 
                      ESharableSessions ),
                      iASW(NULL),
@@ -116,9 +115,9 @@
                      iTelServerIsOpen(EFalse),
                      iPhoneIsOpen(EFalse),
                      iNwRegistrationStatusHandler(NULL),
-                     iHomeNwInfoAvailableFlag(EFalse)
+                     iHomeNwInfoAvailableFlag(EFalse),
+                     iGeoTagTimer(NULL)
 #ifdef LOC_REVERSEGEOCODE
-                     ,iGeoTagTimer(NULL)
 					 ,iGeoTaggingPendingReqObj(NULL)
 					 ,iEcomSession(NULL)
 #endif //LOC_REVERSEGEOCODE
@@ -135,10 +134,6 @@
     LOG ("CLocationManagerServer::ConstructL() begin");
     
     StartL( KLocServerName );
-    
-    RProcess process;
-    process.SetPriority( EPriorityBackground );
-    process.Close();
 
     // initialize etel
     InitialisePhoneL();
@@ -151,57 +146,67 @@
     
     iNwRegistrationStatusHandler = CNwRegistrationStatusHandler::NewL(iPhone);
     
-    iMdeSession = CMdESession::NewL( *this );
     iLocationRecord = CLocationRecord::NewL(*this, iPhone);
     iTrackLog = CTrackLog::NewL();
+    iMdeSession = CMdESession::NewL( *this );   
+
+    iLocationRecord->SetObserver( this );
     
-    iASW->Start();
+    iLocationRecord->SetAddObserver( iTrackLog );
+    
+    iTrackLog->AddGpxObserver( this );
+    
+    CRepository* repository = CRepository::NewLC( KRepositoryUid );
+    TInt err = repository->Get( KLocationTrailShutdownTimer, iLocManStopDelay );
+    
+    LOG1("iLocManStopDelay:%d", iLocManStopDelay);
+    
+    if ( err != KErrNone )
+        {
+        LOG1("iLocManStopDelay err:%d", err);
+        iLocManStopDelay = KLocationTrailShutdownDelay;
+        }
+
+    err = repository->Get( KLocationTrailRemapShutdownTimer, iLocManStopRemapDelay );
+    CleanupStack::PopAndDestroy( repository );
+    
+    LOG1("iLocManStopRemapDelay:%d", iLocManStopRemapDelay);
+    
+    if ( err != KErrNone )
+        {
+        LOG1("iLocManStopRemapDelay err:%d", err);
+        iLocManStopRemapDelay = KLocationTrailRemapShutdownDelay;
+        }
+
+    if( !iSessionReady )
+        {
+        iASW->Start();      
+        }
+
     delete iASW;
-    iASW = NULL;
-    if(iSessionReady)
+    iASW = NULL;   
+
+    if( iSessionReady )
         {
         LOG("Session is ready to give service");
-        
-        iLocationRecord->SetObserver( this );
-        
-        iLocationRecord->SetAddObserver( iTrackLog );
-        
-        iTrackLog->AddGpxObserver( this );
-        
-        CRepository* repository = CRepository::NewLC( KRepositoryUid );
-    	TInt err = repository->Get( KLocationTrailShutdownTimer, iLocManStopDelay );
-    	
-        LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay:%d", iLocManStopDelay);
-        
-        if ( err != KErrNone )
-        	{
-            LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay err:%d", err);
-            iLocManStopDelay = KLocationTrailShutdownDelay;
-        	}
-
-        err = repository->Get( KLocationTrailRemapShutdownTimer, iLocManStopRemapDelay );
-        CleanupStack::PopAndDestroy( repository );
-        
-        LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay:%d", iLocManStopRemapDelay);
-        
-        if ( err != KErrNone )
-            {
-            LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay err:%d", err);
-            iLocManStopRemapDelay = KLocationTrailRemapShutdownDelay;
-            }
-        
-#ifdef LOC_REVERSEGEOCODE
         //Create the instance of the geotagging timer object
+        // Create timer, if n/w or reverse geo code based feature flag is enabled
+#if defined(LOC_REVERSEGEOCODE) || defined(LOC_GEOTAGGING_CELLID)
         iGeoTagTimer = CLocationGeoTagTimerAO::NewL(*iMdeSession, *this);
         //Schedule a task for geotagging every day at 3.00 AM
         iGeoTagTimer->StartTimer();
-#endif //LOC_REVERSEGEOCODE
+#endif        
         }
     else
         {
         LOG("Unable to open MDE session. Closing..");
-        User::Leave(KErrCouldNotConnect);
+        User::Leave( KErrCouldNotConnect );
         }
+        
+    RProcess process;
+    process.SetPriority( EPriorityBackground );
+    process.Close();
+    
     LOG ("CLocationManagerServer::ConstructL() end");
     }
 
@@ -213,18 +218,29 @@
 CLocationManagerServer::~CLocationManagerServer()
     {
 	LOG("CLocationManagerServer::~CLocationManagerServer ,begin");
-
+#if defined(LOC_REVERSEGEOCODE) || defined(LOC_GEOTAGGING_CELLID)
+    delete iGeoTagTimer;
+    iGeoTagTimer = NULL;
+#endif    
 #ifdef LOC_REVERSEGEOCODE
-    delete iGeoTagTimer;
     delete iGeoTaggingPendingReqObj;
+    iGeoTaggingPendingReqObj = NULL;
 #endif //LOC_REVERSEGEOCODE
     
     delete iLocationRecord;    
+    iLocationRecord = NULL;
     delete iTrackLog;    
+    iTrackLog = NULL;
     delete iTimer;
+    iTimer = NULL;
+    delete iRelationQuery;
+    iRelationQuery = NULL;
     delete iASW;
+    iASW = NULL;
     delete iMdeSession;
+    iMdeSession = NULL;
     delete iNwRegistrationStatusHandler;
+    iNwRegistrationStatusHandler = NULL;
     iTargetObjectIds.Close();
     CancelRequests(iNotifReqs);
     iNotifReqs.Close();
@@ -474,14 +490,9 @@
 //    
 void CLocationManagerServer::RemoveSession()
     {
+    LOG1( "CLocationManagerServer::RemoveSession. Session count - %d", iSessionCount);
     iSessionCount--;
-    if ( !iSessionCount 
-        && iLocationRecord 
-        && !iLocationRecord->TaggingInProgress())
-        {
-        // Nothing in progress. shutdown the server
-        CActiveScheduler::Stop();
-        }
+    StopServer();
     }    
 
 // --------------------------------------------------------------------------
@@ -1105,6 +1116,7 @@
 						}
 					iCopyReqs[i].iMessage.Complete( aError );
 					delete iCopyReqs[i].iQuery;
+					iCopyReqs[i].iQuery = NULL;
 					iCopyReqs.Remove( i );
 					break;
 					}
@@ -1151,6 +1163,7 @@
     		{
     		iCopyReqs[i].iMessage.Complete( KErrNone );
     		delete iCopyReqs[i].iQuery;
+    		iCopyReqs[i].iQuery = NULL;
     		iCopyReqs.Remove( i );
     		break;
     		}
@@ -1657,18 +1670,38 @@
 		iGeoTaggingMessage = RMessage2 ();
     	}
 #endif //LOC_REVERSEGEOCODE
+    StopServer();
+	LOG("CLocationManagerServer::GeoTaggingCompleted ,end");
+    }
+
+
+// --------------------------------------------------------------------------
+// CLocationManagerServer::StopServer
+// --------------------------------------------------------------------------
+//
+
+void CLocationManagerServer::StopServer()
+    {    
+    LOG("CLocationManagerServer::StopServer ,begin");
     // once geo tagging completed, check whether, we can terminate the server
+    // dont't stop this process if
+    // 1. when client are connected.
+    // 2. 3AM timer is going on.
+    // 3. Tagging is in progress.
     if ( !iSessionCount 
+#if defined(LOC_REVERSEGEOCODE) || defined(LOC_GEOTAGGING_CELLID)
+        && iGeoTagTimer == NULL
+#endif        
         && iLocationRecord 
         && !iLocationRecord->TaggingInProgress())
         {
         // Nothing in progress. shutdown the server
+        LOG("Stop the schedular");
         CActiveScheduler::Stop();
         }
-	LOG("CLocationManagerServer::GeoTaggingCompleted ,end");
+	LOG("CLocationManagerServer::StopServer ,end");
     }
 
-
 // --------------------------------------------------------------------------
 // CLocationManagerServer::PendingGeoTagReqComplete
 // --------------------------------------------------------------------------
@@ -1788,7 +1821,7 @@
         }
     aMessage.Complete(KErrNone);
 #else
-        aMessage.Complete(KErrNotSupported);
+    aMessage.Complete(KErrNotSupported);
 #endif //LOC_REVERSEGEOCODE
     }
 
--- a/locationmanager/server/src/clocationmanagersession.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/src/clocationmanagersession.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -52,8 +52,8 @@
     // we are expecting the application to start and stop else on server terminate, we will do the same.
     // this is not okay when user takes a photograph and then transfer photo using BT/PC .
     // at this point, it will stop the trail for camera where as camera session is still valid.
-    // DON"T CALL StopGPSPositioningL METHOD.
-//    TRAP_IGNORE(Server().StopGPSPositioningL());
+    
+
     Server().CancelNotificationRequest( iNotificationHandle );
     Server().CancelLocationRequest( iLocationHandle );
     Server().CancelTrackLogNotificationRequest( iTrackLogNotificationHandle );
--- a/locationmanager/server/src/clocationservertimerhandler.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/src/clocationservertimerhandler.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -53,7 +53,7 @@
         new( ELeave ) CLocationServerTimerHandler(aLocationServerTimerObserver);
     CleanupStack::PushL( self );
     self->ConstructL();
-    CleanupStack::Pop();
+    CleanupStack::Pop(); //self
     return self;
     }
 
--- a/locationmanager/server/src/nwregistrationstatushandler.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/server/src/nwregistrationstatushandler.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -49,7 +49,7 @@
     CNwRegistrationStatusHandler* self = new( ELeave ) CNwRegistrationStatusHandler(aMobilePhone);
        CleanupStack::PushL( self );
        self->ConstructL();
-       CleanupStack::Pop();
+       CleanupStack::Pop(); //self
        
        return self;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/bwincw/tagcreatorwinscw.def	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,7 @@
+EXPORTS
+	?CreateLocationTagsL@CTagCreator@@QAEXABVTPtrC16@@AAK01@Z @ 1 NONAME ; void CTagCreator::CreateLocationTagsL(class TPtrC16 const &, unsigned long &, class TPtrC16 const &, unsigned long &)
+	?SetSession@CTagCreator@@QAEXPAVCMdESession@@@Z @ 2 NONAME ; void CTagCreator::SetSession(class CMdESession *)
+	?AttachTagsL@CTagCreator@@QAEXKKK@Z @ 3 NONAME ; void CTagCreator::AttachTagsL(unsigned long, unsigned long, unsigned long)
+	?NewL@CTagCreator@@SAPAV1@XZ @ 4 NONAME ; class CTagCreator * CTagCreator::NewL(void)
+	??1CTagCreator@@UAE@XZ @ 5 NONAME ; CTagCreator::~CTagCreator(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/eabi/tagcreatorarm.def	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN11CTagCreator10SetSessionEP11CMdESession @ 1 NONAME
+	_ZN11CTagCreator11AttachTagsLEmmm @ 2 NONAME
+	_ZN11CTagCreator19CreateLocationTagsLERK7TPtrC16RmS2_S3_ @ 3 NONAME
+	_ZN11CTagCreator4NewLEv @ 4 NONAME
+	_ZTI11CTagCreator @ 5 NONAME
+	_ZTV11CTagCreator @ 6 NONAME
+
--- a/locationmanager/tagcreator/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/tagcreator/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -2,9 +2,9 @@
 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- a/locationmanager/tagcreator/group/tagcreator.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/tagcreator/group/tagcreator.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -27,7 +27,7 @@
 
 #if defined(WINSCW)
 deffile ../bwincw/tagcreatorwinscw.def
-#elif defined(ARMCC)
+#elif defined(EABI)
 deffile ../eabi/tagcreatorarm.def
 #endif
 nostrictdef
@@ -35,7 +35,7 @@
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
 USERINCLUDE     ../../../inc
-USERINCLUDE     ../../reversegeocode/inc
+USERINCLUDE     ../../ReverseGeocode/inc
 
 
 
@@ -49,7 +49,6 @@
 LIBRARY	    mdeclient.lib
 LIBRARY     estor.lib
 LIBRARY	    platformenv.lib
-DEBUGLIBRARY flogger.lib
 
 
 PAGED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/inc/ctagcreator.h	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,128 @@
+/*
+* 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:  A class for creating country and city tags for media files.
+*
+*/
+
+
+#ifndef C_TAGCREATOR_H
+#define C_TAGCREATOR_H
+
+#include "mdesession.h"
+#include "mdenamespacedef.h"
+#include <mdeconstants.h>
+
+/**
+ *
+ *  @since S60 9.2
+ */
+class CTagCreator : public CBase
+    {
+public:  
+    /**
+     * 2-phased constructor.
+     */
+    IMPORT_C static CTagCreator* NewL( );
+
+    /**
+     * C++ destructor.
+     */    
+    IMPORT_C virtual ~CTagCreator();
+    
+    /**
+     * Attach country and city tags to an image file/object.
+     * @param aObjectId, object Id for image/video to be tagged.
+     * @param aCountryTagId, a country tag Id.
+     * @param aCityTagId, a city tag Id.
+	   * @return None.
+     */
+   IMPORT_C void AttachTagsL( const TUint32 aObjectId, const TItemId aCountryTagId, 
+                              const TItemId aCityTagId );
+    /**
+     * Creates country and city tags.
+     * @param aCountry, a country name.
+     * @param aCountryTagId, reference to a country tag Id.
+     * @param aCity, a city name.
+     * @param aCityTagId, a reference to a city tag Id.
+	   * @return None.
+     */
+    IMPORT_C void CreateLocationTagsL( const TPtrC& aCountry, TItemId& aCountryTagId, 
+                                      const TPtrC& aCity, TItemId& aCityTagId );
+
+	/**
+	  * Sets the CMdESession for tag creation
+	  * @param aSession  the CMdESession object
+	  */
+    IMPORT_C void SetSession( CMdESession* aSession );
+
+public:
+
+	/**
+	  * Creates a tag for the country
+	  * @param aCountry country name
+	  * @param aCity city name
+	  * @param aCountryTagId   The country tag Id
+	  */    
+    void CreateTagForCountryL( const TPtrC& aCountry, 
+                TItemId& aCountryTagId );
+
+	/**
+	  * Creates a tag for the city
+	  * @param aCountry The country name
+	  * @param aCity   The city name
+	  *	@param aCityTagId  The city tag Id
+	  */		
+    void CreateTagForCityL( const TPtrC& aCountry, const TPtrC& aCity, TItemId& aCityTagId);
+    
+private:
+    /**
+     * C++ constructor.
+     */  
+    CTagCreator( );
+    
+    /**
+     * 2nd phase constructor.
+     */
+    void ConstructL();
+
+	/**
+	  * Creates a tag object and adds it to the database
+	  * @param aTitle  The title associated with the tag
+	  * @param aUri  The uri associated with the tag
+	  * @return The itemId of the newly created tag in the database	
+	  */	
+    TUint32 CreateTagL( const TPtrC& aTitle, 
+        const TPtrC& aUri, 
+        MdeConstants::Tag::TTagType aTagType );
+	/**
+	  * Finds if a tag with the given uri exists
+	  * @param  aUri The uri by which the tag is to be searched
+	  * @return  The ItemId of the tag if it exists,0 otherwise
+	  */	
+    
+    TUint32 TagExistsL( const TPtrC& aUri  );
+    
+private:
+
+	/**
+	  *  iMdeSession
+	  *  an instance of the CMdESession 
+	  */		
+    CMdESession* iMdeSession;
+    
+    };
+
+#endif // C_TAGCREATOR_H
+
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/sis/depends.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component"
+  xmlns:ad="http://nokia.com/arrow/application_metadata">
+  <appResources>
+     <appResource>
+        <language>1</language>
+        <iacName>MdS Location Manager</iacName>
+        <iacDescription>Upgrade package for MdS Tag Creator</iacDescription>
+     </appResource>
+  </appResources>
+  <swPlatformDep>
+     <platform>S60</platform>
+     <versionFrom>
+        <major>5</major>
+        <minor>0</minor>
+        <date>
+           <year>2009</year>
+           <week>16</week>
+        </date>
+     </versionFrom>
+  </swPlatformDep>
+  <interDeps>
+  </interDeps>
+</ad:metadata>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/sis/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,29 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"TagCreator Patch"},(0x2002701E), 2, 0, 0, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/sis/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,30 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;Header
+# {"tagcreator"}, (0x2002701E), 1, 0, 0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files
+
+
Binary file locationmanager/tagcreator/sis/tagcreator_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/tagcreator/src/ctagcreator.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,307 @@
+/*
+* 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:  A class for creating country and city tags for media files
+*
+*/
+
+#include "ctagcreator.h"
+#include "locationmanagerdebug.h"
+
+#include "mdccommon.h"
+#include "mdeobjectdef.h"
+#include "mdepropertydef.h"
+#include "mderelation.h"
+#include "mdequery.h"
+#include "mdeconstants.h"
+
+using namespace MdeConstants;
+
+_LIT ( KCountry, "country:");   // country:finland
+_LIT ( KCity, "city:");         // city:helsinki|country:finland
+_LIT ( KSeparator, "|" );       // Separator for city tag. Separate city and country.
+
+// --------------------------------------------------------------------------
+// CTagCreator::NewL
+// --------------------------------------------------------------------------
+//
+EXPORT_C CTagCreator* CTagCreator::NewL( )
+    {
+    LOG( "CTagCreator::NewL(), begin" );
+    CTagCreator* self = new (ELeave) CTagCreator( );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    LOG( "CTagCreator::NewL(), end" );
+    return self;
+    }
+        
+// --------------------------------------------------------------------------
+// CTagCreator::CTagCreator
+// --------------------------------------------------------------------------
+//  
+CTagCreator::CTagCreator(  ) 
+    {
+
+    }
+
+// --------------------------------------------------------------------------
+// CTagCreator::ConstructL
+// --------------------------------------------------------------------------
+//    
+void CTagCreator::ConstructL()
+    {
+    
+    }
+    
+// --------------------------------------------------------------------------
+// CTagCreator::~CTagCreator
+// --------------------------------------------------------------------------
+//    
+CTagCreator::~CTagCreator()
+    {
+  		
+    }
+
+// --------------------------------------------------------------------------
+// CTagCreator::SetMdeSession()
+// --------------------------------------------------------------------------
+//
+EXPORT_C void CTagCreator::SetSession(CMdESession* aSession)
+    {
+    iMdeSession = aSession;
+    }
+
+// ---------------------------------------------------------------------------
+// CTagCreator::CreateTagForCountryL() 
+// ---------------------------------------------------------------------------
+//
+void CTagCreator::CreateTagForCountryL( const TPtrC& aCountry, 
+                        TItemId& aCountryTagId )
+    {
+    LOG( "CTagCreator::CreateTagForCountryL - begin" );
+    
+    // Crete new string for uri, -> country:India.
+    TUint totalLength = ( aCountry.Length() + KCountry().Length() );
+    HBufC* buf = HBufC::NewLC( totalLength );
+    TPtr uriPtr = buf->Des();
+    _LIT(KCountryUriFormat, "%S%S");
+    uriPtr.Format(KCountryUriFormat, &(KCountry()), &aCountry); 
+    
+    // Check if there is allready tag for current country.
+    aCountryTagId = TagExistsL( uriPtr );
+       
+    if( !aCountryTagId )
+	   {
+	   // No tag, create tag for country.
+	   aCountryTagId = CreateTagL( aCountry, uriPtr, MdeConstants::Tag::ESystemDefineCountryTags);
+	   }  
+      
+    CleanupStack::PopAndDestroy( buf );
+    
+    LOG( "CTagCreator::CreateTagForCountryL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CTagCreator::CreateTagForCityL() 
+// ---------------------------------------------------------------------------
+//
+void CTagCreator::CreateTagForCityL( const TPtrC& aCountry, const TPtrC& aCity, TItemId& aCityTagId )
+    {
+    LOG( "CTagCreator::CreateTagForCityL - begin" );
+
+    // Crete new string for uri, -> city:bangalore|country:india
+    TUint totalLength = ( aCity.Length() + KCity.iTypeLength +
+        aCountry.Length() + KCountry.iTypeLength + KSeparator.iTypeLength );
+    
+    HBufC* buf = HBufC::NewLC( totalLength );
+    TPtr uriPtr = buf->Des();
+    _LIT(KCityCountryUriFormat, "%S%S%S%S%S");
+    uriPtr.Format(KCityCountryUriFormat,
+                    &(KCity()),
+                    &aCity,
+                    &(KSeparator()),
+                    &(KCountry()),
+                    &aCountry);
+        
+    // Check if there is allready tag for current city.
+    aCityTagId = TagExistsL( uriPtr );
+	
+	if( !aCityTagId )
+		{
+		// No tag, create tag for city.
+		aCityTagId = CreateTagL( aCity, uriPtr, MdeConstants::Tag::ESystemDefineCityTags);
+		}
+    
+    CleanupStack::PopAndDestroy( buf );
+ 
+    LOG( "CTagCreator::CreateTagForCityL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CTagCreator::CreateTagL 
+// ---------------------------------------------------------------------------
+//
+TUint32 CTagCreator::CreateTagL( const TPtrC& aTitle, 
+        const TPtrC& aUri,
+        MdeConstants::Tag::TTagType aTagType)
+    {
+    LOG( "CTagCreator::CreateTagL - begin" );
+
+    CMdENamespaceDef& defaultNamespace = iMdeSession->GetDefaultNamespaceDefL();
+    // Create tag object.
+    CMdEObjectDef& tagObjectDef = defaultNamespace.GetObjectDefL( Tag::KTagObject );
+
+	CMdEObject* tagObject = NULL;
+    tagObject = iMdeSession->NewObjectLC( tagObjectDef, aUri );
+	
+	// Type defs.
+	CMdEPropertyDef& creationDef = tagObjectDef.GetPropertyDefL(
+		Object::KCreationDateProperty );
+	CMdEPropertyDef& modifiedDef = tagObjectDef.GetPropertyDefL(
+		Object::KLastModifiedDateProperty );
+	CMdEPropertyDef& sizeDef = tagObjectDef.GetPropertyDefL(
+		Object::KSizeProperty );
+	CMdEPropertyDef& itemTypeDef = tagObjectDef.GetPropertyDefL(
+		Object::KItemTypeProperty );
+	CMdEPropertyDef& titleDef = tagObjectDef.GetPropertyDefL(
+		Object::KTitleProperty );
+	
+	// Set propertys.
+	TTime universalTime;
+    universalTime.UniversalTime(); 
+
+    // Creation time.
+	tagObject->AddTimePropertyL( creationDef, universalTime );   
+
+    // Modification time.
+	tagObject->AddTimePropertyL( modifiedDef, universalTime );
+
+    // Size 
+	tagObject->AddUint32PropertyL( sizeDef, aTagType); 
+	
+	// ItemType.
+	tagObject->AddTextPropertyL( itemTypeDef, Tag::KTagItemType );
+	
+	// Title, for country.
+	if ( aTitle.Length() > 0 )
+	    {
+	    tagObject->AddTextPropertyL( titleDef, aTitle ); // Add title
+	    }
+	
+	// Finally add to database.
+	TItemId itemId = iMdeSession->AddObjectL( *tagObject );
+    
+    CleanupStack::PopAndDestroy( tagObject );
+    
+    LOG( "CTagCreator::CreateTagL - end" );
+    
+    return itemId;
+    }
+
+// ---------------------------------------------------------------------------
+// CTagCreator::TagExistsL 
+// ---------------------------------------------------------------------------
+//
+TUint32 CTagCreator::TagExistsL( const TPtrC& aUri  )
+    {
+    LOG( "CTagCreator::TagExistsL - begin" );
+  
+    CMdEObject* mdeObject = NULL;
+    mdeObject = iMdeSession->GetObjectL( aUri ) ; // Just to find out if it exists.
+    
+    if( mdeObject )
+        {
+        LOG( "CTagCreator::TagExistsL - returning object id" );
+        return mdeObject->Id();
+        }
+    else
+        {
+        LOG( "CTagCreator::TagExistsL - No object, return 0" );
+        return 0;
+        } 
+    }
+    
+// ---------------------------------------------------------------------------
+// CGeoTagger::AttachTagsL 
+// Create relationship to country and city tag
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTagCreator::AttachTagsL( const TUint32 aObjectId, const TItemId aCountryTagId, 
+                             const TItemId aCityTagId )
+    {
+    LOG( "CGeoTagger::AttachTagsL" );
+    CMdENamespaceDef& defaultNamespace = iMdeSession->GetDefaultNamespaceDefL();
+    // contains relation definition
+    CMdERelationDef& containsRelDef = defaultNamespace.GetRelationDefL(
+        Relations::KContains );
+    
+    // Create relation between country tag and media object (image/video).
+    CMdERelation* relationObject = NULL;
+    if ( aCountryTagId )
+        {
+        relationObject = iMdeSession->NewRelationLC ( containsRelDef,
+                aObjectId, aCountryTagId, 0 );
+        
+        if ( !relationObject )
+            {
+            LOG( "CGeoTagger::AttachTagsL - Couldn't create relation object!" );
+            User::Leave ( KErrBadHandle );
+            }
+        
+        iMdeSession->AddRelationL( *relationObject );
+            
+        CleanupStack::PopAndDestroy( relationObject );
+        } 
+    
+    // Create relation between city tag and media object (image/video). 
+    if ( aCityTagId )
+        {
+        relationObject = iMdeSession->NewRelationLC ( containsRelDef,
+                    aObjectId, aCityTagId, 0 );
+        
+        if ( !relationObject)
+            {
+            LOG( "CGeoTagger::AttachTagsL - Couldn't create relation object!" );
+            User::Leave ( KErrBadHandle );
+            }
+        
+        iMdeSession->AddRelationL( *relationObject );
+                
+        CleanupStack::PopAndDestroy( relationObject );
+        }      
+
+    LOG( "CGeoTagger::AttachTagsL - end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CGeoTagger::CreateLocationTagsL 
+// Create country and city tags
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CTagCreator::CreateLocationTagsL( const TPtrC& aCountry, TItemId& aCountryTagId, 
+                                               const TPtrC& aCity, TItemId& aCityTagId)
+	{        
+	LOG( "CGeoTagger::CreateLocationTagsL" );
+    if( aCountry.Length() > 0 )
+        {
+        CreateTagForCountryL( aCountry, aCountryTagId );
+        } 
+                             
+    if( aCity.Length() > 0 )
+        {
+        CreateTagForCityL( aCountry, aCity, aCityTagId );
+        }
+	} 
+   
+// End of file
--- a/mds_plat/harvester_framework_api/inc/harvesterclient.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/mds_plat/harvester_framework_api/inc/harvesterclient.h	Wed Aug 18 10:12:07 2010 +0300
@@ -32,6 +32,7 @@
 class MHarvesterEventObserver;
 class CHarvesterRequestActive;
 class CHarvesterRequestQueue;
+class CHarvesterNotificationQueue;
 class MHarvesterSessionObserver;
 class CHarvesterSessionWatcher;
 
@@ -336,8 +337,9 @@
          * @param aService  Service request which to execute on server side
          * @param aArgs     Parameters for harvesting
          * @param aStatus   Status of the asunchronous call
+		 * @param aUri      Uri of the file to be harvested
          */ 
-        void HarvestFile( TInt& aService, TIpcArgs& aArgs, TRequestStatus& aStatus  );
+        void HarvestFile( TInt& aService, TIpcArgs& aArgs, TRequestStatus& aStatus, TDesC& aUri );
 
         /**
          * Restricted method for doing fast harvesting. These files
@@ -360,11 +362,6 @@
          * Private method for version.
          */      
         TVersion Version() const;
-
-        /**
-         * Harvester client active object.
-         */    
-        CHarvesterClientAO* iHarvesterClientAO;
         
         /** 
          * Pointer to Harvester event observer active object.
@@ -375,6 +372,11 @@
          * Request queue processor.
          */
         CHarvesterRequestQueue* iRequestQueue;
+
+        /**
+         * Notification queue processor.
+         */
+        CHarvesterNotificationQueue* iNotificationQueue;
         
         /**
          * Harvester session observer AO.
--- a/mds_plat/location_manager_api/group/bld.inf	Tue Jul 06 14:44:37 2010 +0300
+++ b/mds_plat/location_manager_api/group/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -31,9 +31,7 @@
 ../inc/locationeventdef.h MW_LAYER_PLATFORM_EXPORT_PATH(locationeventdef.h)
 ../inc/geotagobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(geotagobserver.h)
 ../inc/rlocationgeotagger.h MW_LAYER_PLATFORM_EXPORT_PATH(rlocationgeotagger.h)
-#ifdef _LOC_REVERSEGEOCODE
 ../inc/geotagger.h MW_LAYER_PLATFORM_EXPORT_PATH(geotagger.h)
-#endif
 
 PRJ_MMPFILES
 
--- a/mds_plat/location_manager_api/inc/geotagger.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/mds_plat/location_manager_api/inc/geotagger.h	Wed Aug 18 10:12:07 2010 +0300
@@ -31,7 +31,7 @@
  *  @since S60 9.2
  */
  
-class CGeoTagger : public CBase
+NONSHARABLE_CLASS(CGeoTagger) : public CBase
     {
 public:  
     /**
--- a/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -27,13 +27,12 @@
 CAPABILITY      ALL -TCB
 VENDORID        VID_DEFAULT
 
-DEFFILE         LocationManagerTestScripter.DEF
+DEFFILE         LocationManagerTestScripter.def
 
 #ifdef _LOC_REVERSEGEOCODE
 MACRO LOC_REVERSEGEOCODE
 #endif
 
-
 SOURCEPATH      ../src
 SOURCE          LocationManagerTestScripter.cpp
 SOURCE          LocationManagerTestScripterBlocks.cpp
--- a/mds_plat/location_manager_api/tsrc/inc/LocationManagerTestScripter.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/mds_plat/location_manager_api/tsrc/inc/LocationManagerTestScripter.h	Wed Aug 18 10:12:07 2010 +0300
@@ -32,7 +32,7 @@
 #include "mdesession.h"
 
 #ifdef LOC_REVERSEGEOCODE
-#include "RLocationGeoTagger.h"
+#include "rlocationgeotagger.h"
 #endif //LOC_REVERSEGEOCODE
 
 // CONSTANTS
--- a/metadataengine/client/group/mdeclient.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/group/mdeclient.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -32,7 +32,7 @@
 
 #if defined(WINSCW)
     deffile ../bwincw/mdeclientu.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/mdeclientu.def
 #endif
 nostrictdef
--- a/metadataengine/client/src/mdeasynchronousfindao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeasynchronousfindao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -132,8 +132,10 @@
     Cancel(); // Causes call to DoCancel()
 
 	delete iDistinctResults;
+	iDistinctResults = NULL;
 
 	delete iConditionBuffer;
+	iConditionBuffer = NULL;
 
     iResultList.ResetAndDestroy();
     iResultList.Close();
--- a/metadataengine/client/src/mdeevent.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeevent.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -70,7 +70,9 @@
 CMdEEvent::~CMdEEvent()
 	{
 	delete iSource;
+	iSource = NULL;
 	delete iParticipant;
+	iParticipant = NULL;
 	}
 
 CMdEEvent* CMdEEvent::NewL(CMdESession* aSession, CMdCSerializationBuffer& aBuffer, CMdENamespaceDef& aNamespaceDef )
--- a/metadataengine/client/src/mdeeventcondition.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeeventcondition.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -94,10 +94,15 @@
 CMdEEventCondition::~CMdEEventCondition()
 	{
     delete iCreationTimeRange;
+    iCreationTimeRange = NULL;
     delete iObjectConditions;
+    iObjectConditions = NULL;
     delete iSourceConditions;
+    iSourceConditions = NULL;
     delete iParticipantConditions;
+    iParticipantConditions = NULL;
     delete iURI;
+    iURI = NULL;
 	}
 
 
--- a/metadataengine/client/src/mdeharvestersession.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeharvestersession.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -45,6 +45,7 @@
 	{
 	iHarvestingPrioritizationChunk.Close();
 	delete iHarvestingPrioritizationSerializationBuffer;
+	iHarvestingPrioritizationSerializationBuffer = NULL;
 	}
 
 void CMdEHarvesterSession::ConstructL()
@@ -112,12 +113,20 @@
 		}
 
 	// Note: CopyLC doesn't push anything to cleanup stack
-	uri->Des().CopyLC( aUri );
+	TRAPD(err, uri->Des().CopyLC( aUri ));
 
+	if(err != KErrNone)
+	    {
+		delete uri;
+		uri = NULL;
+		return EFalse;
+	    }
+		
 	const TBool ret = iSession->EngineSession().DoSetFileToPresent( 
-			aMediaId, *uri, aFileInfo );
+	aMediaId, *uri, aFileInfo );
 	
 	delete uri;
+	uri = NULL;
 
 	return ret;
 	}
--- a/metadataengine/client/src/mdenotifierao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdenotifierao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -66,6 +66,7 @@
     {
     Cancel(); // Causes call to DoCancel()
     delete iDataBuffer;
+    iDataBuffer = NULL;
     iIdArray.Close();
     iRelationItemArray.Close();
     }
--- a/metadataengine/client/src/mdeobject.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeobject.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -582,6 +582,7 @@
 		CMdEProperty* oldProperty = iPropertyArray[f];
 		iPropertyArray[f] = &aProperty;
 		delete oldProperty;
+		oldProperty = NULL;
 		}
 	else if (err < KErrNone)
 		{
@@ -743,6 +744,7 @@
             CMdEProperty* oldProperty = iPropertyArray[f];
             iPropertyArray[f] = aObject.iPropertyArray[i];
             delete oldProperty;
+            oldProperty = NULL;
             }
         else if (err < KErrNone)
             {
@@ -817,6 +819,7 @@
         if ( prop->Removed() )
         	{
         	delete prop;
+        	prop = NULL;
         	iPropertyArray.Remove( i );
         	continue;
         	}
@@ -1055,6 +1058,7 @@
 		        CMdEProperty* oldProperty = newObject->iPropertyArray[f];
 		        newObject->iPropertyArray[f] = property;
 		        delete oldProperty;
+		        oldProperty = NULL;
 		        }
 		    else if (err < KErrNone)
 		        {
--- a/metadataengine/client/src/mdeobjectcondition.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeobjectcondition.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -144,15 +144,18 @@
 CMdEObjectCondition::~CMdEObjectCondition()
 	{
    	delete iString;
+   	iString = NULL;
 
    	if( iObjectIds )
     	{
     	iObjectIds->Close();
     	
     	delete iObjectIds;
+    	iObjectIds = NULL;
     	}
     
    	delete iRange;
+   	iRange = NULL;
 	}
 
 EXPORT_C const CMdEObjectDef* CMdEObjectCondition::ObjectDef() const
--- a/metadataengine/client/src/mdeproperty.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdeproperty.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -95,6 +95,7 @@
 	if (iDef.PropertyType() == EPropertyText)
 		{
 		delete iValue.iText;
+		iValue.iText = NULL;
 		}
 	}
 
--- a/metadataengine/client/src/mdequery.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdequery.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -46,13 +46,15 @@
   
     // This will destroy the entire conditions tree.
    	delete iConditions;
-
+   	iConditions = NULL;
+   	
     // Destroy all result items this query instance owns.
    	for( TInt i = iResults.Count() - 1; i >=0; i-- )
         {
         if(iResults[i].iOwned)
             {
             delete iResults[i].iItem;
+            iResults[i].iItem = NULL;
             }
         }
 
@@ -77,6 +79,7 @@
     iObservers.Close();
 
    	delete iDistinctResults;
+   	iDistinctResults = NULL;
 	}
 
 
@@ -154,6 +157,7 @@
         if(iResults[i].iOwned)
             {
             delete iResults[i].iItem;
+            iResults[i].iItem = NULL;
             }
         }
 	iResults.Reset();
--- a/metadataengine/client/src/mdequerycriteriaserialization.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdequerycriteriaserialization.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -86,6 +86,7 @@
 	if( iOwnSerializedBuffer )
 		{
 		delete iSerializedBuffer;
+		iSerializedBuffer = NULL;
 		}
 	}
 	
--- a/metadataengine/client/src/mdequeryimpl.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdequeryimpl.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -70,6 +70,7 @@
     	iAsyncFind->Cancel();
     	
     	delete iAsyncFind;
+    	iAsyncFind = NULL;
     	}
     }
 
@@ -152,6 +153,7 @@
 CMdERelationQueryImpl::~CMdERelationQueryImpl()
     {
 	delete iAsyncFind;
+	iAsyncFind = NULL;
     }
 
 
@@ -226,6 +228,7 @@
 CMdEEventQueryImpl::~CMdEEventQueryImpl()
     {
 	delete iAsyncFind;
+	iAsyncFind = NULL;
     }
 
 
--- a/metadataengine/client/src/mderelationcondition.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mderelationcondition.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -85,14 +85,19 @@
 CMdERelationCondition::~CMdERelationCondition()
     {
    	delete iLeftCondition;
+   	iLeftCondition = NULL;
    	delete iRightCondition;
+   	iRightCondition = NULL;
    	delete iParameterRange;
+   	iParameterRange = NULL;
 	delete iLastModifiedDateRange;
+	iLastModifiedDateRange = NULL;
 
 	if( iRelationIds )
 		{
 		iRelationIds->Close();
 		delete iRelationIds;
+		iRelationIds = NULL;
 		}
     }
 
--- a/metadataengine/client/src/mdesessionimpl.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdesessionimpl.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -241,6 +241,7 @@
     iSessionObserver = NULL;
 
 	delete iSchemaBuffer;
+	iSchemaBuffer = NULL;
 
 	iNotifiers.ResetAndDestroy();
 	iNotifiers.Close();
@@ -254,8 +255,10 @@
 	iNamespaceDefs.Close();
 	
 	delete iSessionStartupAO;
+	iSessionStartupAO = NULL;
 		
 	delete iAsyncHandler;
+	iAsyncHandler = NULL;
 	}
 
 void CMdESessionImpl::ConstructL()
@@ -359,7 +362,8 @@
     		{
     		User::Leave( KErrMdENotLocked );
     		}
-		items.Append( obj );
+    	
+    	items.AppendL( obj );
     	}
 
     UpdateItemsL(items);
@@ -536,6 +540,7 @@
 		}
 
 	delete iSchemaBuffer;
+	iSchemaBuffer = NULL;
 
 	iSchemaBuffer = schemaBuffer;
 	
@@ -2694,6 +2699,7 @@
     {
     const TInt index = iNotifiers.Find( aNotifier );
     delete aNotifier;
+    aNotifier = NULL;
     iNotifiers.Remove( index );
     }
 
--- a/metadataengine/client/src/mdetextpropertycondition.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/client/src/mdetextpropertycondition.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -62,6 +62,7 @@
 CMdETextPropertyCondition::~CMdETextPropertyCondition()
 	{
     delete iText;
+    iText = NULL;
 	}
 
 TUint32 CMdETextPropertyCondition::InternalQueryOptimizationFlags(TUint32& aFlags)
--- a/metadataengine/common/group/mdccommon.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/common/group/mdccommon.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -29,7 +29,7 @@
 
 #if defined(WINSCW)
     deffile ../bwincw/mdccommonu.def
-#elif defined(ARMCC)
+#elif defined(EABI)
     deffile ../eabi/mdccommonu.def
 #endif
 nostrictdef
--- a/metadataengine/common/src/mdcserializationbuffer.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/common/src/mdcserializationbuffer.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -163,6 +163,7 @@
 CMdCSerializationBuffer::~CMdCSerializationBuffer()
 	{
 	delete iHeapBuffer;
+	iHeapBuffer = NULL;
 	}
 
 EXPORT_C TPtr8 CMdCSerializationBuffer::Buffer() const
--- a/metadataengine/server/group/mdsserver.mmp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/group/mdsserver.mmp	Wed Aug 18 10:12:07 2010 +0300
@@ -93,7 +93,6 @@
 LIBRARY           flogger.lib
 LIBRARY           hash.lib
 LIBRARY			  inetprotutil.lib
-LIBRARY           platformenv.lib 
 
 UNPAGED
 
--- a/metadataengine/server/inc/mdslogger.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/inc/mdslogger.h	Wed Aug 18 10:12:07 2010 +0300
@@ -159,7 +159,7 @@
     #define __DEFINE_LOGGER             class CMdSLogger* gLogger;
     #define __USES_LOGGER               extern CMdSLogger* gLogger;
     #define __INIT_LOGGER               gLogger = CMdSLogger::NewInstanceL();
-    #define __DESTROY_LOGGER            {if(gLogger){delete gLogger;gLogger=NULL;}}
+    #define __DESTROY_LOGGER            {if(gLogger){delete gLogger; gLogger=NULL;}}
 	#define __LOGLB(CATEGORY,A)         {if (gLogger->IsActive(CATEGORY)) { gLogger->LogLit( _L(A) ); }}
 	#define __LOG(CATEGORY,A)           {if (gLogger->IsActive(CATEGORY)) { gLogger->LogLit( A ); }}
 #ifdef MDE_FILE_LOGGING
@@ -177,7 +177,7 @@
 	    	{__LOG( ELogQuery, INFO); \
 	        CMdsClauseBuffer* queryText = gLogger->DescribeFullL(BUFFER,ROWDATA); \
 	        if ( queryText ) { __LOG( ELogQuery, queryText->ConstBufferL() ); \
-	        delete queryText;} }
+	        delete queryText; queryText = NULL;} }
 	#else //LOG_QUERY
 	    #define __LOGQUERY_16(INFO, BUFFER, ROWDATA)
 	#endif //LOG_QUERY
--- a/metadataengine/server/inc/mdspreferences.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/inc/mdspreferences.h	Wed Aug 18 10:12:07 2010 +0300
@@ -225,7 +225,7 @@
 									EPreferenceExtraSortAsc  | 
 									EPreferenceExtraSortDesc;
 
-		CMdsClauseBuffer* sortBuffer = CMdsClauseBuffer::NewLC( 8 ); // estimated minimum lenght for sort rules
+		CMdsClauseBuffer* sortBuffer = CMdsClauseBuffer::NewLC( 12 ); // minimum reserved lenght for sort rules
 
 		// check if there is some order rules
 		if( KSortFlags & aFlags )
--- a/metadataengine/server/inc/mdsserversession.h	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/inc/mdsserversession.h	Wed Aug 18 10:12:07 2010 +0300
@@ -427,6 +427,7 @@
 		    	~CNotificationCacheItem()
 			    	{
 			    	delete iData;
+			    	iData = NULL;
 			    	}
 
 	    	public:
--- a/metadataengine/server/src/mdsclausebuffer.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsclausebuffer.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -54,6 +54,7 @@
 CMdsClauseBuffer::~CMdsClauseBuffer()
     {
     delete iBuffer;
+    iBuffer = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/metadataengine/server/src/mdsfindengine.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsfindengine.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -133,7 +133,9 @@
 CMdSFindEngine::~CMdSFindEngine()
     {
    	delete iSerializedCriteria;
+   	iSerializedCriteria = NULL;
    	delete iSequence;
+   	iSequence = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/metadataengine/server/src/mdsfindsqlclause.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsfindsqlclause.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -61,6 +61,7 @@
 CMdSFindSqlClause::~CMdSFindSqlClause()
     {
     delete iQueryBuf;
+    iQueryBuf = NULL;
 
     iResultRow.Close();
     iVariables.Close();
@@ -76,6 +77,7 @@
 		iSourceObjectDefs->Close();
 
 		delete iSourceObjectDefs;
+		iSourceObjectDefs = NULL;
 		}
     }
 
--- a/metadataengine/server/src/mdsgetimeiao.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsgetimeiao.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -47,6 +47,7 @@
 	Cancel();
 
 	delete iTelephony;
+	iTelephony = NULL;
 	}
 
 TInt64 CMdsGetImeiAO::GetIMEI()
--- a/metadataengine/server/src/mdsimportexport.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsimportexport.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -118,6 +118,7 @@
 CMdsImportExport::~CMdsImportExport()
 	{
    	delete iConverter;
+   	iConverter = NULL;
 
 #ifdef _DEBUG
    	if( iLogEnabled )
@@ -129,8 +130,10 @@
     iFs.Close();
 
    	delete iBuffer;
+   	iBuffer = NULL;
 
    	delete iSchema;
+   	iSchema = NULL;
 	}
 
 /**
--- a/metadataengine/server/src/mdsitemdef.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsitemdef.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -52,6 +52,7 @@
 CMdsItemDef::~CMdsItemDef()
 	{
 	delete iName;
+	iName = NULL;
 	}
 
 TUint32 CMdsItemDef::RequiredBufferSize()
--- a/metadataengine/server/src/mdsmaintenanceengine.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsmaintenanceengine.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -16,8 +16,6 @@
 */
 
 // INCLUDE FILES
-#include <driveinfo.h>
-
 #include "mdsmaintenanceengine.h"
 #include "mdslogger.h"
 #include "mdsmanipulationengine.h"
@@ -79,6 +77,7 @@
 CMdSMaintenanceEngine::~CMdSMaintenanceEngine()
     {
     delete iMaintenance;
+    iMaintenance = NULL;
     }
 
 // ------------------------------------------------
@@ -117,7 +116,17 @@
 void CMdSMaintenanceEngine::InstallL( CMdSManipulationEngine& aManipulate, CMdsSchema& aSchema )
     {
     __LOG1( ELogAlways, "Trying to validate MDS DB, error expected if not created(first boot): %d", 0 );
-    if ( !(iMaintenance->ValidateL( ) ) )
+	
+    TBool isValid(EFalse);
+    TRAPD(err, isValid = iMaintenance->ValidateL( ));
+    
+    if(err == KErrCorrupt)
+        {
+        DeleteDatabase();
+        User::Leave( err );
+        }
+    
+    else if ( !isValid )
         {
         // Pump up priority to load the MDS DB up as fast as possible to
         // enable client side session connections
@@ -272,31 +281,6 @@
     User::LeaveIfError( fs.Volume( volumeInfo, EDriveC ) );
     MMdsPreferences::InsertL( KCMediaIdKey, MMdsPreferences::EPreferenceValueSet,
     		(TUint32) volumeInfo.iUniqueID );
-
-    TInt drive( -1 );
-    TInt massStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) );
-    if( massStorageError == KErrNone )
-        {
-        TVolumeInfo massStorageVolumeInfo;
-        massStorageError = fs.Volume( massStorageVolumeInfo, drive );
-        if( massStorageError == KErrNone )
-            {
-            const TUint32 massStorageMediaId( massStorageVolumeInfo.iUniqueID );
-            massStorageError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive );
-            if( massStorageError == KErrNone )
-                {
-                massStorageError = fs.Volume( massStorageVolumeInfo, drive );
-                // Update mass storage media id if the mass storage is not memory card
-                if( massStorageError == KErrNone &&
-                    massStorageVolumeInfo.iUniqueID != massStorageMediaId &&
-                    massStorageMediaId != 0 )
-                    {
-                    MMdsPreferences::InsertL( KMassStorageMediaIdKey, MMdsPreferences::EPreferenceValueSet,
-                            (TUint32) massStorageMediaId );
-                    }        
-                }
-            }
-        }
     
     CleanupStack::PopAndDestroy( &fs );
 	}
--- a/metadataengine/server/src/mdsmanipulationengine.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsmanipulationengine.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -93,8 +93,10 @@
 CMdSManipulationEngine::~CMdSManipulationEngine()
     {
     delete iManipulate;
+    iManipulate = NULL;
     
     delete iGarbageCollector;
+    iGarbageCollector = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -153,7 +155,7 @@
         CleanupClosePushL(objStmt);
 		
         RMdSTransaction transaction( connection );
-        CleanupClosePushL(transaction);
+        CleanupClosePushL (transaction );
         const TInt beginError( transaction.Error() );
         if( beginError != KErrNone )
             {
@@ -1072,13 +1074,19 @@
     CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL();
     RMdSTransaction transaction( connection );
     CleanupClosePushL( transaction );
-    User::LeaveIfError( transaction.Error() );
+    const TInt beginError( transaction.Error() );
+    if( beginError != KErrNone )
+        {
+        CleanupStack::PopAndDestroy( &transaction );
+        }
     
     iManipulate->CheckMassStorageMediaIdL( aMediaId );
     
-    transaction.CommitL();
-
-    CleanupStack::PopAndDestroy( &transaction );
+    if( beginError == KErrNone )
+        {
+        transaction.CommitL();
+        CleanupStack::PopAndDestroy( &transaction );
+        }
     }
 
 void CMdSManipulationEngine::AddRelationDefL( TDefId aNamespaceId, const TDesC& aRelationDefName )
--- a/metadataengine/server/src/mdsnotifier.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsnotifier.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -80,6 +80,7 @@
 CMdSNotifier::~CMdSNotifier()
     {
     delete iComparator;
+    iComparator = NULL;
     
     const TInt count = iEntries.Count();
     
@@ -586,7 +587,9 @@
                 }
             
             delete e.iSerializedCondition;
+            e.iSerializedCondition = NULL;
             delete e.iDataBuffer;
+            e.iDataBuffer = NULL;
             iEntries.Remove( i );
             }
         }
--- a/metadataengine/server/src/mdsschema.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsschema.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -78,6 +78,7 @@
 	iProperties.Close();
 
 	delete iBaseObject;
+	iBaseObject = NULL;
 	}
 
 void CMdsSchema::Reset()
--- a/metadataengine/server/src/mdsserver.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsserver.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -403,6 +403,7 @@
     // TRAP InstallL - first time for if there has been schema update, and 
     // the DB version is too old. Delete the DB and try to recreate it
     TRAPD( error, iMaintenance->InstallL( *iManipulate, *iSchema ) );
+    
     if( error == KErrCorrupt )
         {
         delete iSchema;
@@ -419,6 +420,7 @@
         // during update, and the first attempt to recreate the DB fails. 
         // Then schema file in rom is used for final attempt to recreate the DB
         TRAP( error, iMaintenance->InstallL( *iManipulate, *iSchema ) );
+        
         if( error == KErrCorrupt )
             {
             delete iSchema;
@@ -487,19 +489,30 @@
     iClientThread.Close();
     
 	delete iBURWatcher;
+	iBURWatcher = NULL;
 	delete iDiskSpaceGarbageCollectorNotifier;
+	iDiskSpaceGarbageCollectorNotifier = NULL;
 	delete iDiskFullNotifier;
+	iDiskFullNotifier = NULL;
     delete iManipulate;
+    iManipulate = NULL;
     delete iSchema;
+    iSchema = NULL;
     delete iNotifier;
+    iNotifier = NULL;
     delete iLockList;
+    iLockList = NULL;
     delete iMaintenance;
+    iMaintenance = NULL;
     delete iDefaultDBConnection;
+    iDefaultDBConnection = NULL;
 
     delete iHarvestingPrioritizationSerializationBuffer;
+    iHarvestingPrioritizationSerializationBuffer = NULL;
 	iHarvestingPrioritizationChunk.Close();
 	
 	delete iShutdownObserver;
+	iShutdownObserver = NULL;
 
     __LOGLB( ELogAlways, "Server stop" );
     __DESTROY_LOGGER;
@@ -947,6 +960,7 @@
  		{
  		TRAP(result, CMdSServer::ThreadFunctionL());
 		delete cleanup;
+		cleanup = NULL;
  		}
     __UHEAP_MARKEND;
  	return result;
--- a/metadataengine/server/src/mdsserversession.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdsserversession.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -601,7 +601,7 @@
 
     CleanupStack::Pop( find );
     
-    iFindEngines.Append( find );
+    iFindEngines.AppendL( find );
     }
 
 // ---------------------------------------------------------------------------
@@ -641,7 +641,7 @@
 
     CleanupStack::Pop( find );
     
-    iFindEngines.Append( find );
+    iFindEngines.AppendL( find );
     }
 
 // ---------------------------------------------------------------------------
@@ -678,6 +678,7 @@
     else if( findEngine->IsComplete() )
     	{
     	delete findEngine;
+    	findEngine = NULL;
 
     	iFindEngines.Remove( feIndex );
     	
@@ -708,6 +709,7 @@
     		findEngine->Cancel( aError );
 
     		delete findEngine;
+    		findEngine = NULL;
 
     		iFindEngines.Remove( i );
 
@@ -864,6 +866,7 @@
             if ( serverRequest != EAsyncFindSetReady )
                 {
                 delete findEngine;
+                findEngine = NULL;
                 
                 iFindEngines.Remove( findEngineIndex );
                 iFindEngines.Compress();
--- a/metadataengine/server/src/mdssqldbmaintenance.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdssqldbmaintenance.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -50,15 +50,153 @@
 
 TBool CMdSSqlDbMaintenance::ValidateL(  )
     {
+    //validate content of critical tables
     _LIT( KValidateTableExistence, "SELECT COUNT(*) FROM MdE_Preferences;" );
+    _LIT( KValidateObjectDef, "SELECT COUNT(*) FROM ObjectDef;" );
+    _LIT( KValidatePropertyDef, "SELECT COUNT(*) FROM PropertyDef;" );
+    _LIT( KValidateRelationDef, "SELECT COUNT(*) FROM RelationDef;" );
+    _LIT( KValidateCol2Prop, "SELECT COUNT(*) FROM Col2Prop;" );
 
+    TInt test(KErrNone);
+    TUint32 count(0);
+    
+    RRowData emptyRowData;
+    CleanupClosePushL( emptyRowData );
+        
     RMdsStatement validationQuery;
     CleanupClosePushL( validationQuery );
-    RRowData emptyRowData;
-    CleanupClosePushL( emptyRowData );
+    
     CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL();
-	TRAPD( test, connection.ExecuteQueryL( KValidateTableExistence, validationQuery, emptyRowData ) );
-	CleanupStack::PopAndDestroy( 2, &validationQuery );
+    
+	TRAP( test, connection.ExecuteQueryL( KValidateTableExistence, validationQuery, emptyRowData ) );
+	if(test == KErrNone)
+        {
+        emptyRowData.AppendL( TColumn( count ) );
+        TRAP( test, connection.NextRowL(validationQuery, emptyRowData));
+        if(test == KErrNone)
+            {
+            emptyRowData.Column(0).Get( count );
+                    
+            if(count <= 0)
+                {
+                test = KErrCorrupt;
+                }
+            }
+        }
+	
+	CleanupStack::PopAndDestroy( &validationQuery );
+	emptyRowData.Reset();
+	
+	RMdsStatement objectDefQuery;
+	CleanupClosePushL( objectDefQuery );
+	
+	if( test == KErrNone )
+        {
+        TRAP( test, connection.ExecuteQueryL( KValidateObjectDef, objectDefQuery, emptyRowData ) );
+        
+        if(test == KErrNone)
+            {
+            emptyRowData.AppendL( TColumn( count ) );
+            TRAP( test, connection.NextRowL(objectDefQuery, emptyRowData));
+            if(test == KErrNone)
+                {
+                emptyRowData.Column(0).Get( count );
+                        
+                if(count <= 0)
+                    {
+                    test = KErrCorrupt;
+                    }
+                }
+            }
+        }
+    
+	CleanupStack::PopAndDestroy( &objectDefQuery );
+	emptyRowData.Reset();
+	
+	RMdsStatement propertyDefQuery;
+	CleanupClosePushL( propertyDefQuery );
+
+	if( test == KErrNone )
+	    {
+        TRAP( test, connection.ExecuteQueryL( KValidatePropertyDef, propertyDefQuery, emptyRowData ) );
+        if(test == KErrNone)
+            {
+            emptyRowData.AppendL( TColumn( count ) );
+            TRAP( test, connection.NextRowL(propertyDefQuery, emptyRowData));
+            if(test == KErrNone)
+                {
+                emptyRowData.Column(0).Get( count );
+                
+                if(count <= 0)
+                    {
+                    test = KErrCorrupt;
+                    }
+                }
+            }
+	    }
+	
+	CleanupStack::PopAndDestroy( &propertyDefQuery );
+	emptyRowData.Reset();
+	
+    RMdsStatement relationDefQuery;
+    CleanupClosePushL( relationDefQuery );
+	
+	if( test == KErrNone )
+	    {
+	    TRAP( test, connection.ExecuteQueryL( KValidateRelationDef, relationDefQuery, emptyRowData ) );
+	    if(test == KErrNone)
+	        {
+            emptyRowData.AppendL( TColumn( count ) );
+            TRAP( test, connection.NextRowL(relationDefQuery, emptyRowData));
+            
+            if(test == KErrNone)
+                {
+                emptyRowData.Column(0).Get( count );
+                
+                if(count <= 0)
+                    {
+                    test = KErrCorrupt;
+                    }
+                }
+            }
+	    }
+	
+	CleanupStack::PopAndDestroy( &relationDefQuery );
+	emptyRowData.Reset();
+    
+    RMdsStatement col2propQuery;
+    CleanupClosePushL( col2propQuery );
+    
+    if( test == KErrNone )
+        {
+        TRAP( test, connection.ExecuteQueryL( KValidateCol2Prop, col2propQuery, emptyRowData ) );
+        if(test == KErrNone)
+            {
+            emptyRowData.AppendL( TColumn( count ) );
+            TRAP( test, connection.NextRowL(col2propQuery, emptyRowData));
+            
+            if(test == KErrNone)
+                {
+                emptyRowData.Column(0).Get( count );
+                
+                if(count <= 0)
+                    
+                    {
+                    test = KErrCorrupt;
+                    }
+                }
+            }
+          }
+    CleanupStack::PopAndDestroy( &col2propQuery );
+    emptyRowData.Reset();
+     
+    CleanupStack::PopAndDestroy( &emptyRowData );
+    
+    if(test == KErrCorrupt )
+        {
+        User::Leave( test );
+        }
+    
     return ( test == KErrNone );
     }
 
--- a/metadataengine/server/src/mdssqlfindoperation.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdssqlfindoperation.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -86,7 +86,9 @@
     iQueryId.Close();
 
    	delete iResults;
+   	iResults = NULL;
    	delete iFindClause;
+   	iFindClause = NULL;
     }
 
 TInt CMdSSqlFindOperation::ExecuteL()
--- a/metadataengine/server/src/mdssqliteconnection.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdssqliteconnection.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -48,6 +48,7 @@
     CloseDb();
 
     delete iDbFileName;
+    iDbFileName = NULL;    
 
     iNotFinishFindQuery = NULL;
     }
@@ -543,6 +544,11 @@
     if (err != KErrNone)
     	{
     	_LIT( KMdsTransactionBegin, "Transaction begin error" );
+        if( !iNotFinishFindQuery )
+            {
+            iEnableTransaction = ETrue;
+            }
+        iTransactionOngoing = EFalse;
     	TraceAndLeaveL( KMdsTransactionBegin, err );
     	}
 	CleanupStack::PopAndDestroy( &emptyRow );
@@ -581,16 +587,16 @@
     RRowData emptyRow;
     CleanupClosePushL( emptyRow );
     TRAPD( err, ExecuteL(KRollback, emptyRow) );
+    if (err != KErrNone)
+        {
+        _LIT( KMdsTransactionRollback, "Transaction rollback error" );
+        TraceAndLeaveL( KMdsTransactionRollback, err );
+        }    
     if( !iNotFinishFindQuery )
         {
         iEnableTransaction = ETrue;
         }
     iTransactionOngoing = EFalse;
-    if (err != KErrNone)
-    	{
-    	_LIT( KMdsTransactionRollback, "Transaction rollback error" );
-    	TraceAndLeaveL( KMdsTransactionRollback, err );
-    	}
 	CleanupStack::PopAndDestroy( &emptyRow );
     }
 
--- a/metadataengine/server/src/mdssqlobjectmanipulate.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/metadataengine/server/src/mdssqlobjectmanipulate.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -71,6 +71,7 @@
 CMdSIdentifierGenerator::~CMdSIdentifierGenerator()
     {
     delete iDigest;
+    iDigest = NULL;
     }
 
 void CMdSIdentifierGenerator::ConstructL( )
@@ -178,11 +179,14 @@
 	for (TInt i = 0; i < count; ++i)
 		{
 		delete iBuffers[i].iBuffer;
+		iBuffers[i].iBuffer = NULL;
 		}
 	iBuffers.Close();
 
 	delete iGenerator;
+	iGenerator = NULL;
 	delete iUri;
+	iUri = NULL;
     }
 
 CMdSSqlObjectManipulate::CMdSSqlObjectManipulate( const CMdsSchema& aSchema, 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+ <package id="mds" name="Metadata Services" levels="mgr eng server int">
+  <collection id="mds_plat" name="Metadata Services Platform Interfaces" level="int">
+   <component id="context_engine_plugin_api" name="Context Engine Plugin API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_plat/context_engine_plugin_api/context_engine_plugin_api.metaxml"/>
+    <unit bldFile="mds_plat/context_engine_plugin_api/group" filter="!test"/>
+    <unit bldFile="mds_plat/context_engine_plugin_api/tsrc/group" filter="test,api_test"/>
+   </component>
+   <component id="harvester_framework_api" name="Harvester Framework API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_plat/harvester_framework_api/harvester_framework_api.metaxml"/>
+    <unit bldFile="mds_plat/harvester_framework_api/group" filter="!test"/>
+    <unit bldFile="mds_plat/harvester_framework_api/tsrc/group" filter="test,api_test"/>
+		<!-- can only have one unit with the same filter, #include the following from the previous unit -->
+    <unit bldFile="mds_plat/harvester_framework_api/tsrc/composerplugintest/group" filter="test,api_test"/>
+    <unit bldFile="mds_plat/harvester_framework_api/tsrc/harvesterclienttest/group" filter="test,api_test"/>
+    <unit bldFile="mds_plat/harvester_framework_api/tsrc/harvesterdatatest/group" filter="test,api_test"/>
+    <unit bldFile="mds_plat/harvester_framework_api/tsrc/harvesterplugintest/group" filter="test,api_test"/>
+    <unit bldFile="mds_plat/harvester_framework_api/tsrc/monitorplugintest/group" filter="test,api_test"/>
+   </component>
+   <component id="location_manager_api" name="Location Manager API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_plat/location_manager_api/location_manager_api.metaxml"/>
+    <unit bldFile="mds_plat/location_manager_api/group" filter="!test"/>
+    <unit bldFile="mds_plat/location_manager_api/tsrc/group" filter="test,api_test"/>
+   </component>
+   <component id="metadata_engine_api" name="Metadata Engine API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_plat/metadata_engine_api/metadata_engine_api.metaxml"/>
+    <unit bldFile="mds_plat/metadata_engine_api/group" filter="!test"/>
+    <unit bldFile="mds_plat/metadata_engine_api/tsrc/group" filter="test,api_test"/>
+   </component>
+   <component id="content_listing_framework_collection_manager_api" name="Content Listing Framework Collection Manager API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_plat/content_listing_framework_collection_manager_api/content_listing_framework_collection_manager_api.metaxml"/>
+    <meta rel="config">
+     <defined condition="RD_MDS_2_5"/>
+    </meta>
+    <unit bldFile="mds_plat/content_listing_framework_collection_manager_api/group" filter="!test"/>
+    <unit bldFile="mds_plat/content_listing_framework_collection_manager_api/tsrc/group" filter="test,api_test"/>
+   </component>
+   <component id="content_listing_framework_extended_api" name="Content Listing Framework Extended API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_plat/content_listing_framework_extended_api/content_listing_framework_extended_api.metaxml"/>
+    <meta rel="config">
+     <defined condition="RD_MDS_2_5"/>
+    </meta>
+    <unit bldFile="mds_plat/content_listing_framework_extended_api/group"/>
+   </component>
+  </collection>
+  <collection id="mds_pub" name="Metadata Services Public Interfaces" level="int">
+   <component id="content_listing_framework_api" name="Content Listing Framework API" introduced="^2" class="api" filter="s60">
+    <meta rel="Api" href="mds_pub/content_listing_framework_api/content_listing_framework_api.metaxml"/>
+    <meta rel="config">
+     <defined condition="RD_MDS_2_5"/>
+    </meta>
+    <unit bldFile="mds_pub/content_listing_framework_api/group" filter="!test"/>
+    <unit bldFile="mds_pub/content_listing_framework_api/tsrc/group" filter="test,api_test"/>
+   </component>
+  </collection>
+  <collection id="metadataengine" name="Metadata Engine" level="eng">
+   <component id="metadataengine_build" filter="s60" name="Metadata Engine Build" introduced="^2">
+    <!--collection is really a component. Move down a directory  -->
+    <unit bldFile="metadataengine/group"/>
+   </component>
+  </collection>
+  <collection id="locationmanager" name="Location Manager" level="mgr">
+   <component id="geoconverter" filter="s60" name="Geoconverter" introduced="^4">
+    <meta rel="config">
+    <defined condition="_LOC_GEOTAGGING_CELLID"/>
+   </meta>
+    <unit bldFile="locationmanager/geoconverter/group"/>
+   </component>
+   <component id="geo_tagcreator" filter="s60" name="Geo Tag Creator" introduced="^4">
+    <meta rel="config">
+    <defined condition="_LOC_REVERSEGEOCODE"/>
+   </meta>
+    <unit bldFile="locationmanager/tagcreator/group"/>
+   </component>
+   <component id="reversegeocode" filter="s60" name="Reverse Geocode" introduced="^4">
+    <meta rel="config">
+    <defined condition="_LOC_REVERSEGEOCODE"/>
+   </meta>
+    <unit bldFile="locationmanager/ReverseGeocode/group"/>
+   </component>
+   <component id="reversegeocoderplugin" filter="s60" name="Reverse Geo-Coder Plugin" class="plugin" introduced="^4">
+    <meta rel="config">
+    <defined condition="_LOC_REVERSEGEOCODE"/>
+   </meta>
+    <unit bldFile="locationmanager/ReverseGeoCoderPlugin/group"/>
+   </component>
+   <component id="geotagger" filter="s60" name="Geo Tagger" introduced="^4">
+    <meta rel="config">
+    <defined condition="_LOC_REVERSEGEOCODE"/>
+   </meta>
+    <unit bldFile="locationmanager/geotagger/group"/>
+   </component>
+   <component id="locationtrail" filter="s60" name="Location Trail" introduced="^2">
+    <unit bldFile="locationmanager/locationtrail/group"/>
+   </component>
+   <component id="locationmanager_server" filter="s60" name="Location Manager Server" introduced="^2">
+    <unit bldFile="locationmanager/server/group"/>
+   </component>
+   <component id="locationmanager_client" filter="s60" name="Location Manager Client" introduced="^2">
+    <unit bldFile="locationmanager/client/group"/>
+   </component>
+   <component id="locationmanager_data" filter="s60" name="Location Manager Data" introduced="^2">
+    <unit bldFile="locationmanager/data"/>
+   </component>
+  </collection>
+  <collection id="contextengine" name="Context Engine" level="eng">
+   <component id="contextengine_build" filter="s60" name="Context Engine Build" introduced="^2">
+   <!-- collection is really a component. Move down a directory -->
+    <unit bldFile="contextengine/group"/>
+   </component>
+  </collection>
+  <collection id="harvester" name="Harvester" level="eng">
+   <component id="blacklistclient" filter="s60" name="Blacklist Client" introduced="^2">
+    <unit bldFile="harvester/blacklistclient/group"/>
+   </component>
+   <component id="blacklistserver" filter="s60" name="Blacklist Server" introduced="^2">
+    <unit bldFile="harvester/blacklistserver/group"/>
+   </component>
+   <component id="harvester_common" filter="s60" name="Harvester Common" introduced="^2">
+    <unit bldFile="harvester/common/group"/>
+   </component>
+   <component id="composerplugins" filter="s60" name="Composer Plugins" class="plugin" introduced="^2">
+    <unit bldFile="harvester/composerplugins/group"/>
+   </component>
+   <component id="harvesterplugins" filter="s60" name="Harvester Plugins" class="plugin" introduced="^2">
+    <unit bldFile="harvester/harvesterplugins/group"/>
+   </component>
+   <component id="monitorplugins" filter="s60" name="Monitor Plugins" class="plugin" introduced="^2">
+    <unit bldFile="harvester/monitorplugins/group"/>
+   </component>
+   <component id="harvester_server" filter="s60" name="Harvester Server" introduced="^2">
+    <unit bldFile="harvester/server/group"/>
+   </component>
+   <component id="harvester_client" filter="s60" name="Harvester Client" introduced="^2">
+    <unit bldFile="harvester/client/group"/>
+   </component>
+   <component id="harvester_data" filter="s60" name="Harvester Data" class="config" introduced="^2">
+    <!-- consider moving these exports into the other components -->
+    <unit bldFile="harvester/data"/>
+   </component>
+  </collection>
+  <collection id="watchdog" name="Watchdog" level="server">
+   <!-- collection is really a component. Move down a directory -->
+   <component id="mdswatchdog" filter="s60" name="Metadata Watchdog" introduced="^2">
+    <unit bldFile="watchdog/group"/>
+   </component>
+  </collection>
+  <collection id="clfwrapper" name="Content Listing Framework Wrapper" level="int">
+   <!-- collection is really a component. Move down a directory -->
+   <meta rel="config">
+    <defined condition="RD_MDS_2_5"/>
+   </meta>
+   <component id="clfwrapper_build" filter="s60" name="CLF Wrapper Build" introduced="^2">
+    <unit bldFile="clfwrapper/group"/>
+   </component>
+  </collection>
+  <collection id="mds_info" name="Metadata Services Info" level="int">
+   <component id="mds_rom" filter="s60" name="Metadata Services ROM" class="config" introduced="^2">
+    <!-- consider moving these exports into the other collections -->
+    <unit bldFile="rom"/>
+   </component>
+  </collection>
+ </package>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="mw"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/bld.inf	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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:  Build information file
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include "../locationmanager/inc/locplatsupport.mmh"
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+#if defined(_LOC_GEOTAGGING_CELLID)
+#ifdef _LOC_REVERSEGEOCODE
+mds_cellid_reverse_geocode_enabled.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
+#else
+mds_cellidenabled.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
+#endif
+#elif defined(_LOC_REVERSEGEOCODE)
+#ifdef _LOC_GEOTAGGING_CELLID
+mds_cellid_reverse_geocode_enabled.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
+#else
+mds_reverse_geocode_enabled_only.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
+#endif
+#else
+mds.iby    CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby)
+#endif
+
+#ifdef RD_MDS_2_5
+ContentListingFramework.iby	CORE_MW_LAYER_IBY_EXPORT_PATH( ContentListingFramework.iby )
+#endif
+
+//Stubs
+../sis/mds/mds_stub.sis  /epoc32/data/z/system/install/mds_stub.sis
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
+mds_testers.iby	CORE_MW_LAYER_IBY_EXPORT_PATH(mds_testers.iby)
+
--- a/rom/mds_cellid_reverse_geocode_enabled.iby	Tue Jul 06 14:44:37 2010 +0300
+++ b/rom/mds_cellid_reverse_geocode_enabled.iby	Wed Aug 18 10:12:07 2010 +0300
@@ -121,4 +121,16 @@
 data=ZSYSTEM\install\mds_stub.sis	system\install\mds_stub.sis
 data=ZSYSTEM\install\mdswatchdog_stub.sis	system\install\mdswatchdog_stub.sis
 
+data=ZSYSTEM\install\locationmanagerclient_stub.sis       system\install\locationmanagerclient_stub.sis
+data=ZSYSTEM\install\locationtrail_stub.sis       system\install\locationtrail_stub.sis
+data=ZSYSTEM\install\locationmanagerserver_stub.sis       system\install\locationmanagerserver_stub.sis
+
+data=ZSYSTEM\install\ReverseGeocode_stub.sis       system\install\ReverseGeocode_stub.sis
+data=ZSYSTEM\install\ReverseGeoCoderPlugin_stub.sis       system\install\ReverseGeoCoderPlugin_stub.sis
+data=ZSYSTEM\install\tagcreator_stub.sis       system\install\tagcreator_stub.sis
+data=ZSYSTEM\install\geotagger_stub.sis       system\install\geotagger_stub.sis
+data=ZSYSTEM\install\geoconverter_stub.sis       system\install\geoconverter_stub.sis
+
+
+
 #endif //__METADATA_IBY__
--- a/rom/mds_cellidenabled.iby	Tue Jul 06 14:44:37 2010 +0300
+++ b/rom/mds_cellidenabled.iby	Wed Aug 18 10:12:07 2010 +0300
@@ -85,6 +85,9 @@
 REM geoconverter
 file=ABI_DIR\BUILD_DIR\geoconverter.dll		    SHARED_LIB_DIR\geoconverter.dll
 
+REM geotagger
+file=ABI_DIR\BUILD_DIR\geotagger.dll		    SHARED_LIB_DIR\geotagger.dll
+
 
 REM Location Manager data files
 data=ZPRIVATE\10202BE9\200071BE.txt					"PRIVATE\10202BE9\200071BE.txt"
@@ -110,4 +113,9 @@
 data=ZSYSTEM\install\mds_stub.sis	system\install\mds_stub.sis
 data=ZSYSTEM\install\mdswatchdog_stub.sis	system\install\mdswatchdog_stub.sis
 
+data=ZSYSTEM\install\locationmanagerclient_stub.sis       system\install\locationmanagerclient_stub.sis
+data=ZSYSTEM\install\locationtrail_stub.sis       system\install\locationtrail_stub.sis
+data=ZSYSTEM\install\locationmanagerserver_stub.sis       system\install\locationmanagerserver_stub.sis
+data=ZSYSTEM\install\geotagger_stub.sis       system\install\geotagger_stub.sis
+data=ZSYSTEM\install\geoconverter_stub.sis       system\install\geoconverter_stub.sis
 #endif //__METADATA_IBY__
--- a/rom/mds_reverse_geocode_enabled_only.iby	Tue Jul 06 14:44:37 2010 +0300
+++ b/rom/mds_reverse_geocode_enabled_only.iby	Wed Aug 18 10:12:07 2010 +0300
@@ -118,4 +118,11 @@
 data=ZSYSTEM\install\mds_stub.sis	system\install\mds_stub.sis
 data=ZSYSTEM\install\mdswatchdog_stub.sis	system\install\mdswatchdog_stub.sis
 
+data=ZSYSTEM\install\locationmanagerclient_stub.sis       system\install\locationmanagerclient_stub.sis
+data=ZSYSTEM\install\locationtrail_stub.sis       system\install\locationtrail_stub.sis
+data=ZSYSTEM\install\locationmanagerserver_stub.sis       system\install\locationmanagerserver_stub.sis
+data=ZSYSTEM\install\ReverseGeocode_stub.sis       system\install\ReverseGeocode_stub.sis
+data=ZSYSTEM\install\ReverseGeoCoderPlugin_stub.sis       system\install\ReverseGeoCoderPlugin_stub.sis
+data=ZSYSTEM\install\tagcreator_stub.sis       system\install\tagcreator_stub.sis
+data=ZSYSTEM\install\geotagger_stub.sis       system\install\geotagger_stub.sis
 #endif //__METADATA_IBY__
Binary file sis/mds/mds_stub.sis has changed
--- a/sis/mds/package.pkg	Tue Jul 06 14:44:37 2010 +0300
+++ b/sis/mds/package.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 10, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/package_cellid_reverse_geocode_enabled.pkg	Tue Jul 06 14:44:37 2010 +0300
+++ b/sis/mds/package_cellid_reverse_geocode_enabled.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 9, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/package_cellidenabled.pkg	Tue Jul 06 14:44:37 2010 +0300
+++ b/sis/mds/package_cellidenabled.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 9, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
@@ -94,6 +94,7 @@
 "\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll"
 "\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe"
 "\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll"
 
 ; metadata engine
 "\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/mds/package_reverse_geocode_enabled_only.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -0,0 +1,116 @@
+;
+; 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:
+;
+;Languages
+&EN
+
+;packet-header (name, uid, major, minor, build, type)
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
+
+; Localised vendor name
+%{"Nokia"}
+
+; Unique vendor name
+:"Nokia"
+
+;Files
+"\epoc32\release\armv5\udeb\mdsiadstop.exe"-"c:\sys\bin\mdsiadstop.exe",FILERUN,RB,RW
+
+; CenRep
+"..\..\clfwrapper\conf\102828AC.txt"-"c:\private\10202be9\102828AC.txt"
+"..\..\harvester\common\data\200009FE.txt"-"c:\private\10202be9\200009FE.txt"
+"..\..\locationmanager\data\200071BE.txt"-"c:\private\10202be9\200071BE.txt"
+
+; contextengine
+"\EPOC32\RELEASE\ARMV5\UREL\contextengine.dll" -"c:\sys\bin\contextengine.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\contextplugininterface.dll" -"c:\sys\bin\contextplugininterface.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\calendarcontextplugin.dll" -"c:\sys\bin\calendarcontextplugin.dll"
+"\epoc32\data\z\resource\plugins\calendarcontextplugin.rsc" -"c:\resource\plugins\calendarcontextplugin.rsc"
+"\EPOC32\RELEASE\ARMV5\UREL\locationcontextplugin.dll" -"c:\sys\bin\locationcontextplugin.dll"
+"\epoc32\data\z\resource\plugins\locationcontextplugin.rsc" -"c:\resource\plugins\locationcontextplugin.rsc"
+
+; clf wrapper
+"\EPOC32\RELEASE\ARMV5\UREL\MediaCollectionManager.dll" -"c:\sys\bin\MediaCollectionManager.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\ContentListingFramework.dll" -"c:\sys\bin\ContentListingFramework.dll"
+
+; blacklist 
+"\EPOC32\RELEASE\ARMV5\UREL\!blacklistserver.exe" -"c:\sys\bin\!blacklistserver.exe"
+"\EPOC32\RELEASE\ARMV5\UREL\blacklistclient.dll" -"c:\sys\bin\blacklistclient.dll"
+
+; composer plugins
+"\epoc32\RELEASE\armv5\UREL\composerplugininterface.dll"-"c:\sys\bin\composerplugininterface.dll"
+"\epoc32\RELEASE\armv5\UREL\composerimageplugin.dll"-"c:\sys\bin\composerimageplugin.dll"
+"\epoc32\data\z\resource\plugins\composerimageplugin.rsc"-"c:\resource\plugins\composerimageplugin.rsc"
+
+; harvester
+"\epoc32\RELEASE\armv5\UREL\harvesterclient.dll" -"c:\sys\bin\harvesterclient.dll"
+"\epoc32\RELEASE\armv5\UREL\harvestercommon.dll" -"c:\sys\bin\harvestercommon.dll"
+"\epoc32\RELEASE\armv5\UREL\harvesterdata.dll" -"c:\sys\bin\harvesterdata.dll"
+"\epoc32\RELEASE\armv5\UREL\harvesterplugininterface.dll" -"c:\sys\bin\harvesterplugininterface.dll"
+"\epoc32\RELEASE\armv5\UREL\harvesterserver.exe" -"c:\sys\bin\harvesterserver.exe"
+
+; harvester plugins
+"\epoc32\RELEASE\armv5\UREL\harvesteraudioplugin.dll"-"c:\sys\bin\harvesteraudioplugin.dll"
+"\epoc32\data\z\resource\plugins\harvesteraudioplugin.rsc"-"c:\resource\plugins\harvesteraudioplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\harvesterimageplugin.dll"-"c:\sys\bin\harvesterimageplugin.dll"
+"\epoc32\data\z\resource\plugins\harvesterimageplugin.rsc"-"c:\resource\plugins\harvesterimageplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\harvestermessageplugin.dll"-"c:\sys\bin\harvestermessageplugin.dll"
+"\epoc32\data\z\resource\plugins\harvestermessageplugin.rsc"-"c:\resource\plugins\harvestermessageplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\harvesteromadrmplugin.dll"-"c:\sys\bin\harvesteromadrmplugin.dll"
+"\epoc32\data\z\resource\plugins\harvesteromadrmplugin.rsc"-"c:\resource\plugins\harvesteromadrmplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\harvesterrtpplugin.dll"-"c:\sys\bin\harvesterrtpplugin.dll"
+"\epoc32\data\z\resource\plugins\harvesterrtpplugin.rsc"-"c:\resource\plugins\harvesterrtpplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\harvestervideoplugin.dll"-"c:\sys\bin\harvestervideoplugin.dll"
+"\epoc32\data\z\resource\plugins\harvestervideoplugin.rsc"-"c:\resource\plugins\harvestervideoplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\harvesterwmvplugin.dll"-"c:\sys\bin\harvesterwmvplugin.dll"
+"\epoc32\data\z\resource\plugins\harvesterwmvplugin.rsc"-"c:\resource\plugins\harvesterwmvplugin.rsc"
+
+; monitor plugins
+"\epoc32\RELEASE\armv5\UREL\monitorplugininterface.dll"-"c:\sys\bin\monitorplugininterface.dll"
+"\epoc32\RELEASE\armv5\UREL\mdsfileserverplugin.pxt"-"c:\sys\bin\mdsfileserverplugin.pxt"
+"\epoc32\RELEASE\armv5\UREL\filemonitorplugin.dll"-"c:\sys\bin\filemonitorplugin.dll"
+"\epoc32\data\z\resource\plugins\filemonitorplugin.rsc"-"c:\resource\plugins\filemonitorplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\MessageMonitorPlugin.dll"-"c:\sys\bin\MessageMonitorPlugin.dll"
+"\epoc32\data\z\resource\plugins\MessageMonitorPlugin.rsc"-"c:\resource\plugins\MessageMonitorPlugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\mmcmonitorplugin.dll"-"c:\sys\bin\mmcmonitorplugin.dll"
+"\epoc32\data\z\resource\plugins\mmcmonitorplugin.rsc"-"c:\resource\plugins\mmcmonitorplugin.rsc"
+"\epoc32\RELEASE\armv5\UREL\mdsoomplugin.dll"-"c:\sys\bin\mdsoomplugin.dll"
+"\epoc32\data\z\resource\plugins\mdsoomplugin.rsc"-"c:\resource\plugins\mdsoomplugin.rsc"
+
+; location manager
+"\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe"
+"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll"
+"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll"
+"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc"
+
+; metadata engine
+"\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\mdccommon.dll" -"c:\sys\bin\mdccommon.dll"
+"\EPOC32\RELEASE\ARMV5\UREL\!mdsserver.exe" -"c:\sys\bin\!mdsserver.exe"
+
+"\epoc32\release\armv5\udeb\mdswatchdog.exe"-"c:\sys\bin\mdswatchdog.exe"
+
+"\epoc32\data\z\Private\200009F3\schema.mde"-"c:\PRIVATE\200009F3\schema.mde"
+"\epoc32\data\z\Private\200009F3\defaultimportfile.mde"-"c:\PRIVATE\200009F3\defaultimportfile.mde"
+"\epoc32\data\z\Private\200009F3\backup_registration.xml"-"c:\PRIVATE\200009F3\backup_registration.xml"
+"\epoc32\data\z\Private\200009F5\backup_registration.xml"-"c:\PRIVATE\200009F5\backup_registration.xml"
+"\epoc32\data\z\Private\200009F5\mappings.db"-"c:\PRIVATE\200009F5\mappings.db"
+
+"\epoc32\release\armv5\udeb\mdsiadrestart.exe"-"c:\sys\bin\mdsiadrestart.exe",FILERUN,RB,RW
+
--- a/sis/mds/package_separate.pkg	Tue Jul 06 14:44:37 2010 +0300
+++ b/sis/mds/package_separate.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 10, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/stub.pkg	Tue Jul 06 14:44:37 2010 +0300
+++ b/sis/mds/stub.pkg	Wed Aug 18 10:12:07 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"Metadata System"}, (0x200009F5), 10, 10, 10, TYPE=SA
+#{"Metadata System"}, (0x200009F5), 10, 10, 13, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
--- a/watchdog/src/watchdog.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/watchdog/src/watchdog.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -161,8 +161,10 @@
 //
 CWatchdog::~CWatchdog()
     {
-    delete iShutdownObserver;    
+    delete iShutdownObserver;
+    iShutdownObserver = NULL;
     delete iSelfShutdownObserver;
+    iSelfShutdownObserver = NULL;
     Cancel();
     }
 
@@ -304,5 +306,6 @@
         }
   
     delete cleanupStack;
+    cleanupStack = NULL;
     return err;
     }