219 |
219 |
220 // Save the sort ordering in the message store |
220 // Save the sort ordering in the message store |
221 // Set the default sort order |
221 // Set the default sort order |
222 iSortOrder = EMceCmdSortByDate; |
222 iSortOrder = EMceCmdSortByDate; |
223 iOrdering = EFalse; |
223 iOrdering = EFalse; |
224 if ( iMsgListContainer ) |
224 if ( iMsgListContainer ) |
225 { |
225 { |
226 TMsvId fId = iMsgListContainer->CurrentFolderId(); |
226 TMsvId fId = iMsgListContainer->CurrentFolderId(); |
227 for( TInt loop = 0; loop < iFolderItemArray->Count() ; loop++ ) |
227 for( TInt loop = 0; loop < iFolderItemArray->Count() ; loop++ ) |
228 { |
228 { |
229 TMceFolderItem item = ((*iFolderItemArray)[loop]); |
229 TMceFolderItem item = ((*iFolderItemArray)[loop]); |
230 if ( item.iFolderId == fId && aPrevViewId == TDRVIEWID) |
230 if ( item.iFolderId == fId && aPrevViewId == TDRVIEWID) |
231 { |
231 { |
232 iSortOrder = item.iSortOrder; |
232 iSortOrder = item.iSortOrder; |
233 iOrdering = item.iOrdering; |
233 iOrdering = item.iOrdering; |
234 } |
234 } |
235 } |
235 } |
236 } |
236 } |
237 if (aPrevViewId != TDRVIEWID ) |
237 if (aPrevViewId != TDRVIEWID ) |
238 { |
238 { |
239 // Reset the sort order |
239 // Reset the sort order |
240 iFolderItemArray->Reset(); |
240 iFolderItemArray->Reset(); |
241 } |
241 } |
242 |
242 |
243 if ( iMsgListContainer ) |
243 if ( iMsgListContainer ) |
244 { |
244 { |
245 iMsgListContainer->SetSortTypeL( iSortOrder, iOrdering ); |
245 iMsgListContainer->SetSortTypeL( iSortOrder, iOrdering ); |
246 } |
246 } |
247 |
247 |
248 TMsvId id = 0; |
248 TMsvId id = 0; |
249 TBool editorLaunched = EFalse; |
249 TBool editorLaunched = EFalse; |
250 TBool launchingFromOutside = EFalse; |
250 TBool launchingFromOutside = EFalse; |
251 TMsvId service = KMsvLocalServiceIndexEntryId; |
251 TMsvId service = KMsvLocalServiceIndexEntryId; |
252 TMsvEntry entry; |
252 TMsvEntry entry; |
|
253 TInt msgMtmUid = 0; |
253 |
254 |
254 if ( aCustomMessageId.iUid > KMsvRootIndexEntryId ) |
255 if ( aCustomMessageId.iUid > KMsvRootIndexEntryId ) |
255 { |
256 { |
256 |
257 |
257 if ( iSession->GetEntry( aCustomMessageId.iUid, service, entry ) != KErrNone ) |
258 if ( iSession->GetEntry( aCustomMessageId.iUid, service, entry ) != KErrNone ) |
258 { |
259 { |
259 iSession->GetEntry( KMsvGlobalInBoxIndexEntryId, service, entry ); // this should always succeed! |
260 iSession->GetEntry( KMsvGlobalInBoxIndexEntryId, service, entry ); // this should always succeed! |
260 } |
261 } |
261 |
262 |
262 // outside the app. |
263 // outside the app. |
263 launchingFromOutside = ETrue; |
264 launchingFromOutside = ETrue; |
264 //check, if message store has been changed from MMC to phone |
|
265 iMceUi->ToPhoneMemoryQueryL( ETrue ); |
|
266 |
|
267 // Set the forder containing the entry |
265 // Set the forder containing the entry |
268 if ( entry.iType == KUidMsvMessageEntry ) |
266 if ( entry.iType == KUidMsvMessageEntry ) |
269 { |
267 { |
270 // The aCustomMessageId is an ID of a message, set Inbox |
268 // The aCustomMessageId is an ID of a message, set Inbox |
271 SetFolderL( entry.Parent() ); |
269 SetFolderL( entry.Parent() ); |
272 id = aCustomMessageId.iUid; |
270 id = aCustomMessageId.iUid; |
273 } |
271 } |
274 else |
272 else |
275 { |
273 { |
276 // Set the folder based on the given ID |
274 // Set the folder based on the given ID |
277 iFolderId = aCustomMessageId.iUid; |
275 iFolderId = aCustomMessageId.iUid; |
278 |
276 // this is performance optimization, start to launch viewer before container creation |
279 } |
277 if ( !iMsgListContainer && entry.Id() == KMsvGlobalInBoxIndexEntryId ) |
|
278 { |
|
279 if ( LaunchViewerWhenOneUnreadL( msgMtmUid ) > KErrNotFound ) |
|
280 { |
|
281 editorLaunched = ETrue; |
|
282 } |
|
283 } |
|
284 } |
280 iMceUi->SetDontExitOnNextOperationComplete(); |
285 iMceUi->SetDontExitOnNextOperationComplete(); |
281 } |
286 } |
282 if ( iMsgListContainer && |
287 |
283 iCurrentListType != GetFolderListBoxType()) |
288 if ( iMsgListContainer && |
284 { |
289 iCurrentListType != GetFolderListBoxType()) |
285 ListboxTypeChangedL(); |
290 { |
286 } |
291 ListboxTypeChangedL(); |
287 else |
292 } |
288 { |
293 else |
289 CreateListboxL(); |
294 { |
290 } |
295 CreateListboxL(); |
291 |
296 } |
292 |
|
293 if ( iMsgListContainer && aPrevViewId == TDRVIEWID ) |
297 if ( iMsgListContainer && aPrevViewId == TDRVIEWID ) |
294 { |
298 { |
295 // Save the sort ordering in the message store |
299 // Save the sort ordering in the message store |
296 // Set the default sort order |
300 // Set the default sort order |
297 iSortOrder = EMceCmdSortByDate; |
301 iSortOrder = EMceCmdSortByDate; |
2292 // ---------------------------------------------------- |
2308 // ---------------------------------------------------- |
2293 // CMceMessageListView::EditMenuL |
2309 // CMceMessageListView::EditMenuL |
2294 // ---------------------------------------------------- |
2310 // ---------------------------------------------------- |
2295 void CMceMessageListView::EditMenuL( CEikMenuPane* aMenuPane ) const |
2311 void CMceMessageListView::EditMenuL( CEikMenuPane* aMenuPane ) const |
2296 { |
2312 { |
2297 TInt listPopulated =1; |
2313 // This function is not called if empty folder/list is yet to be populated |
2298 //Get the value, accordingly we can dim/undim mark all for one row list only |
2314 // because in that case EditMenu is hidden |
2299 if(!iCurrentListType) |
|
2300 { |
|
2301 TInt r = RProperty::Get( KPSUidMuiu, KMuiuOneRowListPopulated, listPopulated ); |
|
2302 if ( r != KErrNone ) |
|
2303 { |
|
2304 User::LeaveIfError( r ); |
|
2305 } |
|
2306 } |
|
2307 // This function is not called if empty folder because in that case |
|
2308 // EditMenu is hidden |
|
2309 aMenuPane->SetItemDimmed( EAknCmdMarkReadMsgs, ETrue ); |
2315 aMenuPane->SetItemDimmed( EAknCmdMarkReadMsgs, ETrue ); |
2310 |
2316 |
2311 TInt count = iMsgListContainer->SelectionCount(); |
2317 TInt count = iMsgListContainer->SelectionCount(); |
2312 |
2318 |
2313 if ( count == 0 ) |
2319 if ( count == 0 ) |