201031
authorhgs
Fri, 06 Aug 2010 09:56:02 +0300
changeset 43 c5e73110f733
parent 40 910a23996aa0
child 48 1389872e7c51
201031
group/bld.inf
harvester/blacklistserver/src/blacklistsession.cpp
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/harvesternotificationqueue.cpp
harvester/client/src/harvesterrequestactive.cpp
harvester/client/traces/fixed_id.definitions
harvester/client/traces/harvesterclientaoTraces.h
harvester/common/bwincw/harvestercommonwinscw.def
harvester/common/eabi/harvestercommonarm.def
harvester/common/inc/harvestercommon.h
harvester/common/inc/harvesterpluginfactory.h
harvester/common/src/harvestercenreputil.cpp
harvester/common/src/harvesterdata.cpp
harvester/common/src/harvesterplugin.cpp
harvester/common/src/harvesterpluginfactory.cpp
harvester/composerplugins/imagecomposer/inc/imagecomposerao.h
harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp
harvester/data/bld.inf
harvester/group/bld.inf
harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h
harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp
harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h
harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp
harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h
harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp
harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h
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/fileeventhandlerao.cpp
harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp
harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp
harvester/server/inc/harvesterao.h
harvester/server/src/harvesterao.cpp
harvester/server/src/harvesterserver.cpp
harvester/server/src/reharvesterao.cpp
harvester/server/traces/fixed_id.definitions
harvester/server/traces/harvesteraoTraces.h
inc/mdscommoninternal.h
inc/mdssqliteconnection.h
locationmanager/ReverseGeoCoderPlugin/group/bld.inf
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/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/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/sis/depends.xml
locationmanager/locationtrail/sis/locationtrail_stub.sis
locationmanager/locationtrail/sis/package.pkg
locationmanager/locationtrail/sis/stub.pkg
locationmanager/locationtrail/src/clocationrecord.cpp
locationmanager/locationtrail/src/ctracklog.cpp
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/group/tagcreator.mmp
locationmanager/tagcreator/sis/depends.xml
locationmanager/tagcreator/sis/package.pkg
locationmanager/tagcreator/sis/stub.pkg
locationmanager/tagcreator/sis/tagcreator_stub.sis
mds_plat/harvester_framework_api/inc/harvesterclient.h
mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp
metadataengine/server/group/mdsserver.mmp
metadataengine/server/inc/mdspreferences.h
metadataengine/server/src/mdsmaintenanceengine.cpp
metadataengine/server/src/mdsmanipulationengine.cpp
metadataengine/server/src/mdssqliteconnection.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
--- a/group/bld.inf	Fri Jul 23 10:03:59 2010 +0300
+++ b/group/bld.inf	Fri Aug 06 09:56:02 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/blacklistserver/src/blacklistsession.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/blacklistserver/src/blacklistsession.cpp	Fri Aug 06 09:56:02 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/client/eabi/harvesterclientarm.def	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/eabi/harvesterclientarm.def	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/group/harvesterclient.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/inc/harvesterclientao.h	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/inc/harvesterrequestactive.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/src/harvesterclient.cpp	Fri Aug 06 09:56:02 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 )
         {
@@ -391,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 )
         {
@@ -476,7 +467,6 @@
 	TIpcArgs ipcArgs( &aURI );
 	OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE, "RHarvesterClient::RegisterHarvestComplete" );
 	
-	
 	if( !iHandle )
 		{
 		return;
@@ -496,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 );
     }
 
@@ -516,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/src/harvesterclientao.cpp	Fri Aug 06 09:56:02 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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/client/src/harvesternotificationqueue.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/src/harvesterrequestactive.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -19,6 +19,7 @@
 
 #include "harvesterrequestactive.h"
 #include "harvesterrequestqueue.h"
+#include "harvesterlog.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -32,10 +33,6 @@
     if( IsActive() )
         {
         Cancel();
-        if( iObserver )
-            {
-            iObserver->HarvestingComplete( iUri, KErrCancel );
-            }    
         iRequestCompleted = ETrue;
         }
     
@@ -49,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;
     }
@@ -64,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 )
     {
@@ -80,10 +77,6 @@
 //
 void CHarvesterRequestActive::RunL()
     {
-    if( iStatus.Int() && iObserver )
-        {
-        iObserver->HarvestingComplete( iUri, iStatus.Int() );
-        }       
     iRequestCompleted = ETrue;
     if( iRequestQueue )
         {
@@ -102,10 +95,6 @@
         return KErrNone;
         }
     
-    if( iObserver )
-        {
-        iObserver->HarvestingComplete( iUri, aError );
-        }    
     iRequestCompleted = ETrue;
     return KErrNone;
     }
@@ -133,7 +122,7 @@
     
     if( !iCancelled )
         {
-        iClient.HarvestFile( iService, iPersistentArgs, iStatus );
+        iClient.HarvestFile( iService, iPersistentArgs, iStatus, iUri );
         SetActive();
         }
     }
