author | teknolog |
Sun, 04 Apr 2010 21:47:56 +0100 | |
changeset 82 | d87e984bd8b8 |
parent 79 | 0bd6b9a3f027 |
child 83 | a2e43aa1ad11 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include "ShowEngine.h" |
|
20 |
#include "FeedEngine.h" |
|
21 |
#include "FeedInfo.h" |
|
22 |
#include <bautils.h> |
|
23 |
#include <s32file.h> |
|
24 |
#include "SettingsEngine.h" |
|
25 |
#include <e32hashtab.h> |
|
26 |
#include <httperr.h> |
|
27 |
#include "debug.h" |
|
28 |
#include "PodcastUtils.h" |
|
29 |
||
30 |
//#include <mpxmedia.h> |
|
31 |
//#include <mpxattribute.h> |
|
32 |
//#include <mpxmediageneraldefs.h> |
|
33 |
||
34 |
const TUint KMaxDownloadErrors = 3; |
|
35 |
const TInt KMimeBufLength = 100; |
|
36 |
||
37 |
CShowEngine::CShowEngine(CPodcastModel& aPodcastModel) : |
|
38 |
iPodcastModel(aPodcastModel), |
|
39 |
iDB(*aPodcastModel.DB()) |
|
40 |
{ |
|
41 |
} |
|
42 |
||
43 |
EXPORT_C CShowEngine::~CShowEngine() |
|
44 |
{ |
|
45 |
delete iShowClient; |
|
46 |
iObservers.Close(); |
|
47 |
delete iShowDownloading; |
|
48 |
delete iMetaDataReader; |
|
49 |
iApaSession.Close(); |
|
50 |
} |
|
51 |
||
52 |
EXPORT_C CShowEngine* CShowEngine::NewL(CPodcastModel& aPodcastModel) |
|
53 |
{ |
|
54 |
CShowEngine* self = new (ELeave) CShowEngine(aPodcastModel); |
|
55 |
CleanupStack::PushL(self); |
|
56 |
self->ConstructL(); |
|
57 |
CleanupStack::Pop(self); |
|
58 |
return self; |
|
59 |
} |
|
60 |
||
61 |
EXPORT_C void CShowEngine::GetMimeType(const TDesC& aFileName, TDes& aMimeType) |
|
62 |
{ |
|
63 |
aMimeType.Zero(); |
|
64 |
RFile file; |
|
65 |
if (file.Open(iPodcastModel.FsSession(), aFileName, 0) == KErrNone) |
|
66 |
{ |
|
67 |
if (file.Read(iRecogBuffer) == KErrNone) |
|
68 |
{ |
|
69 |
TDataRecognitionResult result; |
|
70 |
if (iApaSession.RecognizeData(aFileName, iRecogBuffer, result) |
|
71 |
== KErrNone) |
|
72 |
{ |
|
73 |
aMimeType.Copy(result.iDataType.Des()); |
|
74 |
} |
|
75 |
||
76 |
} |
|
77 |
} |
|
78 |
file.Close(); |
|
79 |
} |
|
80 |
||
81 |
void CShowEngine::ConstructL() |
|
82 |
{ |
|
83 |
iShowClient = CHttpClient::NewL(iPodcastModel, *this); |
|
84 |
iShowClient->SetResumeEnabled(ETrue); |
|
85 |
iMetaDataReader = new (ELeave) CMetaDataReader(*this, iPodcastModel.FsSession()); |
|
86 |
iMetaDataReader->ConstructL(); |
|
87 |
User::LeaveIfError(iApaSession.Connect()); |
|
88 |
} |
|
89 |
||
90 |
EXPORT_C void CShowEngine::SuspendDownloads() |
|
91 |
{ |
|
92 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
93 |
iShowClient->Stop(); |
|
94 |
} |
|
95 |
||
96 |
EXPORT_C void CShowEngine::ResumeDownloadsL() |
|
97 |
{ |
|
98 |
DP("CShowEngine::ResumeDownloadsL BEGIN"); |
|
99 |
if (iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
100 |
{ |
|
101 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(EFalse); |
|
102 |
iDownloadErrors = 0; |
|
103 |
DownloadNextShowL(); |
|
104 |
} |
|
105 |
DP("CShowEngine::ResumeDownloadsL END"); |
|
106 |
} |
|
107 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
108 |
EXPORT_C void CShowEngine::RemoveAllDownloadsL() |
2 | 109 |
{ |
110 |
if (!iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
111 |
{ |
|
112 |
SuspendDownloads(); |
|
113 |
} |
|
114 |
||
78 | 115 |
DBRemoveAllDownloadsL(); |
22 | 116 |
NotifyDownloadQueueUpdatedL(); |
2 | 117 |
} |
118 |
||
78 | 119 |
EXPORT_C void CShowEngine::RemoveDownloadL(TUint aUid) |
2 | 120 |
{ |
78 | 121 |
DP("CShowEngine::RemoveDownloadL BEGIN"); |
2 | 122 |
|
123 |
TBool resumeAfterRemove = EFalse; |
|
124 |
// if trying to remove the present download, we first stop it |
|
125 |
if (!iPodcastModel.SettingsEngine().DownloadSuspended() && iShowDownloading != NULL |
|
126 |
&& iShowDownloading->Uid() == aUid) |
|
127 |
{ |
|
128 |
DP("CShowEngine::RemoveDownload\t This is the active download, we suspend downloading"); |
|
129 |
SuspendDownloads(); |
|
130 |
resumeAfterRemove = ETrue; |
|
131 |
} |
|
132 |
||
133 |
CShowInfo *info = DBGetShowByUidL(aUid); |
|
134 |
if (info != NULL) |
|
135 |
{ |
|
136 |
info->SetDownloadState(ENotDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
137 |
DBUpdateShowL(*info); |
2 | 138 |
delete info; |
139 |
} |
|
78 | 140 |
|
141 |
DBRemoveDownloadL(aUid); |
|
2 | 142 |
|
143 |
// partial downloads should be removed |
|
144 |
if (iShowDownloading) |
|
145 |
{ |
|
146 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), iShowDownloading->FileName()); |
|
147 |
} |
|
148 |
||
149 |
NotifyShowDownloadUpdatedL(-1, -1); |
|
150 |
NotifyDownloadQueueUpdatedL(); |
|
151 |
||
152 |
if (resumeAfterRemove) { |
|
153 |
ResumeDownloadsL(); |
|
154 |
} |
|
155 |
||
156 |
DownloadNextShowL(); |
|
78 | 157 |
DP("CShowEngine::RemoveDownloadL END"); |
2 | 158 |
} |
159 |
||
160 |
void CShowEngine::Connected(CHttpClient* /*aClient*/) |
|
161 |
{ |
|
162 |
||
163 |
} |
|
164 |
||
165 |
void CShowEngine::Progress(CHttpClient* /*aHttpClient */, TInt aBytes, |
|
166 |
TInt aTotalBytes) |
|
167 |
{ |
|
168 |
iShowDownloading->SetShowSize(aTotalBytes); |
|
169 |
TRAP_IGNORE(NotifyShowDownloadUpdatedL(aBytes, aTotalBytes)); |
|
170 |
} |
|
171 |
||
172 |
void CShowEngine::Disconnected(CHttpClient* /*aClient */) |
|
173 |
{ |
|
174 |
} |
|
175 |
||
176 |
void CShowEngine::DownloadInfo(CHttpClient* aHttpClient, TInt aTotalBytes) |
|
177 |
{ |
|
178 |
DP1("About to download %d bytes", aTotalBytes); |
|
179 |
if (aHttpClient == iShowClient && iShowDownloading != NULL |
|
180 |
&& aTotalBytes != -1) |
|
181 |
{ |
|
182 |
iShowDownloading->SetShowSize(aTotalBytes); |
|
183 |
} |
|
184 |
} |
|
185 |
||
78 | 186 |
void CShowEngine::GetShowL(CShowInfo *info) |
2 | 187 |
{ |
188 |
CFeedInfo *feedInfo = iPodcastModel.FeedEngine().GetFeedInfoByUid( |
|
189 |
info->FeedUid()); |
|
78 | 190 |
|
2 | 191 |
TFileName filePath; |
192 |
filePath.Copy(iPodcastModel.SettingsEngine().BaseDir()); |
|
193 |
||
194 |
TFileName relPath; |
|
195 |
relPath.Copy(feedInfo->Title()); |
|
196 |
relPath.Append('\\'); |
|
197 |
||
198 |
TFileName fileName; |
|
199 |
PodcastUtils::FileNameFromUrl(info->Url(), fileName); |
|
200 |
relPath.Append(fileName); |
|
201 |
PodcastUtils::EnsureProperPathName(relPath); |
|
202 |
||
203 |
// complete file path is base dir + rel path |
|
204 |
filePath.Append(relPath); |
|
205 |
info->SetFileNameL(filePath); |
|
206 |
||
78 | 207 |
User::LeaveIfError(iShowClient->GetL(info->Url(), filePath)); |
2 | 208 |
} |
209 |
||
78 | 210 |
EXPORT_C void CShowEngine::AddShowL(const CShowInfo& aItem) |
2 | 211 |
{ |
212 |
DP1("CShowEngine::AddShowL, title=%S", &aItem.Title()); |
|
213 |
CShowInfo *showInfo = DBGetShowByUidL(aItem.Uid()); |
|
214 |
||
215 |
if (showInfo == NULL) |
|
216 |
{ |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
217 |
DBAddShowL(aItem); |
2 | 218 |
} |
219 |
else |
|
220 |
{ |
|
221 |
delete showInfo; |
|
78 | 222 |
User::Leave(KErrAlreadyExists); |
2 | 223 |
} |
224 |
} |
|
225 |
||
226 |
EXPORT_C void CShowEngine::AddObserver(MShowEngineObserver *observer) |
|
227 |
{ |
|
228 |
iObservers.Append(observer); |
|
229 |
} |
|
230 |
||
231 |
EXPORT_C void CShowEngine::RemoveObserver(MShowEngineObserver *observer) |
|
232 |
{ |
|
233 |
TInt index = iObservers.Find(observer); |
|
234 |
||
235 |
if (index > KErrNotFound) |
|
236 |
{ |
|
237 |
iObservers.Remove(index); |
|
238 |
} |
|
239 |
} |
|
240 |
||
241 |
void CShowEngine::AddShowToMpxCollection(CShowInfo &/*aShowInfo*/) |
|
242 |
{ |
|
243 |
/* RArray<TInt> contentIDs; |
|
244 |
contentIDs.AppendL( KMPXMediaIdGeneral ); |
|
245 |
||
246 |
CMPXMedia* media = CMPXMedia::NewL( contentIDs.Array() ); |
|
247 |
CleanupStack::PushL( media ); |
|
248 |
contentIDs.Close(); |
|
249 |
CleanupStack::PopAndDestroy(media); */ |
|
250 |
} |
|
251 |
||
252 |
void CShowEngine::CompleteL(CHttpClient* /*aHttpClient*/, TInt aError) |
|
253 |
{ |
|
254 |
if (iShowDownloading != NULL) |
|
255 |
{ |
|
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
256 |
DP2("CShowEngine::CompleteL file=%S, aError=%d", &iShowDownloading->FileName(), aError); |
2 | 257 |
if(aError != KErrCouldNotConnect) |
258 |
{ |
|
6 | 259 |
if(aError == KErrDisconnected && iPodcastModel.SettingsEngine().DownloadSuspended()) |
260 |
{ |
|
2 | 261 |
// no error if disconnect happened because of suspended downloading |
6 | 262 |
} |
263 |
else |
|
264 |
{ |
|
2 | 265 |
iShowDownloading->SetLastError(aError); |
6 | 266 |
} |
2 | 267 |
|
268 |
if (aError == KErrNone) |
|
269 |
{ |
|
270 |
TBuf<KMimeBufLength> mimeType; |
|
271 |
GetMimeType(iShowDownloading->FileName(), mimeType); |
|
272 |
_LIT(KMimeAudio,"audio"); |
|
273 |
_LIT(KMimeVideo,"video"); |
|
274 |
if (mimeType.Left(5) == KMimeAudio) |
|
275 |
{ |
|
276 |
iShowDownloading->SetShowType(EAudioPodcast); |
|
277 |
} |
|
278 |
else if (mimeType.Left(5) == KMimeVideo) |
|
279 |
{ |
|
280 |
iShowDownloading->SetShowType(EVideoPodcast); |
|
281 |
} |
|
282 |
||
283 |
iShowDownloading->SetDownloadState(EDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
284 |
DBUpdateShowL(*iShowDownloading); |
78 | 285 |
DBRemoveDownloadL(iShowDownloading->Uid()); |
2 | 286 |
AddShowToMpxCollection(*iShowDownloading); |
287 |
NotifyShowFinishedL(aError); |
|
15
93d9f66bf50b
Cleaning description better for second line in search results
teknolog
parents:
6
diff
changeset
|
288 |
iDownloadErrors = 0; |
2 | 289 |
delete iShowDownloading; |
290 |
iShowDownloading = NULL; |
|
291 |
} |
|
292 |
else |
|
293 |
{ |
|
294 |
// 400 and 500 series errors are serious errors on which probably another download will fail |
|
295 |
if(aError >= HTTPStatus::EBadRequest && aError <= HTTPStatus::EBadRequest+200) |
|
296 |
{ |
|
297 |
iShowDownloading->SetDownloadState(EFailedDownload); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
298 |
DBUpdateShowL(*iShowDownloading); |
78 | 299 |
DBRemoveDownloadL(iShowDownloading->Uid()); |
2 | 300 |
NotifyShowFinishedL(aError); |
301 |
||
302 |
delete iShowDownloading; |
|
303 |
iShowDownloading = NULL; |
|
304 |
} |
|
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
305 |
else if (aError == KErrDiskFull) |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
306 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
307 |
// stop downloading immediately if disk is full |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
308 |
iShowDownloading->SetDownloadState(EQueued); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
309 |
DBUpdateShowL(*iShowDownloading); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
310 |
iDownloadErrors = KMaxDownloadErrors; |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
311 |
} |
2 | 312 |
else // other kind of error, missing network etc, reque this show |
313 |
{ |
|
314 |
iShowDownloading->SetDownloadState(EQueued); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
315 |
DBUpdateShowL(*iShowDownloading); |
2 | 316 |
} |
317 |
||
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
318 |
NotifyDownloadQueueUpdatedL(); |
2 | 319 |
iDownloadErrors++; |
320 |
if (iDownloadErrors > KMaxDownloadErrors) |
|
321 |
{ |
|
322 |
DP("Too many downloading errors, suspending downloads"); |
|
323 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
324 |
NotifyShowFinishedL(aError); |
|
325 |
} |
|
326 |
} |
|
327 |
DownloadNextShowL(); |
|
328 |
} |
|
329 |
||
330 |
else |
|
331 |
{ |
|
332 |
// Connection error |
|
333 |
if(iShowDownloading) |
|
334 |
{ |
|
335 |
iShowDownloading->SetDownloadState(EQueued); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
336 |
DBUpdateShowL(*iShowDownloading); |
2 | 337 |
} |
338 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
339 |
NotifyShowFinishedL(aError); |
|
340 |
} |
|
341 |
} |
|
342 |
} |
|
343 |
||
344 |
EXPORT_C CShowInfo* CShowEngine::ShowDownloading() |
|
345 |
{ |
|
346 |
return iShowDownloading; |
|
347 |
} |
|
348 |
||
349 |
EXPORT_C CShowInfo* CShowEngine::GetShowByUidL(TUint aShowUid) |
|
350 |
{ |
|
351 |
return DBGetShowByUidL(aShowUid); |
|
352 |
} |
|
353 |
CShowInfo* CShowEngine::DBGetShowByUidL(TUint aUid) |
|
354 |
{ |
|
355 |
DP("CShowEngine::DBGetShowByUid"); |
|
356 |
CShowInfo *showInfo = NULL; |
|
357 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows where uid=%u"); |
|
358 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
359 |
||
360 |
sqlite3_stmt *st; |
|
361 |
||
362 |
//DP1("SQL: %S", &iSqlBuffer.Left(KSqlDPLen)); |
|
363 |
||
364 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
365 |
&st, (const void**) NULL); |
|
366 |
||
367 |
if (rc == SQLITE_OK) |
|
368 |
{ |
|
369 |
rc = sqlite3_step(st); |
|
370 |
Cleanup_sqlite3_finalize_PushL(st); |
|
371 |
if (rc == SQLITE_ROW) |
|
372 |
{ |
|
373 |
showInfo = CShowInfo::NewLC(); |
|
374 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
375 |
CleanupStack::Pop(showInfo); |
|
376 |
} |
|
377 |
CleanupStack::PopAndDestroy();//st |
|
378 |
} |
|
379 |
||
380 |
return showInfo; |
|
381 |
} |
|
382 |
||
383 |
EXPORT_C CShowInfo* CShowEngine::DBGetShowByFileNameL(TFileName aFileName) |
|
384 |
{ |
|
385 |
DP("CShowEngine::DBGetShowByUid"); |
|
386 |
CShowInfo *showInfo = NULL; |
|
387 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows where filename=\"%S\""); |
|
388 |
iSqlBuffer.Format(KSqlStatement, &aFileName); |
|
389 |
||
390 |
sqlite3_stmt *st; |
|
391 |
||
392 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
393 |
&st, (const void**) NULL); |
|
394 |
||
395 |
if (rc == SQLITE_OK) |
|
396 |
{ |
|
397 |
rc = sqlite3_step(st); |
|
398 |
Cleanup_sqlite3_finalize_PushL(st); |
|
399 |
if (rc == SQLITE_ROW) |
|
400 |
{ |
|
401 |
showInfo = CShowInfo::NewLC(); |
|
402 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
403 |
CleanupStack::Pop(showInfo); |
|
404 |
} |
|
405 |
CleanupStack::PopAndDestroy();//st |
|
406 |
} |
|
407 |
||
408 |
return showInfo; |
|
409 |
} |
|
410 |
||
411 |
void CShowEngine::DBGetAllShowsL(RShowInfoArray& aShowArray) |
|
412 |
{ |
|
413 |
DP("CShowEngine::DBGetAllShows"); |
|
414 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows"); |
|
415 |
iSqlBuffer.Format(KSqlStatement); |
|
416 |
||
417 |
sqlite3_stmt *st; |
|
418 |
||
419 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
420 |
&st, (const void**) NULL); |
|
421 |
||
422 |
if (rc == SQLITE_OK) |
|
423 |
{ |
|
424 |
rc = sqlite3_step(st); |
|
425 |
Cleanup_sqlite3_finalize_PushL(st); |
|
426 |
while (rc == SQLITE_ROW) |
|
427 |
{ |
|
428 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
429 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
430 |
aShowArray.Append(showInfo); |
|
431 |
CleanupStack::Pop(showInfo); |
|
432 |
rc = sqlite3_step(st); |
|
433 |
} |
|
434 |
CleanupStack::PopAndDestroy();//st |
|
435 |
} |
|
436 |
||
437 |
} |
|
438 |
||
439 |
void CShowEngine::DBGetAllDownloadsL(RShowInfoArray& aShowArray) |
|
440 |
{ |
|
441 |
DP("CShowEngine::DBGetAllDownloads"); |
|
442 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, shows.uid, showsize, trackno, pubdate, showtype, lasterror from downloads, shows where downloads.uid=shows.uid"); |
|
443 |
iSqlBuffer.Format(KSqlStatement); |
|
444 |
||
445 |
#ifndef DONT_SORT_SQL |
|
446 |
_LIT(KSqlSort, " order by dl_index"); |
|
447 |
iSqlBuffer.Append(KSqlSort); |
|
448 |
#endif |
|
449 |
sqlite3_stmt *st; |
|
450 |
||
451 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
452 |
&st, (const void**) NULL); |
|
453 |
||
454 |
if (rc == SQLITE_OK) |
|
455 |
{ |
|
456 |
rc = sqlite3_step(st); |
|
457 |
Cleanup_sqlite3_finalize_PushL(st); |
|
458 |
while (rc == SQLITE_ROW) |
|
459 |
{ |
|
460 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
461 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
462 |
aShowArray.Append(showInfo); |
|
463 |
CleanupStack::Pop(showInfo); |
|
464 |
rc = sqlite3_step(st); |
|
465 |
} |
|
466 |
CleanupStack::PopAndDestroy();//st |
|
467 |
} |
|
78 | 468 |
else |
469 |
{ |
|
470 |
User::Leave(KErrCorrupt); |
|
471 |
} |
|
2 | 472 |
|
473 |
// delete downloads that don't have a show |
|
474 |
||
475 |
_LIT(KSqlStatement2, "delete from downloads where uid not in (select downloads.uid from shows, downloads where shows.uid=downloads.uid)"); |
|
476 |
iSqlBuffer.Format(KSqlStatement2); |
|
477 |
||
478 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, &st, (const void**) NULL); |
|
479 |
||
480 |
if (rc == SQLITE_OK) |
|
481 |
{ |
|
78 | 482 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 483 |
rc = sqlite3_step(st); |
78 | 484 |
CleanupStack::PopAndDestroy(); // st |
485 |
} |
|
486 |
else |
|
487 |
{ |
|
488 |
User::Leave(KErrCorrupt); |
|
2 | 489 |
} |
490 |
} |
|
491 |
||
492 |
CShowInfo* CShowEngine::DBGetNextDownloadL() |
|
493 |
{ |
|
494 |
DP("CShowEngine::DBGetNextDownload"); |
|
495 |
CShowInfo *showInfo = NULL; |
|
496 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, shows.uid, showsize, trackno, pubdate, showtype, lasterror from downloads, shows where downloads.uid=shows.uid"); |
|
497 |
iSqlBuffer.Format(KSqlStatement); |
|
498 |
||
499 |
#ifdef DONT_SORT_SQL |
|
500 |
_LIT(KSqlSort, " limit 1"); |
|
501 |
iSqlBuffer.Append(KSqlSort); |
|
502 |
#else |
|
503 |
_LIT(KSqlNoSort, " order by dl_index limit 1"); |
|
504 |
iSqlBuffer.Append(KSqlNoSort); |
|
505 |
#endif |
|
506 |
||
507 |
sqlite3_stmt *st; |
|
508 |
||
509 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
510 |
&st, (const void**) NULL); |
|
511 |
||
512 |
if (rc == SQLITE_OK) |
|
513 |
{ |
|
514 |
rc = sqlite3_step(st); |
|
515 |
Cleanup_sqlite3_finalize_PushL(st); |
|
516 |
if (rc == SQLITE_ROW) |
|
517 |
{ |
|
518 |
showInfo = CShowInfo::NewLC(); |
|
519 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
520 |
CleanupStack::Pop(showInfo); |
|
521 |
} |
|
78 | 522 |
else |
523 |
{ |
|
524 |
User::Leave(KErrUnknown); |
|
525 |
} |
|
2 | 526 |
CleanupStack::PopAndDestroy();//st |
527 |
} |
|
78 | 528 |
else |
529 |
{ |
|
530 |
User::Leave(KErrCorrupt); |
|
531 |
} |
|
2 | 532 |
|
533 |
return showInfo; |
|
534 |
} |
|
535 |
||
536 |
void CShowEngine::DBGetShowsByFeedL(RShowInfoArray& aShowArray, TUint aFeedUid) |
|
537 |
{ |
|
538 |
DP1("CShowEngine::DBGetShowsByFeed BEGIN, feedUid=%u", aFeedUid); |
|
539 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where feeduid=%u"); |
|
540 |
iSqlBuffer.Format(KSqlStatement, aFeedUid); |
|
541 |
||
542 |
#ifndef DONT_SORT_SQL |
|
543 |
_LIT(KSqlOrderByDate, " order by pubdate desc"); |
|
544 |
iSqlBuffer.Append(KSqlOrderByDate); |
|
545 |
#endif |
|
546 |
||
547 |
sqlite3_stmt *st; |
|
548 |
||
549 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
550 |
&st, (const void**) NULL); |
|
551 |
||
552 |
if (rc == SQLITE_OK) |
|
553 |
{ |
|
554 |
rc = sqlite3_step(st); |
|
555 |
Cleanup_sqlite3_finalize_PushL(st); |
|
556 |
while (rc == SQLITE_ROW) |
|
557 |
{ |
|
558 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
559 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
560 |
aShowArray.Append(showInfo); |
|
561 |
CleanupStack::Pop(showInfo); |
|
562 |
rc = sqlite3_step(st); |
|
563 |
} |
|
564 |
CleanupStack::PopAndDestroy();//st |
|
565 |
} |
|
78 | 566 |
else |
567 |
{ |
|
568 |
User::Leave(KErrCorrupt); |
|
569 |
} |
|
2 | 570 |
DP("CShowEngine::DBGetShowsByFeed END"); |
571 |
} |
|
572 |
||
78 | 573 |
TUint CShowEngine::DBGetDownloadsCountL() |
2 | 574 |
{ |
575 |
DP("CShowEngine::DBGetDownloadsCount"); |
|
576 |
||
577 |
_LIT(KSqlStatement, "select count(*) from downloads"); |
|
578 |
iSqlBuffer.Format(KSqlStatement); |
|
579 |
||
580 |
sqlite3_stmt *st; |
|
581 |
TUint count = 0; |
|
582 |
||
583 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
584 |
&st, (const void**) NULL); |
|
585 |
||
586 |
if (rc == SQLITE_OK) |
|
587 |
{ |
|
78 | 588 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 589 |
rc = sqlite3_step(st); |
590 |
||
591 |
if (rc == SQLITE_ROW) |
|
592 |
{ |
|
593 |
count = sqlite3_column_int(st, 0); |
|
594 |
} |
|
78 | 595 |
else |
596 |
{ |
|
597 |
User::Leave(KErrUnknown); |
|
598 |
} |
|
599 |
||
600 |
CleanupStack::PopAndDestroy(); //st |
|
601 |
} |
|
602 |
else |
|
603 |
{ |
|
604 |
User::Leave(KErrCorrupt); |
|
2 | 605 |
} |
606 |
return count; |
|
607 |
} |
|
608 |
||
609 |
void CShowEngine::DBGetDownloadedShowsL(RShowInfoArray& aShowArray) |
|
610 |
{ |
|
611 |
DP("CShowEngine::DBGetDownloadedShows"); |
|
612 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where downloadstate=%u"); |
|
613 |
iSqlBuffer.Format(KSqlStatement, EDownloaded); |
|
614 |
||
615 |
#ifndef DONT_SORT_SQL |
|
616 |
_LIT(KSqlSort, " order by title"); |
|
617 |
iSqlBuffer.Append(KSqlSort); |
|
618 |
#endif |
|
619 |
||
620 |
sqlite3_stmt *st; |
|
621 |
||
622 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
623 |
&st, (const void**) NULL); |
|
624 |
||
625 |
if (rc == SQLITE_OK) |
|
626 |
{ |
|
627 |
rc = sqlite3_step(st); |
|
628 |
Cleanup_sqlite3_finalize_PushL(st); |
|
629 |
while (rc == SQLITE_ROW) |
|
630 |
{ |
|
631 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
632 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
633 |
aShowArray.Append(showInfo); |
|
634 |
CleanupStack::Pop(showInfo); |
|
635 |
rc = sqlite3_step(st); |
|
636 |
} |
|
637 |
CleanupStack::PopAndDestroy();//st |
|
638 |
} |
|
78 | 639 |
else |
640 |
{ |
|
641 |
User::Leave(KErrCorrupt); |
|
642 |
} |
|
2 | 643 |
} |
644 |
||
645 |
void CShowEngine::DBGetNewShowsL(RShowInfoArray& aShowArray) |
|
646 |
{ |
|
647 |
DP("CShowEngine::DBGetNewShows"); |
|
648 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where playstate=%u"); |
|
649 |
iSqlBuffer.Format(KSqlStatement, ENeverPlayed); |
|
650 |
||
651 |
sqlite3_stmt *st; |
|
652 |
||
653 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
654 |
&st, (const void**) NULL); |
|
655 |
||
656 |
if (rc == SQLITE_OK) |
|
657 |
{ |
|
658 |
rc = sqlite3_step(st); |
|
659 |
Cleanup_sqlite3_finalize_PushL(st); |
|
660 |
while (rc == SQLITE_ROW) |
|
661 |
{ |
|
662 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
663 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
664 |
aShowArray.Append(showInfo); |
|
665 |
CleanupStack::Pop(showInfo); |
|
666 |
rc = sqlite3_step(st); |
|
667 |
} |
|
668 |
CleanupStack::PopAndDestroy();//st |
|
669 |
} |
|
78 | 670 |
else |
671 |
{ |
|
672 |
User::Leave(KErrCorrupt); |
|
673 |
} |
|
2 | 674 |
} |
675 |
||
78 | 676 |
void CShowEngine::DBDeleteOldShowsByFeedL(TUint aFeedUid) |
2 | 677 |
{ |
678 |
DP("CShowEngine::DBDeleteOldShows"); |
|
679 |
||
680 |
// what we do: |
|
681 |
// 1. sort shows by pubdate |
|
682 |
// 2. select the first MaxListItems shows |
|
683 |
// 3. delete the rest if downloadstate is ENotDownloaded |
|
684 |
||
685 |
_LIT(KSqlStatement,"delete from shows where feeduid=%u and downloadstate=0 and uid not in " \ |
|
686 |
"(select uid from shows where feeduid=%u order by pubdate desc limit %u)"); |
|
687 |
iSqlBuffer.Format(KSqlStatement, aFeedUid, aFeedUid, iPodcastModel.SettingsEngine().MaxListItems()); |
|
688 |
||
689 |
sqlite3_stmt *st; |
|
690 |
||
691 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
692 |
&st, (const void**) NULL); |
|
693 |
||
694 |
if (rc == SQLITE_OK) |
|
695 |
{ |
|
696 |
rc = sqlite3_step(st); |
|
697 |
sqlite3_finalize(st); |
|
698 |
} |
|
78 | 699 |
else |
700 |
{ |
|
701 |
User::Leave(KErrCorrupt); |
|
702 |
} |
|
2 | 703 |
|
704 |
_LIT(KSqlStatement2, "delete from downloads where uid not in (select downloads.uid from shows, downloads where shows.uid=downloads.uid)"); |
|
705 |
iSqlBuffer.Format(KSqlStatement2); |
|
706 |
||
707 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, &st, (const void**) NULL); |
|
708 |
||
709 |
if (rc == SQLITE_OK) |
|
710 |
{ |
|
711 |
rc = sqlite3_step(st); |
|
712 |
sqlite3_finalize(st); |
|
713 |
} |
|
78 | 714 |
else |
715 |
{ |
|
716 |
User::Leave(KErrCorrupt); |
|
717 |
} |
|
2 | 718 |
} |
719 |
||
720 |
void CShowEngine::DBFillShowInfoFromStmtL(sqlite3_stmt *st, CShowInfo* showInfo) |
|
721 |
{ |
|
722 |
const void *urlz = sqlite3_column_text16(st, 0); |
|
723 |
TPtrC16 url((const TUint16*) urlz); |
|
724 |
showInfo->SetUrlL(url); |
|
725 |
||
726 |
const void *titlez = sqlite3_column_text16(st, 1); |
|
727 |
TPtrC16 title((const TUint16*) titlez); |
|
728 |
showInfo->SetTitleL(title); |
|
729 |
||
730 |
const void *descz = sqlite3_column_text16(st, 2); |
|
731 |
TPtrC16 desc((const TUint16*) descz); |
|
732 |
showInfo->SetDescriptionL(desc); |
|
733 |
||
734 |
const void *filez = sqlite3_column_text16(st, 3); |
|
735 |
TPtrC16 file((const TUint16*) filez); |
|
736 |
showInfo->SetFileNameL(file); |
|
737 |
||
738 |
sqlite3_int64 pos = sqlite3_column_int64(st, 4); |
|
739 |
TTimeIntervalMicroSeconds position(pos); |
|
740 |
showInfo->SetPosition(position); |
|
741 |
||
742 |
TUint playtime = sqlite3_column_int(st, 5); |
|
743 |
showInfo->SetPlayTime(playtime); |
|
744 |
||
745 |
TUint playstate = sqlite3_column_int(st, 6); |
|
746 |
showInfo->SetPlayState((TPlayState) playstate); |
|
747 |
||
748 |
TUint downloadstate = sqlite3_column_int(st, 7); |
|
749 |
showInfo->SetDownloadState((TDownloadState) downloadstate); |
|
750 |
||
751 |
TUint feeduid = sqlite3_column_int(st, 8); |
|
752 |
showInfo->SetFeedUid(feeduid); |
|
753 |
||
754 |
TUint uid = sqlite3_column_int(st, 9); |
|
755 |
showInfo->SetUid(uid); |
|
756 |
||
757 |
TUint showsize = sqlite3_column_int(st, 10); |
|
758 |
showInfo->SetShowSize(showsize); |
|
759 |
||
760 |
TUint trackno = sqlite3_column_int(st, 11); |
|
761 |
showInfo->SetTrackNo((TShowType) trackno); |
|
762 |
||
763 |
sqlite3_int64 pubdate = sqlite3_column_int64(st, 12); |
|
764 |
TTime timepubdate(pubdate); |
|
765 |
showInfo->SetPubDate(timepubdate); |
|
766 |
||
767 |
TUint showtype = sqlite3_column_int(st, 13); |
|
768 |
showInfo->SetShowType((TShowType) showtype); |
|
769 |
||
770 |
TInt lasterror = sqlite3_column_int(st, 14); |
|
771 |
showInfo->SetLastError(lasterror); |
|
772 |
} |
|
773 |
||
78 | 774 |
void CShowEngine::DBAddShowL(const CShowInfo& aItem) |
2 | 775 |
{ |
776 |
DP2("CShowEngine::DBAddShow, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
|
777 |
||
21 | 778 |
HBufC* titleBuf = HBufC::NewLC(KMaxLineLength); |
779 |
TPtr titlePtr(titleBuf->Des()); |
|
780 |
titlePtr.Copy(aItem.Title()); |
|
781 |
PodcastUtils::SQLEncode(titlePtr); |
|
782 |
||
783 |
HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
|
784 |
TPtr descPtr(descBuf->Des()); |
|
785 |
descPtr.Copy(aItem.Description()); |
|
786 |
PodcastUtils::SQLEncode(descPtr); |
|
787 |
||
2 | 788 |
_LIT(KSqlStatement, "insert into shows (url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype)" |
789 |
" values (\"%S\",\"%S\", \"%S\", \"%S\", \"%Lu\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%Lu\", \"%d\")"); |
|
21 | 790 |
|
791 |
iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
|
2 | 792 |
&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
793 |
aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
|
794 |
aItem.Uid(), aItem.ShowSize(), aItem.TrackNo(), |
|
795 |
aItem.PubDate().Int64(), aItem.ShowType()); |
|
796 |
||
21 | 797 |
CleanupStack::PopAndDestroy(descBuf); |
798 |
CleanupStack::PopAndDestroy(titleBuf); |
|
799 |
||
2 | 800 |
sqlite3_stmt *st; |
801 |
||
802 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
803 |
&st, (const void**) NULL); |
|
78 | 804 |
|
2 | 805 |
if (rc == SQLITE_OK) |
806 |
{ |
|
78 | 807 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 808 |
rc = sqlite3_step(st); |
78 | 809 |
if (rc != SQLITE_DONE) |
2 | 810 |
{ |
78 | 811 |
User::Leave(KErrAlreadyExists); |
2 | 812 |
} |
78 | 813 |
CleanupStack::PopAndDestroy(); // st |
2 | 814 |
} |
815 |
else |
|
816 |
{ |
|
78 | 817 |
User::Leave(KErrCorrupt); |
2 | 818 |
} |
819 |
} |
|
820 |
||
78 | 821 |
void CShowEngine::DBAddDownloadL(TUint aUid) |
2 | 822 |
{ |
823 |
DP1("CShowEngine::DBAddDownload, aUid=%u", aUid); |
|
824 |
||
825 |
_LIT(KSqlStatement, "insert into downloads (uid) values (%u)"); |
|
826 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
827 |
sqlite3_stmt *st; |
|
828 |
||
829 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
830 |
&st, (const void**) NULL); |
|
831 |
||
832 |
if (rc == SQLITE_OK) |
|
833 |
{ |
|
78 | 834 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 835 |
rc = sqlite3_step(st); |
78 | 836 |
if (rc =! SQLITE_DONE) |
837 |
{ |
|
838 |
User::Leave(KErrUnknown); |
|
839 |
} |
|
840 |
CleanupStack::PopAndDestroy(); // st |
|
2 | 841 |
} |
78 | 842 |
else |
843 |
{ |
|
844 |
User::Leave(KErrCorrupt); |
|
845 |
} |
|
2 | 846 |
} |
847 |
||
78 | 848 |
void CShowEngine::DBUpdateShowL(CShowInfo& aItem) |
2 | 849 |
{ |
850 |
DP1("CShowEngine::DBUpdateShow, title='%S'", &aItem.Title()); |
|
851 |
||
30
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
852 |
HBufC* titleBuf = HBufC::NewLC(KMaxLineLength); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
853 |
TPtr titlePtr(titleBuf->Des()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
854 |
titlePtr.Copy(aItem.Title()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
855 |
PodcastUtils::SQLEncode(titlePtr); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
856 |
|
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
857 |
HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
858 |
TPtr descPtr(descBuf->Des()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
859 |
descPtr.Copy(aItem.Description()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
860 |
PodcastUtils::SQLEncode(descPtr); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
861 |
|
2 | 862 |
_LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\"," |
863 |
"playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\"," |
|
864 |
"pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\" where uid=\"%u\""); |
|
30
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
865 |
iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
2 | 866 |
&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
867 |
aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
|
868 |
aItem.ShowSize(), aItem.TrackNo(), aItem.PubDate().Int64(), |
|
869 |
aItem.ShowType(), aItem.LastError(), aItem.Uid()); |
|
870 |
||
30
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
871 |
CleanupStack::PopAndDestroy(descBuf); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
872 |
CleanupStack::PopAndDestroy(titleBuf); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
873 |
|
2 | 874 |
sqlite3_stmt *st; |
875 |
||
876 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
877 |
&st, (const void**) NULL); |
|
878 |
||
879 |
if (rc == SQLITE_OK) |
|
880 |
{ |
|
78 | 881 |
Cleanup_sqlite3_finalize_PushL(st); |
882 |
rc = sqlite3_step(st); |
|
2 | 883 |
|
78 | 884 |
if (rc =! SQLITE_DONE) |
2 | 885 |
{ |
78 | 886 |
User::Leave(KErrUnknown); |
2 | 887 |
} |
78 | 888 |
CleanupStack::PopAndDestroy(); // st |
2 | 889 |
} |
890 |
else |
|
891 |
{ |
|
78 | 892 |
User::Leave(KErrCorrupt); |
2 | 893 |
} |
894 |
} |
|
895 |
||
78 | 896 |
void CShowEngine::DBDeleteShowL(TUint aUid) |
2 | 897 |
{ |
898 |
DP("CShowEngine::DBDeleteShow"); |
|
899 |
||
900 |
_LIT(KSqlStatement, "delete from shows where uid=%u"); |
|
901 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
902 |
||
903 |
sqlite3_stmt *st; |
|
904 |
||
905 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
906 |
&st, (const void**) NULL); |
|
907 |
||
908 |
if (rc == SQLITE_OK) |
|
909 |
{ |
|
78 | 910 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 911 |
rc = sqlite3_step(st); |
912 |
||
78 | 913 |
if (rc =! SQLITE_DONE) |
2 | 914 |
{ |
78 | 915 |
User::Leave(KErrUnknown); |
2 | 916 |
} |
78 | 917 |
CleanupStack::PopAndDestroy(); // st |
2 | 918 |
} |
919 |
else |
|
920 |
{ |
|
78 | 921 |
User::Leave(KErrCorrupt); |
2 | 922 |
} |
923 |
} |
|
924 |
||
78 | 925 |
void CShowEngine::DBDeleteAllShowsByFeedL(TUint aFeedUid) |
2 | 926 |
{ |
927 |
DP("CShowEngine::DBDeleteAllShowsByFeed"); |
|
928 |
||
929 |
_LIT(KSqlStatement, "delete from shows where feeduid=%u"); |
|
930 |
iSqlBuffer.Format(KSqlStatement, aFeedUid); |
|
931 |
||
932 |
sqlite3_stmt *st; |
|
933 |
||
934 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
935 |
&st, (const void**) NULL); |
|
936 |
||
937 |
if (rc == SQLITE_OK) |
|
938 |
{ |
|
78 | 939 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 940 |
rc = sqlite3_step(st); |
941 |
||
78 | 942 |
if (rc =! SQLITE_DONE) |
2 | 943 |
{ |
78 | 944 |
User::Leave(KErrUnknown); |
2 | 945 |
} |
78 | 946 |
CleanupStack::PopAndDestroy(); // st |
2 | 947 |
} |
948 |
else |
|
949 |
{ |
|
78 | 950 |
User::Leave(KErrCorrupt); |
2 | 951 |
} |
952 |
} |
|
953 |
||
78 | 954 |
void CShowEngine::DBRemoveAllDownloadsL() |
2 | 955 |
{ |
956 |
DP("CShowEngine::DBRemoveAllDownloads"); |
|
957 |
||
958 |
_LIT(KSqlStatement, "delete from downloads"); |
|
959 |
iSqlBuffer.Format(KSqlStatement); |
|
960 |
||
961 |
sqlite3_stmt *st; |
|
962 |
||
963 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
964 |
&st, (const void**) NULL); |
|
965 |
||
966 |
if (rc == SQLITE_OK) |
|
967 |
{ |
|
968 |
rc = sqlite3_step(st); |
|
969 |
sqlite3_finalize(st); |
|
970 |
} |
|
78 | 971 |
else |
972 |
{ |
|
973 |
User::Leave(KErrCorrupt); |
|
974 |
} |
|
2 | 975 |
|
976 |
_LIT(KSqlStatement2, "update shows set downloadstate=0 where downloadstate=1"); |
|
977 |
iSqlBuffer.Format(KSqlStatement2); |
|
978 |
||
979 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, &st, |
|
980 |
(const void**) NULL); |
|
981 |
||
982 |
if (rc == SQLITE_OK) |
|
983 |
{ |
|
78 | 984 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 985 |
rc = sqlite3_step(st); |
78 | 986 |
if (rc =! SQLITE_DONE) |
987 |
{ |
|
988 |
User::Leave(KErrUnknown); |
|
989 |
} |
|
990 |
CleanupStack::PopAndDestroy(); // st |
|
991 |
} |
|
992 |
else |
|
993 |
{ |
|
994 |
User::Leave(KErrCorrupt); |
|
2 | 995 |
} |
996 |
||
997 |
} |
|
998 |
||
78 | 999 |
void CShowEngine::DBRemoveDownloadL(TUint aUid) |
2 | 1000 |
{ |
1001 |
DP("CShowEngine::DBRemoveDownload"); |
|
1002 |
||
1003 |
_LIT(KSqlStatement, "delete from downloads where uid=%u"); |
|
1004 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
1005 |
||
1006 |
sqlite3_stmt *st; |
|
1007 |
||
1008 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1009 |
&st, (const void**) NULL); |
|
1010 |
||
1011 |
if (rc == SQLITE_OK) |
|
1012 |
{ |
|
78 | 1013 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 1014 |
rc = sqlite3_step(st); |
78 | 1015 |
if (rc =! SQLITE_DONE) |
1016 |
{ |
|
1017 |
User::Leave(KErrUnknown); |
|
1018 |
} |
|
1019 |
CleanupStack::PopAndDestroy(); // st |
|
1020 |
} |
|
1021 |
else |
|
1022 |
{ |
|
1023 |
User::Leave(KErrCorrupt); |
|
2 | 1024 |
} |
1025 |
} |
|
1026 |
||
1027 |
EXPORT_C CShowInfo* CShowEngine::GetNextShowByTrackL(CShowInfo* aShowInfo) |
|
1028 |
{ |
|
1029 |
CShowInfo* nextShow = NULL; |
|
1030 |
RShowInfoArray array; |
|
1031 |
DBGetShowsByFeedL(array, aShowInfo->FeedUid()); |
|
1032 |
TUint diff = KMaxTInt; |
|
1033 |
for (TInt loop = 0; loop < array.Count(); loop++) |
|
1034 |
{ |
|
1035 |
if (aShowInfo->TrackNo() < array[loop]->TrackNo()) |
|
1036 |
{ |
|
1037 |
if ((array[loop]->TrackNo() - aShowInfo->TrackNo()) < diff) |
|
1038 |
{ |
|
1039 |
diff = array[loop]->TrackNo() - aShowInfo->TrackNo(); |
|
1040 |
nextShow = array[loop]; |
|
1041 |
} |
|
1042 |
} |
|
1043 |
} |
|
1044 |
array.ResetAndDestroy(); |
|
1045 |
return nextShow; |
|
1046 |
} |
|
1047 |
||
1048 |
TBool CShowEngine::CompareShowsByUid(const CShowInfo &a, const CShowInfo &b) |
|
1049 |
{ |
|
1050 |
return a.Uid() == b.Uid(); |
|
1051 |
} |
|
1052 |
||
1053 |
TInt CShowEngine::CompareShowsByDate(const CShowInfo &a, const CShowInfo &b) |
|
1054 |
{ |
|
1055 |
if (a.PubDate() > b.PubDate()) |
|
1056 |
{ |
|
1057 |
// DP2("Sorting %S less than %S", &a.iTitle, &b.iTitle); |
|
1058 |
return -1; |
|
1059 |
} |
|
1060 |
else if (a.PubDate() == b.PubDate()) |
|
1061 |
{ |
|
1062 |
// DP2("Sorting %S equal to %S", &a.iTitle, &b.iTitle); |
|
1063 |
return 0; |
|
1064 |
} |
|
1065 |
else |
|
1066 |
{ |
|
1067 |
// DP2("Sorting %S greater than %S", &a.iTitle, &b.iTitle); |
|
1068 |
return 1; |
|
1069 |
} |
|
1070 |
} |
|
1071 |
||
1072 |
TInt CShowEngine::CompareShowsByTrackNo(const CShowInfo &a, const CShowInfo &b) |
|
1073 |
{ |
|
1074 |
if (a.TrackNo() < b.TrackNo()) |
|
1075 |
{ |
|
1076 |
return -1; |
|
1077 |
} |
|
1078 |
else if (a.TrackNo() == b.TrackNo()) |
|
1079 |
{ |
|
1080 |
return 0; |
|
1081 |
} |
|
1082 |
else |
|
1083 |
{ |
|
1084 |
return 1; |
|
1085 |
} |
|
1086 |
} |
|
1087 |
||
1088 |
TInt CShowEngine::CompareShowsByTitle(const CShowInfo &a, const CShowInfo &b) |
|
1089 |
{ |
|
1090 |
if (a.Title() < b.Title()) |
|
1091 |
{ |
|
1092 |
// DP2("Sorting %S less than %S", &a.iTitle, &b.iTitle); |
|
1093 |
return -1; |
|
1094 |
} |
|
1095 |
else if (a.Title() == b.Title()) |
|
1096 |
{ |
|
1097 |
// DP2("Sorting %S equal to %S", &a.iTitle, &b.iTitle); |
|
1098 |
return 0; |
|
1099 |
} |
|
1100 |
else |
|
1101 |
{ |
|
1102 |
// DP2("Sorting %S greater than %S", &a.iTitle, &b.iTitle); |
|
1103 |
return 1; |
|
1104 |
} |
|
1105 |
} |
|
1106 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1107 |
EXPORT_C void CShowEngine::DeletePlayedShowsL(RShowInfoArray &aShowInfoArray) |
2 | 1108 |
{ |
1109 |
for (TInt i = 0; i < aShowInfoArray.Count(); i++) |
|
1110 |
{ |
|
1111 |
if (aShowInfoArray[i]->PlayState() == EPlayed |
|
1112 |
&& aShowInfoArray[i]->FileName().Length() > 0) |
|
1113 |
{ |
|
1114 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), aShowInfoArray[i]->FileName()); |
|
1115 |
aShowInfoArray[i]->SetDownloadState(ENotDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1116 |
DBUpdateShowL(*aShowInfoArray[i]); |
2 | 1117 |
} |
1118 |
} |
|
1119 |
} |
|
1120 |
||
1121 |
EXPORT_C void CShowEngine::DeleteAllShowsByFeedL(TUint aFeedUid, TBool aDeleteFiles) |
|
1122 |
{ |
|
1123 |
RShowInfoArray array; |
|
1124 |
DBGetShowsByFeedL(array, aFeedUid); |
|
1125 |
||
1126 |
const TInt count = array.Count(); |
|
1127 |
||
1128 |
for (TInt i = count - 1; i >= 0; i--) |
|
1129 |
{ |
|
52 | 1130 |
if (iShowDownloading && iShowDownloading->Uid() == array[i]->Uid()) |
1131 |
{ |
|
1132 |
// trying to delete the active download |
|
1133 |
RemoveDownloadL(iShowDownloading->Uid()); |
|
1134 |
} |
|
1135 |
||
1136 |
// delete downloaded file |
|
2 | 1137 |
if (array[i]->FileName().Length() > 0) |
1138 |
{ |
|
1139 |
if (aDeleteFiles) |
|
1140 |
{ |
|
1141 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), array[i]->FileName()); |
|
1142 |
} |
|
1143 |
} |
|
1144 |
} |
|
1145 |
array.ResetAndDestroy(); |
|
52 | 1146 |
|
1147 |
// delete all shows from DB |
|
78 | 1148 |
DBDeleteAllShowsByFeedL(aFeedUid); |
52 | 1149 |
|
1150 |
// this will clear out deleted shows from the download queue |
|
1151 |
DBGetAllDownloadsL(array); |
|
1152 |
array.ResetAndDestroy(); |
|
1153 |
||
1154 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1155 |
} |
1156 |
||
78 | 1157 |
EXPORT_C void CShowEngine::DeleteOldShowsByFeedL(TUint aFeedUid) |
2 | 1158 |
{ |
78 | 1159 |
DBDeleteOldShowsByFeedL(aFeedUid); |
2 | 1160 |
} |
1161 |
||
1162 |
EXPORT_C void CShowEngine::DeleteShowL(TUint aShowUid, TBool aRemoveFile) |
|
1163 |
{ |
|
1164 |
||
1165 |
CShowInfo *info = DBGetShowByUidL(aShowUid); |
|
1166 |
||
1167 |
if (info != NULL) |
|
1168 |
{ |
|
1169 |
if (info->FileName().Length() > 0 && aRemoveFile) |
|
1170 |
{ |
|
1171 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), info->FileName()); |
|
1172 |
} |
|
1173 |
||
1174 |
info->SetDownloadState(ENotDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1175 |
DBUpdateShowL(*info); |
2 | 1176 |
delete info; |
1177 |
} |
|
1178 |
} |
|
1179 |
||
1180 |
EXPORT_C void CShowEngine::GetShowsByFeedL(RShowInfoArray& aShowArray, TUint aFeedUid) |
|
1181 |
{ |
|
1182 |
DP("CShowEngine::GetShowsByFeed"); |
|
1183 |
DBGetShowsByFeedL(aShowArray, aFeedUid); |
|
1184 |
} |
|
1185 |
||
1186 |
EXPORT_C void CShowEngine::GetAllShowsL(RShowInfoArray &aArray) |
|
1187 |
{ |
|
1188 |
DP("CShowEngine::GetAllShows"); |
|
1189 |
DBGetAllShowsL(aArray); |
|
1190 |
} |
|
1191 |
||
1192 |
EXPORT_C void CShowEngine::GetShowsDownloadedL(RShowInfoArray &aArray) |
|
1193 |
{ |
|
1194 |
DP("CShowEngine::GetShowsDownloaded"); |
|
1195 |
DBGetDownloadedShowsL(aArray); |
|
1196 |
} |
|
1197 |
||
1198 |
EXPORT_C void CShowEngine::GetNewShowsL(RShowInfoArray &aArray) |
|
1199 |
{ |
|
1200 |
DP("CShowEngine::GetNewShows"); |
|
1201 |
DBGetNewShowsL(aArray); |
|
1202 |
} |
|
1203 |
||
1204 |
EXPORT_C void CShowEngine::GetShowsDownloadingL(RShowInfoArray &aArray) |
|
1205 |
{ |
|
1206 |
DP("CShowEngine::GetShowsDownloading"); |
|
1207 |
DBGetAllDownloadsL(aArray); |
|
1208 |
} |
|
1209 |
||
1210 |
EXPORT_C TInt CShowEngine::GetNumDownloadingShows() |
|
1211 |
{ |
|
78 | 1212 |
TUint count; |
1213 |
TRAP_IGNORE(count = DBGetDownloadsCountL()); |
|
1214 |
||
1215 |
return (const TInt) count; |
|
2 | 1216 |
} |
1217 |
||
1218 |
EXPORT_C void CShowEngine::AddDownloadL(CShowInfo& aInfo) |
|
1219 |
{ |
|
1220 |
aInfo.SetDownloadState(EQueued); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1221 |
DBUpdateShowL(aInfo); |
78 | 1222 |
DBAddDownloadL(aInfo.Uid()); |
2 | 1223 |
DownloadNextShowL(); |
1224 |
} |
|
1225 |
||
1226 |
void CShowEngine::DownloadNextShowL() |
|
1227 |
{ |
|
1228 |
DP("CShowEngine::DownloadNextShowL BEGIN"); |
|
1229 |
// Check if we have anything in the download queue |
|
78 | 1230 |
const TInt count = DBGetDownloadsCountL(); |
2 | 1231 |
DP("CShowEngine::DownloadNextShow\tTrying to start new download");DP1("CShowEngine::DownloadNextShow\tShows in download queue %d", count); |
1232 |
||
1233 |
if (count > 0) |
|
1234 |
{ |
|
1235 |
if (iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
1236 |
{ |
|
1237 |
DP("CShowEngine::DownloadNextShow\tDownload process is suspended, ABORTING"); |
|
34 | 1238 |
// Inform the observers |
1239 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1240 |
return; |
1241 |
} |
|
1242 |
else if (iShowClient->IsActive()) |
|
1243 |
{ |
|
1244 |
DP("CShowEngine::DownloadNextShow\tDownload process is already active."); |
|
34 | 1245 |
// Inform the observers |
1246 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1247 |
return; |
1248 |
} |
|
1249 |
else |
|
1250 |
{ |
|
1251 |
// Start the download |
|
1252 |
CShowInfo *info = DBGetNextDownloadL(); |
|
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1253 |
CleanupStack::PushL(info); |
2 | 1254 |
while(info != NULL) |
1255 |
{ |
|
1256 |
DP1("CShowEngine::DownloadNextShow\tDownloading: %S", &(info->Title())); |
|
1257 |
info->SetDownloadState(EDownloading); |
|
1258 |
info->SetLastError(KErrNone); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1259 |
DBUpdateShowL(*info); |
2 | 1260 |
iShowDownloading = info; |
34 | 1261 |
// Inform the observers |
1262 |
// important to do this after we change download state |
|
1263 |
NotifyDownloadQueueUpdatedL(); |
|
1264 |
||
78 | 1265 |
TRAPD(error,GetShowL(info)); |
1266 |
if (error != KErrNone) |
|
2 | 1267 |
{ |
1268 |
info->SetDownloadState(EFailedDownload); |
|
78 | 1269 |
DBRemoveDownloadL(info->Uid()); |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1270 |
DBUpdateShowL(*info); |
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1271 |
CleanupStack::PopAndDestroy(info); |
2 | 1272 |
info = DBGetNextDownloadL(); |
1273 |
||
1274 |
if(info == NULL) |
|
1275 |
{ |
|
1276 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
1277 |
iShowDownloading = NULL; |
|
1278 |
} |
|
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1279 |
else |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1280 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1281 |
CleanupStack::PushL(info); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1282 |
} |
2 | 1283 |
} |
1284 |
else |
|
1285 |
{ |
|
1286 |
break; |
|
1287 |
} |
|
1288 |
} |
|
82
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
79
diff
changeset
|
1289 |
CleanupStack::Pop(info); // lives on as iShowDownloading |
2 | 1290 |
} |
1291 |
} |
|
1292 |
else |
|
1293 |
{ |
|
34 | 1294 |
// Inform the observers |
1295 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1296 |
iShowDownloading = NULL;DP("CShowEngine::DownloadNextShow\tNothing to download"); |
1297 |
} |
|
1298 |
DP("CShowEngine::DownloadNextShowL END"); |
|
1299 |
} |
|
1300 |
||
1301 |
void CShowEngine::NotifyDownloadQueueUpdatedL() |
|
1302 |
{ |
|
1303 |
const TInt count = iObservers.Count(); |
|
1304 |
for (TInt i = 0; i < count; i++) |
|
1305 |
{ |
|
78 | 1306 |
iObservers[i]->DownloadQueueUpdatedL(1, DBGetDownloadsCountL() - 1); |
2 | 1307 |
} |
1308 |
} |
|
1309 |
||
1310 |
void CShowEngine::NotifyShowDownloadUpdatedL(TInt aBytesOfCurrentDownload, TInt aBytesTotal) |
|
1311 |
{ |
|
1312 |
const TInt count = iObservers.Count(); |
|
1313 |
for (TInt i = 0; i < count; i++) |
|
1314 |
{ |
|
1315 |
iObservers[i]->ShowDownloadUpdatedL(aBytesOfCurrentDownload, aBytesTotal); |
|
1316 |
} |
|
1317 |
} |
|
1318 |
||
1319 |
void CShowEngine::NotifyShowFinishedL(TInt aError) |
|
1320 |
{ |
|
1321 |
const TInt count = iObservers.Count(); |
|
1322 |
for (TInt i = 0; i < count; i++) |
|
1323 |
{ |
|
1324 |
iObservers[i]->ShowDownloadFinishedL(iShowDownloading?iShowDownloading->Uid():0, aError); |
|
1325 |
} |
|
1326 |
} |
|
1327 |
||
1328 |
EXPORT_C void CShowEngine::NotifyShowListUpdatedL() |
|
1329 |
{ |
|
1330 |
for (TInt i = 0; i < iObservers.Count(); i++) |
|
1331 |
{ |
|
1332 |
iObservers[i]->ShowListUpdatedL(); |
|
1333 |
} |
|
1334 |
} |
|
1335 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1336 |
void CShowEngine::ReadMetaDataL(CShowInfo& aShowInfo) |
2 | 1337 |
{ |
1338 |
//DP1("Read %S", &(aShowInfo->Title())); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1339 |
DBUpdateShowL(aShowInfo); |
2 | 1340 |
} |
1341 |
||
1342 |
void CShowEngine::ReadMetaDataCompleteL() |
|
1343 |
{ |
|
1344 |
NotifyShowListUpdatedL(); |
|
1345 |
MetaDataReader().SetIgnoreTrackNo(EFalse); |
|
1346 |
} |
|
1347 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1348 |
EXPORT_C void CShowEngine::UpdateShowL(CShowInfo& aInfo) |
2 | 1349 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1350 |
DBUpdateShowL(aInfo); |
2 | 1351 |
} |
1352 |
||
1353 |
EXPORT_C CMetaDataReader& CShowEngine::MetaDataReader() |
|
1354 |
{ |
|
1355 |
return *iMetaDataReader; |
|
1356 |
} |
|
1357 |
||
1358 |
void CShowEngine::FileError(TUint /*aError*/) |
|
1359 |
{ |
|
1360 |
iDownloadErrors = KMaxDownloadErrors; |
|
1361 |
} |