Added debug mechanism to copy SQLite DB to c:\data symbian1
authorSebastian Brannstrom <sebastianb@symbian.org>
Wed, 28 Jul 2010 14:15:58 +0100
branchsymbian1
changeset 211 aa8e7de6f033
parent 210 e82411ba1646
child 212 713bd6cc0b7a
Added debug mechanism to copy SQLite DB to c:\data
engine/src/PodcastModel.cpp
--- a/engine/src/PodcastModel.cpp	Mon Jul 26 17:03:11 2010 +0100
+++ b/engine/src/PodcastModel.cpp	Wed Jul 28 14:15:58 2010 +0100
@@ -16,6 +16,9 @@
 *
 */
 
+// when enabled this macro copies the database to c:\data on launch for debug purposes
+//#define COPY_DB
+
 #include <commdb.h>
 #include "PodcastModel.h"
 #include "FeedEngine.h"
@@ -344,6 +347,15 @@
 		// open DB
 		TBuf8<KMaxFileName> filename8;
 		filename8.Copy(dbFileName);
+		
+#ifdef COPY_DB
+		DP("Copying DB to c:\\data");
+		TFileName copyName;
+		copyName.Copy(_L("C:\\data\\"));
+		copyName.Append(KDBFileName);
+		BaflUtils::CopyFile(iFsSession, dbFileName, copyName);
+#endif
+		
 		int rc = sqlite3_open((const char*) filename8.PtrZ(), &iDB);
 		if(rc != SQLITE_OK){
 			User::Leave(KErrCorrupt);