Fix for broken check for active downloads when exiting RCL_3
authorSebastian Brannstrom <sebastianb@symbian.org>
Fri, 29 Oct 2010 00:12:35 +0100
branchRCL_3
changeset 302 cf14797d0023
parent 301 f5af16df2425
child 303 a24de3790879
Fix for broken check for active downloads when exiting
application/inc/PodcastListView.h
application/src/PodcastAppui.cpp
application/src/PodcastFeedView.cpp
--- a/application/inc/PodcastListView.h	Thu Oct 28 23:32:49 2010 +0100
+++ b/application/inc/PodcastListView.h	Fri Oct 29 00:12:35 2010 +0100
@@ -117,7 +117,7 @@
 		* Default implementation is empty.  
 		* @param aCommand ID of the command to respond to. 
 		*/
-		void HandleCommandL(TInt aCommand);
+		virtual void HandleCommandL(TInt aCommand);
 
 		void OfferToolbarEventL(TInt aCommand);
 		void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar);
--- a/application/src/PodcastAppui.cpp	Thu Oct 28 23:32:49 2010 +0100
+++ b/application/src/PodcastAppui.cpp	Fri Oct 29 00:12:35 2010 +0100
@@ -143,11 +143,13 @@
 			const TUid KUidFastSwapS3 = { 0x20016BF0 };
 			if (activeAppUid == KUidFastSwapS3)
 				{
+				DP("Exit called by task manager");
 				// closed by task manager
 				Exit();
 				}
 			else
         		{
+				DP("Red button pressed, going into background");
         		// red button pressed
 				TApaTask task(iEikonEnv->WsSession());
 				task.SetWgId(iEikonEnv->RootWin().Identifier());
--- a/application/src/PodcastFeedView.cpp	Thu Oct 28 23:32:49 2010 +0100
+++ b/application/src/PodcastFeedView.cpp	Fri Oct 29 00:12:35 2010 +0100
@@ -509,31 +509,6 @@
 				iPodcastModel.FeedEngine().CancelUpdateAllFeeds();
 				}
 			}break;
-		case EAknSoftkeyExit:
-			{
-			RShowInfoArray dlQueue;
-			iPodcastModel.ShowEngine().GetShowsDownloadingL(dlQueue);
-			TUint queueCount = dlQueue.Count();
-			dlQueue.ResetAndDestroy();
-			dlQueue.Close();
-			
-			if (queueCount > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
-				{
-				TBuf<KMaxMessageLength> message;
-				iEikonEnv->ReadResourceL(message, R_EXIT_SHOWS_DOWNLOADING);
-				if(ShowQueryMessageL(message))
-					{
-					// pass it on to AppUi, which will exit for us
-					CPodcastListView::HandleCommandL(aCommand);
-					}
-				} 
-			else
-				{
-					// nothing in queue, or downloading suspended
-					CPodcastListView::HandleCommandL(aCommand);
-				}
-			}
-			break;
 		default:
 			CPodcastListView::HandleCommandL(aCommand);
 			break;
@@ -876,10 +851,14 @@
 
 void CPodcastFeedView::CheckConfirmExit()
 	{
+	DP("CPodcastFeedView::CheckConfirmExit");
 	RShowInfoArray showsDownloading;
 	iPodcastModel.ShowEngine().GetShowsDownloadingL(showsDownloading);
+	TUint count = showsDownloading.Count();
+	showsDownloading.ResetAndDestroy();
+	showsDownloading.Close();
 
-	if (showsDownloading.Count() > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
+	if (count > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
 		{
 		TBuf<256> msg;
 		iEikonEnv->ReadResourceL(msg, R_EXIT_SHOWS_DOWNLOADING);
@@ -947,6 +926,7 @@
 					}
 				else
 					{
+					iToolbar->SetToolbarVisibility(EFalse);
 					AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID,  TUid::Uid(0), KNullDesC8());
 					}
 				iOpmlState = EOpmlIdle;