browserutilities/downloadmgr/DownloadMgrUiLib/Src/CUserInteractionsUtils.cpp
changeset 10 a359256acfc6
parent 1 7c90e6132015
child 25 0ed94ceaa377
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
  1069     
  1069     
  1070     if ( resp ) // We have to check only that the value is non-zero
  1070     if ( resp ) // We have to check only that the value is non-zero
  1071         {
  1071         {
  1072         TInt count = iRegistryModel.DownloadMgr().CurrentDownloads().Count();
  1072         TInt count = iRegistryModel.DownloadMgr().CurrentDownloads().Count();
  1073         TInt32 dlState;
  1073         TInt32 dlState;
  1074         for(TInt i = 0; i < count; i++)
  1074         TInt i = 0;
       
  1075         while((i < count)&& (count>0))
  1075         	{
  1076         	{
  1076         	(iRegistryModel.DownloadMgr().CurrentDownloads().At(i))->GetIntAttribute(EDlAttrState, dlState);
  1077         	(iRegistryModel.DownloadMgr().CurrentDownloads().At(i))->GetIntAttribute(EDlAttrState, dlState);
  1077         	
  1078         	i++;
  1078         	//add fix for the bug  JERI-7P8CF2, if checking against EHttpDlMultipleMOCompleted EHttpDlMultipleMOFailed
  1079         	//add fix for the bug  JERI-7P8CF2, if checking against EHttpDlMultipleMOCompleted EHttpDlMultipleMOFailed
  1079              //Changes for the bug JERI-7P8CF2
  1080              //Changes for the bug JERI-7P8CF2
  1080             //Changes made in the server side to fix for the video center receiving unexpected events
  1081             //Changes made in the server side to fix for the video center receiving unexpected events
  1081             //Reassigning these events back to the changes done in server side
  1082             //Reassigning these events back to the changes done in server side
  1082             if(dlState  == EHttpDlCompleted )
  1083             if(dlState  == EHttpDlCompleted )
  1088 		       dlState  = EHttpDlMultipleMOFailed;
  1089 		       dlState  = EHttpDlMultipleMOFailed;
  1089 		       }
  1090 		       }
  1090            
  1091            
  1091             if(dlState == EHttpDlInprogress || dlState == EHttpDlPaused )
  1092             if(dlState == EHttpDlInprogress || dlState == EHttpDlPaused )
  1092         	    {
  1093         	    {
  1093         	    User::LeaveIfError( (iRegistryModel.DownloadMgr().CurrentDownloads().At(i))->Delete());
       
  1094         	    i--;
  1094         	    i--;
  1095         	    count--;
  1095         	    count--;
       
  1096         	    User::LeaveIfError( (iRegistryModel.DownloadMgr().CurrentDownloads().At(i))->Delete());
  1096         	    }
  1097         	    }
  1097         	}
  1098         	}
  1098         CLOG_LEAVEFN("CUserInteractionsUtils::CancelAllWithUserConfirmL");
  1099         CLOG_LEAVEFN("CUserInteractionsUtils::CancelAllWithUserConfirmL");
  1099         return ETrue; // Cancelled
  1100         return ETrue; // Cancelled
  1100         }
  1101         }
  1778                 );
  1779                 );
  1779                      
  1780                      
  1780             CleanupStack::PopAndDestroy( &appArcSession );
  1781             CleanupStack::PopAndDestroy( &appArcSession );
  1781             CleanupStack::PopAndDestroy( param );
  1782             CleanupStack::PopAndDestroy( param );
  1782             }
  1783             }
       
  1784         
       
  1785         //Store the information whether progressive play is launched or not
       
  1786         iRegistryModel.UserInteractions().SetProgressiveDownloadLaunched( ETrue );
  1783         if( aProgressively )
  1787         if( aProgressively )
  1784             {
  1788             {
  1785             User::LeaveIfError( aDownload.SetIntAttribute( EDlAttrActivePlayedDownload, activeDownloadID ) );
  1789             User::LeaveIfError( aDownload.SetIntAttribute( EDlAttrActivePlayedDownload, activeDownloadID ) );
  1786             }   
  1790             }   
  1787 
  1791 
  1951 // -----------------------------------------------------------------------------
  1955 // -----------------------------------------------------------------------------
  1952 // CUserInteractionsUtils::SendMsgTerminateToPdAppsL
  1956 // CUserInteractionsUtils::SendMsgTerminateToPdAppsL
  1953 // -----------------------------------------------------------------------------
  1957 // -----------------------------------------------------------------------------
  1954 //
  1958 //
  1955 
  1959 
  1956 void CUserInteractionsUtils::SendMsgTerminateToPdAppsL()
  1960 void CUserInteractionsUtils::SendMsgTerminateToPdAppsL(TBool aProgressiveDownloadLaunched )
  1957     {
  1961     {
  1958         CLOG_ENTERFN("CUserInteractionsEventHandler::SendMsgTerminateToPdAppsL");
  1962         CLOG_ENTERFN("CUserInteractionsEventHandler::SendMsgTerminateToPdAppsL");
  1959         // Pack EGenericParamTerminate.
  1963         // Pack EGenericParamTerminate.
  1960         TInt32 browserTerminate( 1 );
  1964         TInt32 browserTerminate( 1 );
  1961         CAiwGenericParamList* genParList = CAiwGenericParamList::NewLC();
  1965         CAiwGenericParamList* genParList = CAiwGenericParamList::NewLC();
  1989  	        } 
  1993  	        } 
  1990 	    for( TInt i = 0; i < KDocPDAppUidCount; i++ )
  1994 	    for( TInt i = 0; i < KDocPDAppUidCount; i++ )
  1991 	    {
  1995 	    {
  1992 			TUid KTestPdPlayerUid = {KDocPDAppUidList[ i ]};
  1996 			TUid KTestPdPlayerUid = {KDocPDAppUidList[ i ]};
  1993 			TApaTask task = taskList.FindApp(KTestPdPlayerUid );		// task for MP app    
  1997 			TApaTask task = taskList.FindApp(KTestPdPlayerUid );		// task for MP app    
  1994 			if ( task.Exists() && isProgressive  )
  1998 			if ( task.Exists() && ( isProgressive || aProgressiveDownloadLaunched ) )
  1995 				{
  1999 				{
  1996 				RHttpDownload* dl = downloads.At(j); // current download
  2000 				if ( isProgressive )
  1997                 //This Atribute will tell if MP called Delete  				
  2001 				    {    
  1998 				//on exit of Browser				
  2002 				    RHttpDownload* dl = downloads.At(j); // current download
  1999  	            dl->SetBoolAttribute( EDlAttrProgressive, EFalse );
  2003                     //This Atribute will tell if MP called Delete  				
       
  2004 				    //on exit of Browser				
       
  2005  	                dl->SetBoolAttribute( EDlAttrProgressive, EFalse );
       
  2006 				    }
  2000 				// 8-bit buffer is required. 
  2007 				// 8-bit buffer is required. 
  2001 				task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
  2008 				task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
  2002 				task.BringToForeground();
  2009 				task.BringToForeground();
  2003 				}
  2010 				}
  2004 		}
  2011 		}