@@ -144,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/traces/fixed_id.definitions	Fri Aug 06 09:56:02 2010 +0300
@@ -4,7 +4,6 @@
 [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_REMOVEOBSERVER=0x12
 [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_RUNL=0x14
 [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_SETOBSERVER=0x11
 [TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xf
@@ -20,3 +19,4 @@
 [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/harvesterclientaoTraces.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/client/traces/harvesterclientaoTraces.h	Fri Aug 06 09:56:02 2010 +0300
@@ -11,7 +11,6 @@
 #define DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x3000f
 #define CHARVESTERCLIENTAO_CONSTRUCTL 0x30010
 #define CHARVESTERCLIENTAO_SETOBSERVER 0x30011
-#define CHARVESTERCLIENTAO_REMOVEOBSERVER 0x30012
 #define CHARVESTERCLIENTAO_DOCANCEL 0x30013
 #define CHARVESTERCLIENTAO_RUNL 0x30014
 
--- a/harvester/common/bwincw/harvestercommonwinscw.def	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/bwincw/harvestercommonwinscw.def	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/eabi/harvestercommonarm.def	Fri Aug 06 09:56:02 2010 +0300
@@ -86,4 +86,5 @@
 	_ZN18CHarvesterExifUtilD1Ev @ 85 NONAME
 	_ZN18CHarvesterExifUtilD2Ev @ 86 NONAME
 	_ZN23CHarvesterPluginFactory14PauseHarvesterEi @ 87 NONAME
+	_ZN23CHarvesterPluginFactory13GetObjectDefLEP14CHarvesterDataR6TDes16 @ 88 NONAME
 
--- a/harvester/common/inc/harvestercommon.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/inc/harvestercommon.h	Fri Aug 06 09:56:02 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/harvesterpluginfactory.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/inc/harvesterpluginfactory.h	Fri Aug 06 09:56:02 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/src/harvestercenreputil.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/src/harvestercenreputil.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -198,7 +198,9 @@
 	        continue;
 	        }
 		HBufC* pathBuf = path.AllocL();
+		CleanupStack::PushL( pathBuf );
 		aPaths.AppendL( pathBuf );
+		CleanupStack::Pop( pathBuf );
 		}
 
 	CleanupStack::PopAndDestroy( &scanPathKeys );
--- a/harvester/common/src/harvesterdata.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/src/harvesterdata.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -29,7 +29,11 @@
 CHarvesterData::CHarvesterData( const HBufC* aUri )
 	{
 	iUri = aUri;
+	iClientData = NULL;
+	iMdeObject = NULL;
+	iLocationData = NULL;
 	iIsBinary = ETrue;
+	iClientId = KNullUid;
 	}
 
 //==========================================================================
@@ -229,6 +233,11 @@
 //
 EXPORT_C void CHarvesterData::SetMdeObject( CMdEObject* aMdeObject )
 	{
+    if( iMdeObject )
+        {
+        delete iMdeObject;
+        iMdeObject = NULL;
+        }
 	iMdeObject = aMdeObject;
 	}
 
--- a/harvester/common/src/harvesterplugin.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/src/harvesterplugin.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/common/src/harvesterpluginfactory.cpp	Fri Aug 06 09:56:02 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();
 	}
 	
 // ---------------------------------------------------------------------------
@@ -329,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 );
@@ -492,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/composerplugins/imagecomposer/inc/imagecomposerao.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/inc/imagecomposerao.h	Fri Aug 06 09:56:02 2010 +0300
@@ -267,6 +267,8 @@
         CHarvesterExifUtil* iExifUtil;
         
         RFs iFs;
+        
+        TBool iFastModeEnabled;
     };
 
 #endif // __CIMAGECOMPOSERAO_H__
--- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -114,6 +114,7 @@
     CActiveScheduler::Add( this );
     
     iExifUtil = CHarvesterExifUtil::NewL();
+    iFastModeEnabled = EFalse;
     User::LeaveIfError( iFs.Connect() );
     }
     
@@ -245,6 +246,10 @@
             if( iItemQueue.Count() <= 0 )
             	{
                 iItemQueue.Compress();
+                if( iFastModeEnabled )
+                    {
+                    SetPriority( KHarvesterPriorityComposerPlugin );
+                    }
             	SetNextRequest( ERequestReady );
             	}
             else
@@ -254,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
@@ -750,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 );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harvester/data/bld.inf	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/group/bld.inf	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -37,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;
 
@@ -150,6 +153,8 @@
         {
         TRAP_IGNORE( iTNM = CThumbnailManager::NewL( *this ) );
         }
+		
+    iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL();
     
     SetPriority( KHarvesterPriorityHarvestingPlugin - 2 );
 	
@@ -294,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 );
@@ -329,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 );
@@ -361,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 )
@@ -561,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/ImagePlugin/inc/harvesterimageplugin.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp	Fri Aug 06 09:56:02 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
@@ -216,6 +219,8 @@
 	iExifUtil = CHarvesterExifUtil::NewL();
     User::LeaveIfError( iFbs.Connect() );
 
