emailuis/emailui/src/FreestyleEmailUiAppui.cpp
branchRCL_3
changeset 20 efd4f1afd43e
parent 18 6b8f3b30d0ec
child 22 d620048b4810
equal deleted inserted replaced
18:6b8f3b30d0ec 20:efd4f1afd43e
  1284 	TInt ret=0;
  1284 	TInt ret=0;
  1285 	for ( TInt i=0;i<currentInboxListIndex;i++ )
  1285 	for ( TInt i=0;i<currentInboxListIndex;i++ )
  1286 		{
  1286 		{
  1287 		CFSEmailUiMailListModelItem* item =
  1287 		CFSEmailUiMailListModelItem* item =
  1288 			static_cast<CFSEmailUiMailListModelItem*>(iMailListVisualiser->Model()->Item(i+1));
  1288 			static_cast<CFSEmailUiMailListModelItem*>(iMailListVisualiser->Model()->Item(i+1));
  1289 		if ( item->ModelItemType() == ETypeMailItem )
  1289 		if ( item && item->ModelItemType() == ETypeMailItem )
  1290 			{
  1290 			{
  1291 			ret++;
  1291 			ret++;
  1292 			}
  1292 			}
  1293 		}
  1293 		}
  1294 	return ret; // Plus 1 for the first index, because it is always separator
  1294 	return ret; // Plus 1 for the first index, because it is always separator
  2157 			}
  2157 			}
  2158 			break;
  2158 			break;
  2159    		case TFSEventMailboxOnline:
  2159    		case TFSEventMailboxOnline:
  2160    		case TFSEventMailboxOffline:
  2160    		case TFSEventMailboxOffline:
  2161    			{
  2161    			{
  2162    			if (aEvent == TFSEventMailboxOnline)
  2162    			//must check event go to right MailBox
  2163    			    {
  2163     		if( aMailbox == GetActiveMailboxId() ) 
  2164    			    UpdateTitlePaneConnectionStatus(EForceToConnected);
  2164     			{
       
  2165       			if (aEvent == TFSEventMailboxOnline)
       
  2166     			    {
       
  2167     			    UpdateTitlePaneConnectionStatus(EForceToConnected);
       
  2168     			    }
       
  2169     			else if (aEvent == TFSEventMailboxOffline)
       
  2170     			    { 
       
  2171     			    UpdateTitlePaneConnectionStatus(EForceToDisconnected);
       
  2172     				}
  2165    			    }
  2173    			    }
  2166    			else if (aEvent == TFSEventMailboxOffline)
  2174 				
  2167    			    {
       
  2168    			    UpdateTitlePaneConnectionStatus(EForceToDisconnected);
       
  2169    			    }
       
  2170             // Cancel all ongoing downloads for the disconnected mailbox
  2175             // Cancel all ongoing downloads for the disconnected mailbox
  2171             if (iDwnldMediator && aEvent == TFSEventMailboxOffline)
  2176             if (iDwnldMediator && aEvent == TFSEventMailboxOffline)
  2172               {
  2177               {
  2173               iDwnldMediator->CancelAllDownloadsL(aMailbox);
  2178               iDwnldMediator->CancelAllDownloadsL(aMailbox);
  2174               }
  2179               }
  2201   			break;
  2206   			break;
  2202     	case TFSEventMailboxSyncStateChanged:
  2207     	case TFSEventMailboxSyncStateChanged:
  2203     		{
  2208     		{
  2204     		TBool tryRunningFakeSyncAnim( EFalse );
  2209     		TBool tryRunningFakeSyncAnim( EFalse );
  2205     		TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 );
  2210     		TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 );
       
  2211 
       
  2212     		//must check event go to right MailBox
       
  2213     		if( aMailbox != GetActiveMailboxId() )
       
  2214     			break;
       
  2215     		
  2206     		if ( newSyncState !=0 && *newSyncState )
  2216     		if ( newSyncState !=0 && *newSyncState )
  2207     			{
  2217     			{
  2208         		switch ( *newSyncState )
  2218         		switch ( *newSyncState )
  2209         			{
  2219         			{
  2210                     case StartingSync:
  2220                     case StartingSync: