engine/src/ShowEngine.cpp
changeset 53 b778853e60a7
parent 44 f6f9647922ba
child 67 9c24c921ec35
child 109 223f270fa7ff
--- a/engine/src/ShowEngine.cpp	Fri Mar 12 09:50:01 2010 +0000
+++ b/engine/src/ShowEngine.cpp	Sat Mar 13 16:53:21 2010 +0000
@@ -1080,6 +1080,13 @@
 
 	for (TInt i = count - 1; i >= 0; i--)
 		{
+		if (iShowDownloading && iShowDownloading->Uid() == array[i]->Uid())
+			{
+			// trying to delete the active download
+			RemoveDownloadL(iShowDownloading->Uid());
+			}
+		
+		// delete downloaded file
 		if (array[i]->FileName().Length() > 0)
 			{
 			if (aDeleteFiles)
@@ -1089,7 +1096,15 @@
 			}
 		}
 	array.ResetAndDestroy();
+	
+	// delete all shows from DB
 	DBDeleteAllShowsByFeed(aFeedUid);
+
+	// this will clear out deleted shows from the download queue
+	DBGetAllDownloadsL(array);
+	array.ResetAndDestroy();
+
+	NotifyDownloadQueueUpdatedL();
 	}
 
 EXPORT_C void CShowEngine::DeleteOldShowsByFeed(TUint aFeedUid)