+    iPropDefs = CHarvesterImagePluginPropertyDefs::NewL(); 
+
     TLinearOrder< TMimeTypeMapping<TImageMetadataHandling> > cmp(
     		TMimeTypeMapping<TImageMetadataHandling>::CompareFunction);
 
@@ -401,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 )
@@ -697,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();
 
@@ -1089,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/OMADRMPlugin/inc/harvesteromadrmplugin.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h	Fri Aug 06 09:56:02 2010 +0300
@@ -100,7 +100,8 @@
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterOmaDrmPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+        static CHarvesterOmaDrmPluginPropertyDefs* NewL();
+        void SetByObjectDefL( CMdEObjectDef& aObjectDef) ;
 	};
 
 class CHarvesterOMADRMPlugin : public CHarvesterPlugin
@@ -173,6 +174,8 @@
 		*/
 		void ConstructL();
 		
+	    void InitPropDefsL( CMdEObjectDef& aObjectDef );
+	      
   protected:
         /** 
          * Handle to File server session.
--- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -48,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();
 	
@@ -81,16 +94,6 @@
 	iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
 	}
 
-CHarvesterOmaDrmPluginPropertyDefs* CHarvesterOmaDrmPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef)
-	{
-	CHarvesterOmaDrmPluginPropertyDefs* self = 
-		new (ELeave) CHarvesterOmaDrmPluginPropertyDefs();
-	CleanupStack::PushL( self );
-	self->ConstructL( aObjectDef );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
 /**
 * Default constructor
 */
@@ -140,9 +143,6 @@
     iPhoneSoundsPath = NULL;
     delete iMmcSoundsPath;
     iMmcSoundsPath = NULL;
-	
-	delete iPropDefs;
-	iPropDefs = NULL;
 	}
 
 /**
@@ -155,6 +155,8 @@
     
     User::LeaveIfError( iFs.Connect() );
 	
+    iPropDefs = CHarvesterOmaDrmPluginPropertyDefs::NewL();
+    
 	TFileName phoneRoot = PathInfo::PhoneMemoryRootPath();
 	TFileName mmcRoot = PathInfo::MemoryCardRootPath();
 	
@@ -194,6 +196,7 @@
 	WRITELOG( "CHarvesterImagePlugin::HarvestL()" );
     CMdEObject& mdeObject = aHarvesterData->MdeObject();
 	CDRMHarvestData* drmHarvestData = CDRMHarvestData::NewL();
+	CleanupStack::PushL( drmHarvestData );
 	
     CFileData* fileData = CFileData::NewL();
     CleanupStack::PushL( fileData );
@@ -230,7 +233,7 @@
         aHarvesterData->SetErrorCode( convertedError );
         }
 
-    CleanupStack::PopAndDestroy( 2, fileData );
+    CleanupStack::PopAndDestroy( 3, drmHarvestData );
 	}
 
 // ---------------------------------------------------------------------------
@@ -238,7 +241,7 @@
 // ---------------------------------------------------------------------------
 //
 TInt CHarvesterOMADRMPlugin::GatherDataL( CMdEObject& aMetadataObject, CDRMHarvestData& aDRMharvestData, 
-        CFileData& aFileData, CHarvestData& aHarvestData )
+        CFileData& aFileData, CHarvestData& /*aHarvestData*/ )
     {
     WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL" );
     
@@ -359,19 +362,13 @@
 // HandleObjectPropertiesL
 // ---------------------------------------------------------------------------
 //
-void CHarvesterOMADRMPlugin::HandleObjectPropertiesL( CHarvestData& aHarvestData, CDRMHarvestData& aDRMharvestData, CFileData& aFileData, 
+void CHarvesterOMADRMPlugin::HandleObjectPropertiesL( CHarvestData& /*aHarvestData*/, CDRMHarvestData& aDRMharvestData, CFileData& aFileData, 
         CHarvesterData& aHarvesterData, TBool aIsAdd )
     {
     WRITELOG("CHarvesterOMADRMPlugin - HandleNewObject ");
     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();
     
@@ -647,3 +644,13 @@
         }
     }
 
+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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h	Fri Aug 06 09:56:02 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/harvesterrtpplugin.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h	Fri Aug 06 09:56:02 2010 +0300
@@ -162,7 +162,8 @@
 		void ConstructL(CMdEObjectDef& aObjectDef);
 
 	public:	
-		static CHarvesterVideoPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
+		static CHarvesterVideoPluginPropertyDefs* NewL();
+		void SetByObjectDefL( CMdEObjectDef& aObjectDef );
 	};
 
 class CHarvesterVideoPlugin : public CHarvesterPlugin
@@ -239,6 +240,8 @@
 		
 		void CheckForCodecSupport( HBufC* aMimeBuffer, CVideoHarvestData& aVHD );
 		
