47 // CHarvesterRequestActive::NewL |
44 // CHarvesterRequestActive::NewL |
48 // Two-phased constructor. |
45 // Two-phased constructor. |
49 // --------------------------------------------------------------------------- |
46 // --------------------------------------------------------------------------- |
50 // |
47 // |
51 CHarvesterRequestActive* CHarvesterRequestActive::NewL( |
48 CHarvesterRequestActive* CHarvesterRequestActive::NewL( |
52 RHarvesterClient& aClient, MHarvestObserver* aObserver, |
49 RHarvesterClient& aClient, |
53 TInt aService, const TDesC& aUri, |
50 TInt aService, const TDesC& aUri, |
54 HBufC8* aAlbumIds, TBool aAddLocation, |
51 HBufC8* aAlbumIds, TBool aAddLocation, |
55 CHarvesterRequestQueue* aQueue ) |
52 CHarvesterRequestQueue* aQueue ) |
56 { |
53 { |
57 CHarvesterRequestActive* self = new( ELeave )CHarvesterRequestActive( aClient, aObserver, |
54 CHarvesterRequestActive* self = new( ELeave )CHarvesterRequestActive( aClient, |
58 aService, aUri, aAlbumIds, aAddLocation, aQueue ); |
55 aService, aUri, aAlbumIds, aAddLocation, aQueue ); |
59 return self; |
56 return self; |
60 } |
57 } |
61 |
58 |
62 // --------------------------------------------------------------------------- |
59 // --------------------------------------------------------------------------- |
63 // CHarvesterRequestActive::CHarvesterRequestActive() |
60 // CHarvesterRequestActive::CHarvesterRequestActive() |
64 // C++ default constructor can NOT contain any code, that might leave. |
61 // C++ default constructor can NOT contain any code, that might leave. |
65 // --------------------------------------------------------------------------- |
62 // --------------------------------------------------------------------------- |
66 // |
63 // |
67 CHarvesterRequestActive::CHarvesterRequestActive( RHarvesterClient& aClient, |
64 CHarvesterRequestActive::CHarvesterRequestActive( RHarvesterClient& aClient, |
68 MHarvestObserver* aObserver, TInt aService, const TDesC& aUri, |
65 TInt aService, const TDesC& aUri, |
69 HBufC8* aAlbumIds, TBool aAddLocation, CHarvesterRequestQueue* aQueue ) |
66 HBufC8* aAlbumIds, TBool aAddLocation, CHarvesterRequestQueue* aQueue ) |
70 : CActive( CActive::EPriorityStandard ), iClient( aClient ), iObserver( aObserver ), |
67 : CActive( CActive::EPriorityStandard ), iClient( aClient ), |
71 iService( aService ), iUri( aUri ), iAlbumIds( aAlbumIds ), iAddLocation( aAddLocation ), |
68 iService( aService ), iUri( aUri ), iAlbumIds( aAlbumIds ), iAddLocation( aAddLocation ), |
72 iRequestQueue( aQueue ), iLocation( EFalse ), iCancelled( EFalse ) |
69 iRequestQueue( aQueue ), iLocation( EFalse ), iCancelled( EFalse ) |
73 { |
70 { |
74 CActiveScheduler::Add( this ); |
71 CActiveScheduler::Add( this ); |
75 } |
72 } |
131 TIpcArgs ipcArgs( &iUri, iAlbumIds, &iLocation ); |
120 TIpcArgs ipcArgs( &iUri, iAlbumIds, &iLocation ); |
132 iPersistentArgs = ipcArgs; |
121 iPersistentArgs = ipcArgs; |
133 |
122 |
134 if( !iCancelled ) |
123 if( !iCancelled ) |
135 { |
124 { |
136 iClient.HarvestFile( iService, iPersistentArgs, iStatus ); |
125 iClient.HarvestFile( iService, iPersistentArgs, iStatus, iUri ); |
137 SetActive(); |
126 SetActive(); |
138 } |
127 } |
139 } |
128 } |
140 |
129 |
141 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
142 // CHarvesterRequestActive::ForceHarvest() |
131 // CHarvesterRequestActive::ForceHarvest() |
143 // --------------------------------------------------------------------------- |
132 // --------------------------------------------------------------------------- |
144 // |
133 // |
145 void CHarvesterRequestActive::ForceHarvest() |
134 void CHarvesterRequestActive::ForceHarvest() |
146 { |
135 { |
147 iObserver = NULL; |
136 WRITELOG( "CHarvesterRequestActive::ForceHarvest()"); |
148 |
137 |
149 TPckg<TBool> location( iAddLocation ); |
138 TPckg<TBool> location( iAddLocation ); |
150 iLocation.Set( location ); |
139 iLocation.Set( location ); |
151 |
140 |
152 TIpcArgs ipcArgs( &iUri, iAlbumIds, &iLocation ); |
141 TIpcArgs ipcArgs( &iUri, iAlbumIds, &iLocation ); |