--- a/ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp Wed Jun 09 09:22:57 2010 +0300
@@ -33,8 +33,7 @@
{
FUNC_LOG;
CIpsPlgMsgIterator* self =
- new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails,
- aSorting );
+ new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails );
CleanupStack::PushL( self );
self->ConstructL( aMsvSession, aFolderId, aSorting );
CleanupStack::Pop( self );
@@ -53,8 +52,7 @@
{
FUNC_LOG;
CIpsPlgMsgIterator* self =
- new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails,
- aSorting );
+ new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails );
CleanupStack::PushL( self );
self->ConstructL( aFolderEntry, aSorting );
CleanupStack::Pop( self );
@@ -73,6 +71,8 @@
delete iMsgMapper;
delete iMsgSortKey;
delete iMsgSwapper;
+
+ iSortingCriteria.Reset();
}
// ---------------------------------------------------------------------------
@@ -323,10 +323,9 @@
CIpsPlgMsgIterator::CIpsPlgMsgIterator(
CIpsPlgSosBasePlugin& aPlugin,
const TFSMailMsgId& aMailboxId,
- const TFSMailDetails aDetails,
- const RArray<TFSMailSortCriteria>& aSorting )
+ const TFSMailDetails aDetails )
: iPlugin( aPlugin ), iRequestedDetails( aDetails ),
- iSortingCriteria( aSorting ), iMailboxId( aMailboxId )
+ iMailboxId( aMailboxId )
{
FUNC_LOG;
// none
@@ -344,7 +343,9 @@
{
FUNC_LOG;
iFolderEntry = aMsvSession.GetEntryL( aFolderId.Id() );
- iMsgSortKey = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, aSorting );
+
+ StoreSortCriteriaL(aSorting);
+ iMsgSortKey = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, iSortingCriteria );
iMsgSwapper = new (ELeave) TIpsPlgMsgSwap( *iFolderEntry );
iSortingOn =
( aSorting.Count() > 0 ) && ( aSorting[0].iField != EFSMailDontCare);
@@ -363,7 +364,8 @@
{
FUNC_LOG;
iFolderEntry = aFolderEntry;
- iMsgSortKey = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, aSorting );
+ StoreSortCriteriaL(aSorting);
+ iMsgSortKey = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, iSortingCriteria );
iMsgSwapper = new (ELeave) TIpsPlgMsgSwap( *iFolderEntry );
iSortingOn =
( aSorting.Count() > 0 ) && ( aSorting[0].iField != EFSMailDontCare);
@@ -482,3 +484,19 @@
return filteredEntries;
}
+// -----------------------------------------------------------------------------
+// stores sort criteria given by user
+// -----------------------------------------------------------------------------
+void CIpsPlgMsgIterator::StoreSortCriteriaL(
+ const RArray<TFSMailSortCriteria>& aSorting )
+ {
+ for ( TInt i=0; i < aSorting.Count(); i++ )
+ {
+ const TFSMailSortCriteria& criteria = aSorting[i];
+ TFSMailSortCriteria fsCriteria;
+ fsCriteria.iField = criteria.iField;
+ fsCriteria.iOrder = criteria.iOrder;
+ iSortingCriteria.AppendL(fsCriteria);
+ }
+ }
+