+        void InitPropDefsL( CMdEObjectDef& aObjectDef );
+
 	private:
 		RArray<THarvestingHandling> iMimeTypeMappings;
 		
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Fri Aug 06 09:56:02 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
@@ -184,6 +187,8 @@
 	{
 	WRITELOG( "CHarvesterVideoPlugin::ConstructL() - begin" );
 	
+	iPropDefs = CHarvesterVideoPluginPropertyDefs::NewL();
+	
 	TLinearOrder< THarvestingHandling > cmp( THarvestingHandling::CompareFunction );
 
 	// MPEG4
@@ -551,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
 
@@ -577,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 )
     	{
@@ -610,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 )
         	{
@@ -792,6 +810,7 @@
         	aVHD.iMimeBuf = mime.Alloc();
         	}
         
+        helixMetadata->ResetL();
         CleanupStack::PopAndDestroy( helixMetadata );
         
         // don't destory mime type pointers just clean array
@@ -985,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;
@@ -1220,9 +1233,6 @@
 	{
 	TBool possibleVideo = EFalse;
 
-	CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL();
-	CleanupStack::PushL( helixMetadata );
-
     TFileName tempName;
     TUint32 mediaId( 0 );
     TInt blackListError( KErrNone );
@@ -1230,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 )
@@ -1316,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 )
@@ -1334,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;
@@ -1432,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp	Fri Aug 06 09:56:02 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 ========
 
 // ---------------------------------------------------------------------------
@@ -174,6 +177,8 @@
     {
     WRITELOG( "CHarvesterWMVPlugin::ConstructL()" );
     
+    iPropDefs = CHarvesterWmvPluginPropertyDefs::NewL();
+    
     TFileName videos = PathInfo::VideosPath();
     
     TFileName phonePath = PathInfo::PhoneMemoryRootPath();
@@ -298,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() )
     	{
@@ -370,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/group/filemonitorplugin.mmp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/inc/fileeventhandlerao.h	Fri Aug 06 09:56:02 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/fileeventhandlerao.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -16,6 +16,7 @@
 
 #include <collate.h>
 #include <mdeobject.h>
+#include <pathinfo.h>
 
 #include "fileeventhandlerao.h"
 #include "harvesterlog.h"
@@ -90,6 +91,39 @@
     	}
     
     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();
     }
 
 // ---------------------------------------------------------------------------
@@ -121,6 +155,21 @@
 	
     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;
     }
 
 
@@ -449,6 +498,7 @@
         		newObject->Id() );
         if ( removedId != KNoId )
         	{
+            SetTitleL( oldObject , aNewUrl );
 	        oldObject->SetUriL( aNewUrl );
 	        TUint32 mediaId = FSUtil::MediaID( iFs, aNewUrl );
 	        oldObject->SetMediaId( mediaId );
@@ -462,6 +512,7 @@
 
     if ( oldObject )
         {
+        CheckDefaultFolderL( oldObject );
         SetModifiedTimeL( oldObject, aNewUrl );
         TOrigin origin = OriginFromMdEObjectL( *oldObject );
         if( origin == MdeConstants::Object::EOther)
@@ -639,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)
         	        	{
@@ -661,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 );
@@ -981,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/mmcplugin/src/mmcfilelist.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -254,6 +254,49 @@
             {
             WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EMounted" );
             mountData->iMountType = TMountData::EMount;
+            
+            // 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 )
--- a/harvester/server/inc/harvesterao.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/server/inc/harvesterao.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/server/src/harvesterao.cpp	Fri Aug 06 09:56:02 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
 // ---------------------------------------------------------------------------
@@ -314,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 );
@@ -375,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++ )
@@ -431,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++ )
@@ -450,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();
         }
@@ -468,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" );
     }
@@ -539,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 );
@@ -576,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 );
@@ -612,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 );
@@ -643,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 );
@@ -702,6 +706,7 @@
 
 					TRAP_IGNORE( iMdESession->CancelObjectL( mdeobj ) );
 					
+					HarvestCompleted( hd->ClientId(), hd->Uri(), KErrCancel );
 					delete hd;
 					hd = NULL;
 					}
@@ -848,6 +853,8 @@
     		{
         	if(iPHArray.Append( hd ) != KErrNone)
         	    {
+        	    HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory );
+        	    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
                 delete hd;
                 hd = NULL;
         	    }
@@ -877,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 );
                 }
             
@@ -907,18 +917,19 @@
 	    		{
 	        	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;
+                    }
 	    		}
     		}
 			
@@ -926,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 );
 	    		}
     		}
@@ -943,7 +957,7 @@
             }
         iHarvestingPlaceholders = EFalse;
         CheckFileExtensionAndHarvestL( hd );
-        if( iUnmountDetected )
+        if( iUnmountDetected && hd )
             {
             iQueue->Append( hd );
             }
@@ -964,6 +978,8 @@
 
 	TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset();
 	
