harvester/client/src/harvesterrequestactive.cpp
changeset 45 a93990e5815e
parent 20 6dfc5f825351
child 52 40db28bb26b8
--- a/harvester/client/src/harvesterrequestactive.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/harvester/client/src/harvesterrequestactive.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -19,6 +19,7 @@
 
 #include "harvesterrequestactive.h"
 #include "harvesterrequestqueue.h"
+#include "harvesterlog.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -32,14 +33,11 @@
     if( IsActive() )
         {
         Cancel();
-        if( iObserver )
-            {
-            iObserver->HarvestingComplete( iUri, KErrCancel );
-            }    
         iRequestCompleted = ETrue;
         }
     
     delete iAlbumIds;
+    iAlbumIds = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -48,12 +46,12 @@
 // --------------------------------------------------------------------------- 
 //
 CHarvesterRequestActive* CHarvesterRequestActive::NewL(
-        RHarvesterClient& aClient, MHarvestObserver* aObserver,
+        RHarvesterClient& aClient,
         TInt aService, const TDesC& aUri, 
         HBufC8* aAlbumIds, TBool aAddLocation,
         CHarvesterRequestQueue* aQueue )
     {
-    CHarvesterRequestActive* self = new( ELeave )CHarvesterRequestActive( aClient, aObserver,
+    CHarvesterRequestActive* self = new( ELeave )CHarvesterRequestActive( aClient,
             aService, aUri, aAlbumIds, aAddLocation, aQueue );
     return self;
     }
@@ -63,10 +61,10 @@
 // C++ default constructor can NOT contain any code, that might leave.
 // ---------------------------------------------------------------------------
 //
-CHarvesterRequestActive::CHarvesterRequestActive( RHarvesterClient& aClient,
-    MHarvestObserver* aObserver, TInt aService, const TDesC& aUri, 
+CHarvesterRequestActive::CHarvesterRequestActive( RHarvesterClient& aClient, 
+    TInt aService, const TDesC& aUri, 
     HBufC8* aAlbumIds, TBool aAddLocation, CHarvesterRequestQueue* aQueue )
-    : CActive( CActive::EPriorityStandard ), iClient( aClient ), iObserver( aObserver ), 
+    : CActive( CActive::EPriorityStandard ), iClient( aClient ), 
     iService( aService ), iUri( aUri ), iAlbumIds( aAlbumIds ), iAddLocation( aAddLocation ),
     iRequestQueue( aQueue ), iLocation( EFalse ), iCancelled( EFalse )
     {
@@ -79,10 +77,6 @@
 //
 void CHarvesterRequestActive::RunL()
     {
-    if( iStatus.Int() && iObserver )
-        {
-        iObserver->HarvestingComplete( iUri, iStatus.Int() );
-        }       
     iRequestCompleted = ETrue;
     if( iRequestQueue )
         {
@@ -101,10 +95,6 @@
         return KErrNone;
         }
     
-    if( iObserver )
-        {
-        iObserver->HarvestingComplete( iUri, aError );
-        }    
     iRequestCompleted = ETrue;
     return KErrNone;
     }
@@ -132,7 +122,7 @@
     
     if( !iCancelled )
         {
-        iClient.HarvestFile( iService, iPersistentArgs, iStatus );
+        iClient.HarvestFile( iService, iPersistentArgs, iStatus, iUri );
         SetActive();
         }
     }
@@ -143,7 +133,7 @@
 //
 void CHarvesterRequestActive::ForceHarvest()
     {
-    iObserver = NULL;
+    WRITELOG( "CHarvesterRequestActive::ForceHarvest()");
     
     TPckg<TBool> location( iAddLocation );
     iLocation.Set( location );