engine/src/PodcastModel.cpp
changeset 56 c5cd47bc11ef
parent 44 f6f9647922ba
child 67 9c24c921ec35
child 96 a8538f50e2ba
equal deleted inserted replaced
54:21ffe6559297 56:c5cd47bc11ef
   237 	}
   237 	}
   238 }
   238 }
   239 
   239 
   240 sqlite3* CPodcastModel::DB()
   240 sqlite3* CPodcastModel::DB()
   241 {
   241 {
       
   242 	DP("CPodcastModel::DB BEGIN");
   242 	if (iDB == NULL) {		
   243 	if (iDB == NULL) {		
   243 		TFileName dbFileName;
   244 		TFileName dbFileName;
   244 		iFsSession.PrivatePath(dbFileName);
   245 		iFsSession.PrivatePath(dbFileName);
   245 		dbFileName.Append(KDBFileName);
   246 		dbFileName.Append(KDBFileName);
   246 		DP1("DB is at %S", &dbFileName);
   247 		DP1("DB is at %S", &dbFileName);
   254 			iIsFirstStartup = ETrue;
   255 			iIsFirstStartup = ETrue;
   255 		}
   256 		}
   256 		
   257 		
   257 		TBuf8<KMaxFileName> filename8;
   258 		TBuf8<KMaxFileName> filename8;
   258 		filename8.Copy(dbFileName);
   259 		filename8.Copy(dbFileName);
   259 		int rc = rc = sqlite3_open((const char*) filename8.PtrZ(), &iDB);
   260 		DP("Before sqlite3_open");
       
   261 		int rc = sqlite3_open((const char*) filename8.PtrZ(), &iDB);
   260 		if( rc != SQLITE_OK){
   262 		if( rc != SQLITE_OK){
   261 			DP("Error loading DB");
   263 			DP("Error loading DB");
   262 			User::Panic(_L("Podcatcher"), 10);
   264 			User::Panic(_L("Podcatcher"), 10);
   263 		}
   265 		}
   264 
   266 
   265 
   267 
   266 	}
   268 	}
       
   269 	DP("CPodcastModel::DB END");
   267 	return iDB;
   270 	return iDB;
   268 }
   271 }
   269 
   272 
   270 void CPodcastModel::SetProxyUsageIfNeededL(RHTTPSession& aSession)
   273 void CPodcastModel::SetProxyUsageIfNeededL(RHTTPSession& aSession)
   271 	{
   274 	{