+	CMdENamespaceDef& defNS = iMdESession->GetDefaultNamespaceDefL();
+	
 	TInt endindex( iPHArray.Count() );
 	for( TInt i = 0; i < endindex; i++ )
 		{
@@ -973,6 +989,8 @@
 			{
 			if( iContainerPHArray.Append( hd ) != KErrNone )
 			    {
+			    HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory );
+			    iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
                 delete hd;
                 hd = NULL;
 			    }
@@ -987,7 +1005,7 @@
 		
 		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 
@@ -998,12 +1016,14 @@
 		    WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - Unmount detected during execution!" );
 		    for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- )
 		        {
-		        CHarvesterData* hd = iTempReadyPHArray[y];
+		        CHarvesterData* tempHd = iTempReadyPHArray[y];
 				
-		        if(iPHArray.Insert( hd, 0 ) != KErrNone)
+		        if(iPHArray.Insert( tempHd, 0 ) != KErrNone)
 		            {
-                    delete hd;
-                    hd = NULL;
+		            HarvestCompleted( tempHd->ClientId(), tempHd->Uri(), KErrNoMemory );
+		            iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 );
+                    delete tempHd;
+                    tempHd = NULL;
 		            }
 		        }
 		    iTempReadyPHArray.Reset();
@@ -1019,29 +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
-                    if(iPHArray.Insert( hd, 1 ) != KErrNone)
-                        {
-                        delete hd;
-                        hd = NULL;
-                        }
-                    }
-                else
-                    {
-                    if(iPHArray.Insert( hd, 0 ) != KErrNone)
-                        {
-                        delete hd;
-                        hd = NULL;
-                        }
+                    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 ) )
@@ -1059,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;
@@ -1131,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() );
@@ -1225,6 +1259,7 @@
 		
 	    if(iTempReadyPHArray.Append( hd ) != KErrNone)
 	        {
+	        HarvestCompleted( hd->ClientId(), hd->Uri(), KErrNoMemory );
             delete hd;
             hd = NULL;
 	        }
@@ -1233,27 +1268,57 @@
         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, 
@@ -1289,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;
             }
@@ -1404,6 +1469,12 @@
     	{
     	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 ));
@@ -1437,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 );
     }
 
 // ---------------------------------------------------------------------------
@@ -1568,8 +1637,6 @@
         OstTrace0( TRACE_NORMAL, DUP12_CHARVESTERAO_HARVESTINGCOMPLETED, "==============================ERROR done =========================" );
         
         }
-           
-    SetNextRequest( ERequestHarvest );
     }
 
 // ---------------------------------------------------------------------------
@@ -1716,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 );
+                    }          
                 }
             }
         }
@@ -1874,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()" );
@@ -1887,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;
@@ -1920,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;
             		    }
@@ -1969,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;
@@ -2036,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 )
@@ -2045,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;
         
@@ -2161,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 )
             {
@@ -2376,6 +2497,7 @@
     else
         {
         delete hd;
+        hd = NULL;
         err = KErrUnknown;
         }
     
@@ -2383,6 +2505,10 @@
         {
         aMessage.Complete( err );
         }
+    else if( err != KErrNone )
+        {
+        HarvestCompleted( aMessage.Identity(), uri->Des(), err );
+        }
     
     albumIds.Close();
     }
@@ -2573,6 +2699,7 @@
     else
         {
         delete hd;
+        hd = NULL;
         err = KErrUnknown;
         }
 
@@ -2580,6 +2707,10 @@
         {
         aMessage.Complete( err );
         }
+    else if( err != KErrNone )
+        {
+        HarvestCompleted( aMessage.Identity(), uri->Des(), err );
+        }
     
     albumIds.Close();
     }
@@ -2997,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 );
@@ -3191,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/harvesterserver.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/server/src/harvesterserver.cpp	Fri Aug 06 09:56:02 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();
--- a/harvester/server/src/reharvesterao.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/server/src/reharvesterao.cpp	Fri Aug 06 09:56:02 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
 
 // ---------------------------------------------------------------------------
--- a/harvester/server/traces/fixed_id.definitions	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/server/traces/fixed_id.definitions	Fri Aug 06 09:56:02 2010 +0300
@@ -168,6 +168,7 @@
 [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
--- a/harvester/server/traces/harvesteraoTraces.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/server/traces/harvesteraoTraces.h	Fri Aug 06 09:56:02 2010 +0300
@@ -164,6 +164,7 @@
 #define DUP5_CHARVESTERAO_BOOTSCANL 0x3009c
 #define CHARVESTERAO_MEMORYLOW 0x3009d
 #define CHARVESTERAO_MEMORYGOOD 0x3009e
+#define DUP5_CHARVESTERAO_RUNERROR 0x300c4
 
 
 #endif
--- a/inc/mdscommoninternal.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/inc/mdscommoninternal.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/inc/mdssqliteconnection.h	Fri Aug 06 09:56:02 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/group/bld.inf	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/ReverseGeoCoderPlugin/group/bld.inf	Fri Aug 06 09:56:02 2010 +0300
@@ -19,7 +19,7 @@
 
 
 PRJ_EXPORTS
-
+       
 
 PRJ_MMPFILES
 reversegeocoderplugin.mmp
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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/ReverseGeocode/group/bld.inf	Fri Aug 06 09:56:02 2010 +0300
@@ -19,6 +19,8 @@
 DEFAULT
 
 PRJ_EXPORTS
+     
 
 PRJ_MMPFILES
 reversegeocode.mmp
+
--- a/locationmanager/ReverseGeocode/inc/internalreversegeocode.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/ReverseGeocode/inc/internalreversegeocode.h	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/ReverseGeocode/src/internalreversegeocode.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -425,7 +425,6 @@
     return retVal;
     }
 
