engine/src/ShowEngine.cpp
changeset 34 a6046405f1aa
parent 30 7bca37ba5fa9
child 36 e010fc411ddc
--- a/engine/src/ShowEngine.cpp	Thu Mar 04 19:46:25 2010 +0000
+++ b/engine/src/ShowEngine.cpp	Thu Mar 04 22:06:39 2010 +0000
@@ -1171,19 +1171,20 @@
 	const TInt count = DBGetDownloadsCount();
 	DP("CShowEngine::DownloadNextShow\tTrying to start new download");DP1("CShowEngine::DownloadNextShow\tShows in download queue %d", count);
 
-	// Inform the observers
-	NotifyDownloadQueueUpdatedL();
-
 	if (count > 0)
 		{
 		if (iPodcastModel.SettingsEngine().DownloadSuspended())
 			{
 			DP("CShowEngine::DownloadNextShow\tDownload process is suspended, ABORTING");
+			// Inform the observers
+			NotifyDownloadQueueUpdatedL();
 			return;
 			}
 		else if (iShowClient->IsActive())
 			{
 			DP("CShowEngine::DownloadNextShow\tDownload process is already active.");
+			// Inform the observers
+			NotifyDownloadQueueUpdatedL();
 			return;
 			}
 		else
@@ -1201,6 +1202,10 @@
 				info->SetLastError(KErrNone);
 				DBUpdateShow(*info);
 				iShowDownloading = info;
+				// Inform the observers
+				// important to do this after we change download state
+				NotifyDownloadQueueUpdatedL();
+
 				TRAPD(error,getOk = GetShowL(info));
 				if (error != KErrNone || !getOk)
 					{
@@ -1224,6 +1229,8 @@
 		}
 	else
 		{
+		// Inform the observers
+		NotifyDownloadQueueUpdatedL();
 		iShowDownloading = NULL;DP("CShowEngine::DownloadNextShow\tNothing to download");
 		}
 	DP("CShowEngine::DownloadNextShowL END");