Moved temporary feed parser files to subdirectory under private dir, and added cleanup of this directory on startup.
authorteknolog
Sun, 04 Apr 2010 00:21:57 +0100
changeset 108 554d9980157f
parent 107 af6475fdf8d6
child 109 223f270fa7ff
Moved temporary feed parser files to subdirectory under private dir, and added cleanup of this directory on startup.
engine/src/FeedEngine.cpp
--- a/engine/src/FeedEngine.cpp	Sat Apr 03 21:28:44 2010 +0100
+++ b/engine/src/FeedEngine.cpp	Sun Apr 04 00:21:57 2010 +0100
@@ -27,6 +27,7 @@
 #include "PodcastUtils.h"
 #include <utf.h>
 
+_LIT(KFeedParseStorePath, "feeds\\");
 // Cleanup stack macro for SQLite3
 // TODO Move this to some common place.
 static void Cleanup_sqlite3_finalize_wrapper(TAny* handle)
@@ -66,6 +67,15 @@
 		if (BaflUtils::FileExists(iPodcastModel.FsSession(), defaultFile)) {
 			ImportFeedsL(defaultFile);
 		}
+	} else {
+		// clean out feeds temp directory
+		TFileName feedTempPath;
+		feedTempPath.Copy (iPodcastModel.SettingsEngine().PrivatePath ());
+		feedTempPath.Append(KFeedParseStorePath);
+		feedTempPath.Append(_L("*"));
+
+		BaflUtils::EnsurePathExistsL(iPodcastModel.FsSession(), feedTempPath);
+		BaflUtils::DeleteFile(iPodcastModel.FsSession(),feedTempPath);
 	}
     
     TFileName importFile = iPodcastModel.SettingsEngine().ImportFeedsFileName();
@@ -229,6 +239,9 @@
 	DBUpdateFeedL(*iActiveFeed);
 	
 	iUpdatingFeedFileName.Copy (iPodcastModel.SettingsEngine().PrivatePath ());
+	iUpdatingFeedFileName.Append(KFeedParseStorePath);
+	BaflUtils::EnsurePathExistsL(iPodcastModel.FsSession(), iUpdatingFeedFileName);
+	
 	_LIT(KFileNameFormat, "%lu.xml");
 	iUpdatingFeedFileName.AppendFormat(KFileNameFormat, aFeedUid);