-
 // ----------------------------------------------------------------------------
 // CInternalReverseGeocode::GetCurrentRegisterNw()
 // ---------------------------------------------------------------------------- 
--- a/locationmanager/ReverseGeocode/src/xmlhandler.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/ReverseGeocode/src/xmlhandler.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/client/group/locationmanagerclient.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/client/src/rlocationmanager.cpp	Fri Aug 06 09:56:02 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;       
     }
 
 // --------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/data/bld.inf	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/geoconverter/group/bld.inf	Fri Aug 06 09:56:02 2010 +0300
@@ -26,3 +26,4 @@
 
 PRJ_TESTEXPORTS
 
+
--- a/locationmanager/geoconverter/group/geoconverter.mmp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/geoconverter/group/geoconverter.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/geoconverter/src/cgeoconverter.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -31,7 +31,7 @@
     CGeoConverter* self = new( ELeave ) CGeoConverter( aObserver );
     CleanupStack::PushL( self );
     self->ConstructL();
-    CleanupStack::Pop();
+    CleanupStack::Pop(); // self
     return self;
     }
 
@@ -185,7 +185,6 @@
         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
--- a/locationmanager/geotagger/group/geotagger.mmp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/geotagger/group/geotagger.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -68,7 +68,6 @@
 LIBRARY         estor.lib
 LIBRARY	        platformenv.lib
 
-DEBUGLIBRARY    flogger.lib
 LIBRARY         ecom.lib 
 LIBRARY	        libc.lib
 
--- a/locationmanager/geotagger/inc/cinternalgeotagger.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/geotagger/inc/cinternalgeotagger.h	Fri Aug 06 09:56:02 2010 +0300
@@ -120,11 +120,6 @@
       */        
     void AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId );
 
-    /**
-       * Remove location info incase reverse geo code fails.
-      * @param aLocationId location id
-      */        
-    void RemoveLocationInfoOnFailureL(const TItemId aLocationId);
     
     //MReverseGeocodeObserver
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/geotagger/sis/depends.xml	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/geotagger/src/cinternalgeotagger.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -113,19 +113,14 @@
     //for reverse geocoding (geo-tagging)
     
 #ifdef LOC_REVERSEGEOCODE
-    if (!iRevGeocoderPlugin)
-        {
-       
+      
 	   TRAP_IGNORE(
         iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
            REComSession::CreateImplementationL(KReverseGeoCodeUid, iDtorKey));)
 
-        if(iRevGeocoderPlugin)
-        	{
-           	iRevGeocoderPlugin->AddObserverL(*this); 
+        iRevGeocoderPlugin->AddObserverL(*this); 
 
-          }
-        }
+
 #endif //LOC_REVERSEGEOCODE
 
     LOG("CInternalGeoTagger::ConstructL ,end");
@@ -204,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();
         }
@@ -217,7 +212,7 @@
         iTagCreator->SetSession( iMdeSession );
 #endif
         }
-    else if(iMdeSessionOwnFlag)
+    else 
         {
         delete iMdeSession;
         iMdeSession = NULL;
@@ -232,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");
     }
 
@@ -890,50 +884,6 @@
 
 
 // --------------------------------------------------------------------------
-// CInternalGeoTagger::RemoveLocationInfoOnFailureL()
-// Remove the location info when reverse geo code fail so that retry can be ignore for the next iteration
-// --------------------------------------------------------------------------
-//
-void CInternalGeoTagger::RemoveLocationInfoOnFailureL(const TItemId aLocationId)
-	{
-	
-    LOG("CInternalGeoTagger::RemoveLocationInfoOnFailureL ,start");
-    
-	CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL();
-	CMdEObjectDef& locObjDef = namespaceDef.GetObjectDefL( Location::KLocationObject );
-	CMdEObject* location = iMdeSession->OpenObjectL(aLocationId, locObjDef);
-	CleanupStack::PushL( location );
-	
-	CMdEPropertyDef& propLatDef = locObjDef.GetPropertyDefL( Location::KLatitudeProperty );
-	CMdEPropertyDef& propLongDef = locObjDef.GetPropertyDefL( Location::KLongitudeProperty );
-
-	if (location->PropertyCount(propLatDef) == 0)
-		{
-		location->AddReal64PropertyL(propLatDef, KZeroLatLon ); //iLatitude
-		}
-	if (location->PropertyCount(propLongDef) == 0)
-		{
-		location->AddReal64PropertyL(propLongDef, KZeroLatLon ); //iLongitude
-		}
-	
-	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 );
-
-    LOG("CInternalGeoTagger::RemoveLocationInfoOnFailureL ,end");
-	}
-
-// --------------------------------------------------------------------------
 // CInternalGeoTagger::ReverseGeocodeComplete()
 //  Get address details like street, city, state, etc.
 // --------------------------------------------------------------------------
@@ -959,10 +909,7 @@
     else
         {
         LOG1("Reverse geocode err - %d", aErrorcode);
-        // reverse geo code fails. may be because of lat/lon value (e.g. mid of ocean)
-        // based on error code, Remove lat/lon from location table so that it should n't try to for the next time. ??
-		// May not be a good idea to remove lan/lon because it may fails due to n/w.
-        //TRAP_IGNORE(RemoveLocationInfoOnFailureL(iLocationId));
+
         IterateNextLocation();
         }
    
--- a/locationmanager/group/bld.inf	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/group/bld.inf	Fri Aug 06 09:56:02 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"
@@ -35,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/inc/locationmanagerdefs.h	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/locationtrail/group/locationtrail.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -78,7 +78,6 @@
 LIBRARY         commsdat.lib
 
 LIBRARY        geotagger.lib
-DEBUGLIBRARY flogger.lib
 LIBRARY        libc.lib
 
 #ifdef _LOC_REVERSEGEOCODE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/locationtrail/sis/depends.xml	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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/clocationrecord.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/locationtrail/src/clocationrecord.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -136,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
 
@@ -362,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;
@@ -377,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
 
@@ -1207,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();
@@ -1581,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
@@ -1852,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();
@@ -1909,7 +1913,6 @@
             iNewItem.iLocationData.iQuality = aPosition.HorizontalAccuracy();
             TItemId locationId = DoCreateLocationL( iNewItem.iLocationData );
             iRemapper->UpdateRelationsL( locationId ); 
-            // TODO: remap.
 #ifdef LOC_REVERSEGEOCODE
             if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress))
                 {
@@ -1939,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]);
@@ -1983,7 +1996,16 @@
                 // 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;
-                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 );
 
                 iMediaItems.Remove(0);
                 iMediaItems.Compress();
@@ -2242,7 +2264,6 @@
             
         iNetLocationQuery->FindL(1, 1); 
         iMediaHandlingFlag |= KLocationQueryInProgress;
-    //    iMediaHandlingFlag |= KNetQueryInProgress;
         }
     else
         {
--- a/locationmanager/locationtrail/src/ctracklog.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/locationtrail/src/ctracklog.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -223,6 +223,8 @@
 	RFile64 file;
 	RFileWriteStream writer;
 	
+	CleanupClosePushL( writer );
+	
 	TInt err;
 	err = file.Open( iFs, iTmpFileName, EFileRead );
 	if ( err != KErrNone )
@@ -249,8 +251,6 @@
 		writer.Sink()->SeekL( MStreamBuf::EWrite, TStreamPos( endpos ));
 		}
 	
-	CleanupClosePushL( writer );
-	
 	TInt count = iTrackLogItemArray.Count();
 	
 	for( TInt i = 0; i < count; i++ )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/locationmanager/server/sis/depends.xml	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/server/src/clocationgeotagtimerao.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -70,7 +70,7 @@
             new( ELeave ) CLocationGeoTagTimerAO(aMdeSession, aObserver);
        CleanupStack::PushL( self );
        self->ConstructL();
-       CleanupStack::Pop();
+       CleanupStack::Pop(); //self
        
        return self;
     }
--- a/locationmanager/server/src/clocationmanagerserver.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/server/src/clocationmanagerserver.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -76,6 +76,7 @@
         {
         TRAP( ret, RunServerL() );
         delete cleanup;
+        cleanup = NULL;
         }
     return ret;
     }
@@ -99,7 +100,7 @@
 // --------------------------------------------------------------------------
 //
 CLocationManagerServer::CLocationManagerServer() 
-    : CPolicyServer( CActive::EPriorityStandard, 
+    : CPolicyServer( KLocManagerSessionPriority, 
                      KLocationManagerPolicy, 
                      ESharableSessions ),
                      iASW(NULL),
@@ -133,10 +134,6 @@
     LOG ("CLocationManagerServer::ConstructL() begin");
     
     StartL( KLocServerName );
-    
-    RProcess process;
-    process.SetPriority( EPriorityBackground );
-    process.Close();
 
     // initialize etel
     InitialisePhoneL();
@@ -149,45 +146,49 @@
     
     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("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;
-            }
-        
         //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)
@@ -199,8 +200,13 @@
     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");
     }
 
@@ -227,6 +233,8 @@
     iTrackLog = NULL;
     delete iTimer;
     iTimer = NULL;
+    delete iRelationQuery;
+    iRelationQuery = NULL;
     delete iASW;
     iASW = NULL;
     delete iMdeSession;
@@ -1108,6 +1116,7 @@
 						}
 					iCopyReqs[i].iMessage.Complete( aError );
 					delete iCopyReqs[i].iQuery;
+					iCopyReqs[i].iQuery = NULL;
 					iCopyReqs.Remove( i );
 					break;
 					}
@@ -1154,6 +1163,7 @@
     		{
     		iCopyReqs[i].iMessage.Complete( KErrNone );
     		delete iCopyReqs[i].iQuery;
+    		iCopyReqs[i].iQuery = NULL;
     		iCopyReqs.Remove( i );
     		break;
     		}
--- a/locationmanager/server/src/clocationmanagersession.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/server/src/clocationmanagersession.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/server/src/clocationservertimerhandler.cpp	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/server/src/nwregistrationstatushandler.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -49,7 +49,7 @@
     CNwRegistrationStatusHandler* self = new( ELeave ) CNwRegistrationStatusHandler(aMobilePhone);
        CleanupStack::PushL( self );
        self->ConstructL();
-       CleanupStack::Pop();
+       CleanupStack::Pop(); //self
        
        return self;
     }
--- a/locationmanager/tagcreator/group/tagcreator.mmp	Fri Jul 23 10:03:59 2010 +0300
+++ b/locationmanager/tagcreator/group/tagcreator.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -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/sis/depends.xml	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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
--- a/mds_plat/harvester_framework_api/inc/harvesterclient.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/mds_plat/harvester_framework_api/inc/harvesterclient.h	Fri Aug 06 09:56:02 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/tsrc/group/LocationManagerTestScripter.mmp	Fri Jul 23 10:03:59 2010 +0300
+++ b/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -33,7 +33,6 @@
 MACRO LOC_REVERSEGEOCODE
 #endif
 
-
 SOURCEPATH      ../src
 SOURCE          LocationManagerTestScripter.cpp
 SOURCE          LocationManagerTestScripterBlocks.cpp
--- a/metadataengine/server/group/mdsserver.mmp	Fri Jul 23 10:03:59 2010 +0300
+++ b/metadataengine/server/group/mdsserver.mmp	Fri Aug 06 09:56:02 2010 +0300
@@ -93,7 +93,6 @@
 LIBRARY           flogger.lib
 LIBRARY           hash.lib
 LIBRARY			  inetprotutil.lib
-LIBRARY           platformenv.lib 
 
 UNPAGED
 
--- a/metadataengine/server/inc/mdspreferences.h	Fri Jul 23 10:03:59 2010 +0300
+++ b/metadataengine/server/inc/mdspreferences.h	Fri Aug 06 09:56:02 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/src/mdsmaintenanceengine.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/metadataengine/server/src/mdsmaintenanceengine.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -16,8 +16,6 @@
 */
 
 // INCLUDE FILES
-#include <driveinfo.h>
-
 #include "mdsmaintenanceengine.h"
 #include "mdslogger.h"
 #include "mdsmanipulationengine.h"
@@ -283,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/metadataengine/server/src/mdsmanipulationengine.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -155,7 +155,7 @@
         CleanupClosePushL(objStmt);
 		
         RMdSTransaction transaction( connection );
-        CleanupClosePushL(transaction);
+        CleanupClosePushL (transaction );
         const TInt beginError( transaction.Error() );
         if( beginError != KErrNone )
             {
@@ -1074,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/mdssqliteconnection.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/metadataengine/server/src/mdssqliteconnection.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -544,6 +544,11 @@
     if (err != KErrNone)
     	{
     	_LIT( KMdsTransactionBegin, "Transaction begin error" );
+        if( !iNotFinishFindQuery )
+            {
+            iEnableTransaction = ETrue;
+            }
+        iTransactionOngoing = EFalse;
     	TraceAndLeaveL( KMdsTransactionBegin, err );
     	}
 	CleanupStack::PopAndDestroy( &emptyRow );
@@ -582,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 );
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/rom/mds_cellid_reverse_geocode_enabled.iby	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/rom/mds_cellidenabled.iby	Fri Aug 06 09:56:02 2010 +0300
@@ -113,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	Fri Jul 23 10:03:59 2010 +0300
+++ b/rom/mds_reverse_geocode_enabled_only.iby	Fri Aug 06 09:56:02 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/sis/mds/package.pkg	Fri Aug 06 09:56:02 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 12, 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	Fri Jul 23 10:03:59 2010 +0300
+++ b/sis/mds/package_cellid_reverse_geocode_enabled.pkg	Fri Aug 06 09:56:02 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 12, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/package_cellidenabled.pkg	Fri Jul 23 10:03:59 2010 +0300
+++ b/sis/mds/package_cellidenabled.pkg	Fri Aug 06 09:56:02 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 12, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/package_reverse_geocode_enabled_only.pkg	Fri Jul 23 10:03:59 2010 +0300
+++ b/sis/mds/package_reverse_geocode_enabled_only.pkg	Fri Aug 06 09:56:02 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 12, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/package_separate.pkg	Fri Jul 23 10:03:59 2010 +0300
+++ b/sis/mds/package_separate.pkg	Fri Aug 06 09:56:02 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 12, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU
 
 ; Localised vendor name
 %{"Nokia"}
--- a/sis/mds/stub.pkg	Fri Jul 23 10:03:59 2010 +0300
+++ b/sis/mds/stub.pkg	Fri Aug 06 09:56:02 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"Metadata System"}, (0x200009F5), 10, 10, 12, TYPE=SA
+#{"Metadata System"}, (0x200009F5), 10, 10, 13, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}