author | Sebastian Brannstrom <sebastianb@symbian.org> |
Fri, 12 Nov 2010 17:26:03 +0100 | |
branch | RCL_3 |
changeset 332 | 88a24b8b97d8 |
parent 331 | c44ad45736ff |
child 368 | b131f7696342 |
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" |
|
299
56d23cf60795
Fixes for issues using #define with raptor
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
291
diff
changeset
|
29 |
#include "defines.h" |
202
e1dedb07817d
Tweaks to capabilities in DLL to enable self signing; Opening RCL_3 branch.
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
200
diff
changeset
|
30 |
|
e1dedb07817d
Tweaks to capabilities in DLL to enable self signing; Opening RCL_3 branch.
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
200
diff
changeset
|
31 |
#ifdef ENABLE_MPX_INTEGRATION |
126 | 32 |
#include <mpxcollectionhelperfactory.h> |
202
e1dedb07817d
Tweaks to capabilities in DLL to enable self signing; Opening RCL_3 branch.
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
200
diff
changeset
|
33 |
#endif |
2 | 34 |
|
35 |
const TUint KMaxDownloadErrors = 3; |
|
36 |
const TInt KMimeBufLength = 100; |
|
37 |
||
38 |
CShowEngine::CShowEngine(CPodcastModel& aPodcastModel) : |
|
39 |
iPodcastModel(aPodcastModel), |
|
40 |
iDB(*aPodcastModel.DB()) |
|
41 |
{ |
|
42 |
} |
|
43 |
||
44 |
EXPORT_C CShowEngine::~CShowEngine() |
|
45 |
{ |
|
46 |
delete iShowClient; |
|
47 |
iObservers.Close(); |
|
48 |
delete iShowDownloading; |
|
49 |
delete iMetaDataReader; |
|
50 |
iApaSession.Close(); |
|
331
c44ad45736ff
Fix for bug 3900 - MPXCollectionHelper must be Close()d, not deleted
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
326
diff
changeset
|
51 |
#ifdef ENABLE_MPX_INTEGRATION |
126 | 52 |
if (iCollectionHelper) |
331
c44ad45736ff
Fix for bug 3900 - MPXCollectionHelper must be Close()d, not deleted
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
326
diff
changeset
|
53 |
{ |
c44ad45736ff
Fix for bug 3900 - MPXCollectionHelper must be Close()d, not deleted
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
326
diff
changeset
|
54 |
iCollectionHelper->Close(); |
c44ad45736ff
Fix for bug 3900 - MPXCollectionHelper must be Close()d, not deleted
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
326
diff
changeset
|
55 |
} |
200
79076725bab9
Added #define to enable/disable MPX integration, since it requires capabilities that can't be granted when self signed
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
172
diff
changeset
|
56 |
#endif |
2 | 57 |
} |
58 |
||
59 |
EXPORT_C CShowEngine* CShowEngine::NewL(CPodcastModel& aPodcastModel) |
|
60 |
{ |
|
61 |
CShowEngine* self = new (ELeave) CShowEngine(aPodcastModel); |
|
62 |
CleanupStack::PushL(self); |
|
63 |
self->ConstructL(); |
|
64 |
CleanupStack::Pop(self); |
|
65 |
return self; |
|
66 |
} |
|
67 |
||
68 |
EXPORT_C void CShowEngine::GetMimeType(const TDesC& aFileName, TDes& aMimeType) |
|
69 |
{ |
|
70 |
aMimeType.Zero(); |
|
71 |
RFile file; |
|
72 |
if (file.Open(iPodcastModel.FsSession(), aFileName, 0) == KErrNone) |
|
73 |
{ |
|
74 |
if (file.Read(iRecogBuffer) == KErrNone) |
|
75 |
{ |
|
76 |
TDataRecognitionResult result; |
|
77 |
if (iApaSession.RecognizeData(aFileName, iRecogBuffer, result) |
|
78 |
== KErrNone) |
|
79 |
{ |
|
80 |
aMimeType.Copy(result.iDataType.Des()); |
|
81 |
} |
|
82 |
||
83 |
} |
|
84 |
} |
|
85 |
file.Close(); |
|
86 |
} |
|
87 |
||
88 |
void CShowEngine::ConstructL() |
|
89 |
{ |
|
90 |
iShowClient = CHttpClient::NewL(iPodcastModel, *this); |
|
91 |
iShowClient->SetResumeEnabled(ETrue); |
|
92 |
iMetaDataReader = new (ELeave) CMetaDataReader(*this, iPodcastModel.FsSession()); |
|
93 |
iMetaDataReader->ConstructL(); |
|
94 |
User::LeaveIfError(iApaSession.Connect()); |
|
95 |
} |
|
96 |
||
97 |
EXPORT_C void CShowEngine::SuspendDownloads() |
|
98 |
{ |
|
99 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
100 |
iShowClient->Stop(); |
|
101 |
} |
|
102 |
||
103 |
EXPORT_C void CShowEngine::ResumeDownloadsL() |
|
104 |
{ |
|
105 |
DP("CShowEngine::ResumeDownloadsL BEGIN"); |
|
106 |
if (iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
107 |
{ |
|
108 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(EFalse); |
|
109 |
iDownloadErrors = 0; |
|
110 |
DownloadNextShowL(); |
|
111 |
} |
|
112 |
DP("CShowEngine::ResumeDownloadsL END"); |
|
113 |
} |
|
114 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
115 |
EXPORT_C void CShowEngine::RemoveAllDownloadsL() |
2 | 116 |
{ |
117 |
if (!iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
118 |
{ |
|
119 |
SuspendDownloads(); |
|
120 |
} |
|
121 |
||
111 | 122 |
DBRemoveAllDownloadsL(); |
22 | 123 |
NotifyDownloadQueueUpdatedL(); |
2 | 124 |
} |
125 |
||
111 | 126 |
EXPORT_C void CShowEngine::RemoveDownloadL(TUint aUid) |
2 | 127 |
{ |
111 | 128 |
DP("CShowEngine::RemoveDownloadL BEGIN"); |
2 | 129 |
|
130 |
TBool resumeAfterRemove = EFalse; |
|
131 |
// if trying to remove the present download, we first stop it |
|
132 |
if (!iPodcastModel.SettingsEngine().DownloadSuspended() && iShowDownloading != NULL |
|
133 |
&& iShowDownloading->Uid() == aUid) |
|
134 |
{ |
|
135 |
DP("CShowEngine::RemoveDownload\t This is the active download, we suspend downloading"); |
|
136 |
SuspendDownloads(); |
|
122 | 137 |
|
138 |
// partial downloads should be removed |
|
139 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), iShowDownloading->FileName()); |
|
140 |
||
2 | 141 |
resumeAfterRemove = ETrue; |
142 |
} |
|
143 |
||
144 |
CShowInfo *info = DBGetShowByUidL(aUid); |
|
145 |
if (info != NULL) |
|
146 |
{ |
|
147 |
info->SetDownloadState(ENotDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
148 |
DBUpdateShowL(*info); |
2 | 149 |
delete info; |
150 |
} |
|
111 | 151 |
|
152 |
DBRemoveDownloadL(aUid); |
|
2 | 153 |
|
116 | 154 |
if (resumeAfterRemove) |
155 |
{ |
|
2 | 156 |
ResumeDownloadsL(); |
116 | 157 |
} |
158 |
else |
|
159 |
{ |
|
160 |
NotifyShowDownloadUpdatedL(-1, -1); |
|
161 |
NotifyDownloadQueueUpdatedL(); |
|
162 |
} |
|
2 | 163 |
|
164 |
DownloadNextShowL(); |
|
111 | 165 |
DP("CShowEngine::RemoveDownloadL END"); |
2 | 166 |
} |
167 |
||
168 |
void CShowEngine::Connected(CHttpClient* /*aClient*/) |
|
169 |
{ |
|
170 |
||
171 |
} |
|
172 |
||
173 |
void CShowEngine::Progress(CHttpClient* /*aHttpClient */, TInt aBytes, |
|
174 |
TInt aTotalBytes) |
|
175 |
{ |
|
248
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
176 |
//iShowDownloading->SetShowSize(aTotalBytes); |
2 | 177 |
TRAP_IGNORE(NotifyShowDownloadUpdatedL(aBytes, aTotalBytes)); |
178 |
} |
|
179 |
||
180 |
void CShowEngine::Disconnected(CHttpClient* /*aClient */) |
|
181 |
{ |
|
182 |
} |
|
183 |
||
184 |
void CShowEngine::DownloadInfo(CHttpClient* aHttpClient, TInt aTotalBytes) |
|
185 |
{ |
|
172
c2a99fe1afd0
Proposed fix for bug 2931
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
165
diff
changeset
|
186 |
DP1("CShowEngine::DownloadInfo, About to download %d bytes", aTotalBytes); |
2 | 187 |
} |
188 |
||
111 | 189 |
void CShowEngine::GetShowL(CShowInfo *info) |
2 | 190 |
{ |
191 |
CFeedInfo *feedInfo = iPodcastModel.FeedEngine().GetFeedInfoByUid( |
|
192 |
info->FeedUid()); |
|
111 | 193 |
|
2 | 194 |
TFileName filePath; |
195 |
filePath.Copy(iPodcastModel.SettingsEngine().BaseDir()); |
|
196 |
||
197 |
TFileName relPath; |
|
198 |
relPath.Copy(feedInfo->Title()); |
|
199 |
relPath.Append('\\'); |
|
200 |
||
201 |
TFileName fileName; |
|
202 |
PodcastUtils::FileNameFromUrl(info->Url(), fileName); |
|
257
f5377b5817a0
Fix for bug 3626 - show filenames are now generated from UIDs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
248
diff
changeset
|
203 |
|
f5377b5817a0
Fix for bug 3626 - show filenames are now generated from UIDs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
248
diff
changeset
|
204 |
TFileName newFilename; |
291
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
205 |
|
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
206 |
TInt periodPos = fileName.LocateReverse('.'); |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
207 |
|
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
208 |
if (periodPos != -1) |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
209 |
{ |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
210 |
// file extension (most likely) found |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
211 |
TFileName extension; |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
212 |
extension.Copy(fileName.Mid(periodPos)); |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
213 |
DP1("extension=%S", &extension); |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
214 |
|
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
215 |
newFilename.Format(_L("%u%S"), info->Uid(), &extension); |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
216 |
DP1("newFilename=%S", &newFilename); |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
217 |
} |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
218 |
else |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
219 |
{ |
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
220 |
// no extension found, we'll have to rely on magic numbers |
326
255972d41940
Fix for an issue with file names having zero length if the URL ends with a slash
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
299
diff
changeset
|
221 |
newFilename.Format(_L("%u"), info->Uid()); |
291
2f62fe179bbb
For for a potential crash bug when a show URL does not contain a period
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
257
diff
changeset
|
222 |
} |
257
f5377b5817a0
Fix for bug 3626 - show filenames are now generated from UIDs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
248
diff
changeset
|
223 |
|
f5377b5817a0
Fix for bug 3626 - show filenames are now generated from UIDs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
248
diff
changeset
|
224 |
relPath.Append(newFilename); |
2 | 225 |
PodcastUtils::EnsureProperPathName(relPath); |
226 |
||
227 |
// complete file path is base dir + rel path |
|
228 |
filePath.Append(relPath); |
|
229 |
info->SetFileNameL(filePath); |
|
230 |
||
111 | 231 |
User::LeaveIfError(iShowClient->GetL(info->Url(), filePath)); |
2 | 232 |
} |
233 |
||
111 | 234 |
EXPORT_C void CShowEngine::AddShowL(const CShowInfo& aItem) |
2 | 235 |
{ |
236 |
DP1("CShowEngine::AddShowL, title=%S", &aItem.Title()); |
|
237 |
CShowInfo *showInfo = DBGetShowByUidL(aItem.Uid()); |
|
238 |
||
239 |
if (showInfo == NULL) |
|
240 |
{ |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
241 |
DBAddShowL(aItem); |
2 | 242 |
} |
243 |
else |
|
244 |
{ |
|
245 |
delete showInfo; |
|
111 | 246 |
User::Leave(KErrAlreadyExists); |
2 | 247 |
} |
248 |
} |
|
249 |
||
250 |
EXPORT_C void CShowEngine::AddObserver(MShowEngineObserver *observer) |
|
251 |
{ |
|
252 |
iObservers.Append(observer); |
|
253 |
} |
|
254 |
||
255 |
EXPORT_C void CShowEngine::RemoveObserver(MShowEngineObserver *observer) |
|
256 |
{ |
|
257 |
TInt index = iObservers.Find(observer); |
|
258 |
||
259 |
if (index > KErrNotFound) |
|
260 |
{ |
|
261 |
iObservers.Remove(index); |
|
262 |
} |
|
263 |
} |
|
264 |
||
126 | 265 |
void CShowEngine::AddShowToMpxCollection(CShowInfo &aShowInfo) |
2 | 266 |
{ |
332
88a24b8b97d8
Added some more debugging for MPX integration
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
331
diff
changeset
|
267 |
DP("CShowEngine::AddShowToMpxCollection BEGIN"); |
200
79076725bab9
Added #define to enable/disable MPX integration, since it requires capabilities that can't be granted when self signed
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
172
diff
changeset
|
268 |
#ifdef ENABLE_MPX_INTEGRATION |
126 | 269 |
if (!iCollectionHelper) |
270 |
iCollectionHelper = CMPXCollectionHelperFactory::NewCollectionHelperL(); |
|
2 | 271 |
|
126 | 272 |
// if this leaves, not much we can do anyway |
332
88a24b8b97d8
Added some more debugging for MPX integration
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
331
diff
changeset
|
273 |
DP(" MPX integration enabled, adding show to collection"); |
88a24b8b97d8
Added some more debugging for MPX integration
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
331
diff
changeset
|
274 |
TRAPD(err, iCollectionHelper->AddL(aShowInfo.FileName(), this)); |
88a24b8b97d8
Added some more debugging for MPX integration
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
331
diff
changeset
|
275 |
DP1(" AddL returned %d", err); |
200
79076725bab9
Added #define to enable/disable MPX integration, since it requires capabilities that can't be granted when self signed
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
172
diff
changeset
|
276 |
#endif |
332
88a24b8b97d8
Added some more debugging for MPX integration
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
331
diff
changeset
|
277 |
DP("CShowEngine::AddShowToMpxCollection END"); |
2 | 278 |
} |
279 |
||
280 |
void CShowEngine::CompleteL(CHttpClient* /*aHttpClient*/, TInt aError) |
|
281 |
{ |
|
282 |
if (iShowDownloading != NULL) |
|
283 |
{ |
|
248
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
284 |
DP2("CShowEngine::CompleteL file=%S, aError=%d", &iShowDownloading->FileName(), aError); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
285 |
|
2 | 286 |
if(aError != KErrCouldNotConnect) |
287 |
{ |
|
6 | 288 |
if(aError == KErrDisconnected && iPodcastModel.SettingsEngine().DownloadSuspended()) |
289 |
{ |
|
2 | 290 |
// no error if disconnect happened because of suspended downloading |
6 | 291 |
} |
292 |
else |
|
293 |
{ |
|
2 | 294 |
iShowDownloading->SetLastError(aError); |
6 | 295 |
} |
2 | 296 |
|
297 |
if (aError == KErrNone) |
|
298 |
{ |
|
299 |
TBuf<KMimeBufLength> mimeType; |
|
300 |
GetMimeType(iShowDownloading->FileName(), mimeType); |
|
301 |
_LIT(KMimeAudio,"audio"); |
|
302 |
_LIT(KMimeVideo,"video"); |
|
303 |
if (mimeType.Left(5) == KMimeAudio) |
|
304 |
{ |
|
305 |
iShowDownloading->SetShowType(EAudioPodcast); |
|
306 |
} |
|
307 |
else if (mimeType.Left(5) == KMimeVideo) |
|
308 |
{ |
|
309 |
iShowDownloading->SetShowType(EVideoPodcast); |
|
310 |
} |
|
248
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
311 |
|
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
312 |
// setting file size |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
313 |
TEntry entry; |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
314 |
TInt err = iPodcastModel.FsSession().Entry(iShowDownloading->FileName(), entry); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
315 |
if (err == KErrNone) |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
316 |
{ |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
317 |
iShowDownloading->SetShowSize(entry.iSize); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
318 |
} |
2 | 319 |
|
320 |
iShowDownloading->SetDownloadState(EDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
321 |
DBUpdateShowL(*iShowDownloading); |
111 | 322 |
DBRemoveDownloadL(iShowDownloading->Uid()); |
2 | 323 |
AddShowToMpxCollection(*iShowDownloading); |
324 |
NotifyShowFinishedL(aError); |
|
15
93d9f66bf50b
Cleaning description better for second line in search results
teknolog
parents:
6
diff
changeset
|
325 |
iDownloadErrors = 0; |
2 | 326 |
delete iShowDownloading; |
327 |
iShowDownloading = NULL; |
|
328 |
} |
|
329 |
else |
|
330 |
{ |
|
248
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
331 |
if (aError == HTTPStatus::ERequestedRangeNotSatisfiable) |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
332 |
{ |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
333 |
DP("ERequestedRangeNotSatisfiable, resetting download"); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
334 |
// file size got messed up, so delete downloaded file an re-queue |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
335 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(),iShowDownloading->FileName()); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
336 |
iShowDownloading->SetDownloadState(EQueued); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
337 |
DBUpdateShowL(*iShowDownloading); |
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
338 |
} |
2 | 339 |
// 400 and 500 series errors are serious errors on which probably another download will fail |
248
31659d49b2e7
Fix for bug 3042
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
202
diff
changeset
|
340 |
else if (aError>= HTTPStatus::EBadRequest && aError <= HTTPStatus::EBadRequest+200) |
2 | 341 |
{ |
342 |
iShowDownloading->SetDownloadState(EFailedDownload); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
343 |
DBUpdateShowL(*iShowDownloading); |
111 | 344 |
DBRemoveDownloadL(iShowDownloading->Uid()); |
2 | 345 |
NotifyShowFinishedL(aError); |
346 |
||
347 |
delete iShowDownloading; |
|
348 |
iShowDownloading = NULL; |
|
349 |
} |
|
115
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
350 |
else if (aError == KErrDiskFull) |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
351 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
352 |
// stop downloading immediately if disk is full |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
353 |
iShowDownloading->SetDownloadState(EQueued); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
354 |
DBUpdateShowL(*iShowDownloading); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
355 |
iDownloadErrors = KMaxDownloadErrors; |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
356 |
} |
2 | 357 |
else // other kind of error, missing network etc, reque this show |
358 |
{ |
|
359 |
iShowDownloading->SetDownloadState(EQueued); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
360 |
DBUpdateShowL(*iShowDownloading); |
2 | 361 |
} |
362 |
||
115
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
112
diff
changeset
|
363 |
NotifyDownloadQueueUpdatedL(); |
2 | 364 |
iDownloadErrors++; |
117
3b59b88b089e
Fixed Code Scanner L-issues; Further improvements to HTTP robustness
teknolog
parents:
116
diff
changeset
|
365 |
if (iDownloadErrors >= KMaxDownloadErrors) |
2 | 366 |
{ |
367 |
DP("Too many downloading errors, suspending downloads"); |
|
368 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
369 |
NotifyShowFinishedL(aError); |
|
370 |
} |
|
371 |
} |
|
372 |
DownloadNextShowL(); |
|
373 |
} |
|
374 |
||
375 |
else |
|
376 |
{ |
|
377 |
// Connection error |
|
378 |
if(iShowDownloading) |
|
379 |
{ |
|
380 |
iShowDownloading->SetDownloadState(EQueued); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
381 |
DBUpdateShowL(*iShowDownloading); |
2 | 382 |
} |
383 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
384 |
NotifyShowFinishedL(aError); |
|
385 |
} |
|
386 |
} |
|
387 |
} |
|
388 |
||
389 |
EXPORT_C CShowInfo* CShowEngine::ShowDownloading() |
|
390 |
{ |
|
391 |
return iShowDownloading; |
|
392 |
} |
|
393 |
||
394 |
EXPORT_C CShowInfo* CShowEngine::GetShowByUidL(TUint aShowUid) |
|
395 |
{ |
|
396 |
return DBGetShowByUidL(aShowUid); |
|
397 |
} |
|
398 |
CShowInfo* CShowEngine::DBGetShowByUidL(TUint aUid) |
|
399 |
{ |
|
400 |
DP("CShowEngine::DBGetShowByUid"); |
|
401 |
CShowInfo *showInfo = NULL; |
|
402 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows where uid=%u"); |
|
403 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
404 |
||
405 |
sqlite3_stmt *st; |
|
406 |
||
407 |
//DP1("SQL: %S", &iSqlBuffer.Left(KSqlDPLen)); |
|
408 |
||
409 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
410 |
&st, (const void**) NULL); |
|
411 |
||
412 |
if (rc == SQLITE_OK) |
|
413 |
{ |
|
414 |
rc = sqlite3_step(st); |
|
415 |
Cleanup_sqlite3_finalize_PushL(st); |
|
416 |
if (rc == SQLITE_ROW) |
|
417 |
{ |
|
418 |
showInfo = CShowInfo::NewLC(); |
|
419 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
420 |
CleanupStack::Pop(showInfo); |
|
421 |
} |
|
422 |
CleanupStack::PopAndDestroy();//st |
|
423 |
} |
|
424 |
||
425 |
return showInfo; |
|
426 |
} |
|
427 |
||
428 |
EXPORT_C CShowInfo* CShowEngine::DBGetShowByFileNameL(TFileName aFileName) |
|
429 |
{ |
|
430 |
DP("CShowEngine::DBGetShowByUid"); |
|
431 |
CShowInfo *showInfo = NULL; |
|
432 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows where filename=\"%S\""); |
|
433 |
iSqlBuffer.Format(KSqlStatement, &aFileName); |
|
434 |
||
435 |
sqlite3_stmt *st; |
|
436 |
||
437 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
438 |
&st, (const void**) NULL); |
|
439 |
||
440 |
if (rc == SQLITE_OK) |
|
441 |
{ |
|
442 |
rc = sqlite3_step(st); |
|
443 |
Cleanup_sqlite3_finalize_PushL(st); |
|
444 |
if (rc == SQLITE_ROW) |
|
445 |
{ |
|
446 |
showInfo = CShowInfo::NewLC(); |
|
447 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
448 |
CleanupStack::Pop(showInfo); |
|
449 |
} |
|
450 |
CleanupStack::PopAndDestroy();//st |
|
451 |
} |
|
452 |
||
453 |
return showInfo; |
|
454 |
} |
|
455 |
||
456 |
void CShowEngine::DBGetAllShowsL(RShowInfoArray& aShowArray) |
|
457 |
{ |
|
458 |
DP("CShowEngine::DBGetAllShows"); |
|
459 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows"); |
|
460 |
iSqlBuffer.Format(KSqlStatement); |
|
461 |
||
462 |
sqlite3_stmt *st; |
|
463 |
||
464 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
465 |
&st, (const void**) NULL); |
|
466 |
||
467 |
if (rc == SQLITE_OK) |
|
468 |
{ |
|
469 |
rc = sqlite3_step(st); |
|
470 |
Cleanup_sqlite3_finalize_PushL(st); |
|
471 |
while (rc == SQLITE_ROW) |
|
472 |
{ |
|
473 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
474 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
475 |
aShowArray.Append(showInfo); |
|
476 |
CleanupStack::Pop(showInfo); |
|
477 |
rc = sqlite3_step(st); |
|
478 |
} |
|
479 |
CleanupStack::PopAndDestroy();//st |
|
480 |
} |
|
481 |
||
482 |
} |
|
483 |
||
484 |
void CShowEngine::DBGetAllDownloadsL(RShowInfoArray& aShowArray) |
|
485 |
{ |
|
486 |
DP("CShowEngine::DBGetAllDownloads"); |
|
487 |
_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"); |
|
488 |
iSqlBuffer.Format(KSqlStatement); |
|
489 |
||
490 |
#ifndef DONT_SORT_SQL |
|
491 |
_LIT(KSqlSort, " order by dl_index"); |
|
492 |
iSqlBuffer.Append(KSqlSort); |
|
493 |
#endif |
|
494 |
sqlite3_stmt *st; |
|
495 |
||
496 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
497 |
&st, (const void**) NULL); |
|
498 |
||
499 |
if (rc == SQLITE_OK) |
|
500 |
{ |
|
501 |
rc = sqlite3_step(st); |
|
502 |
Cleanup_sqlite3_finalize_PushL(st); |
|
503 |
while (rc == SQLITE_ROW) |
|
504 |
{ |
|
505 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
506 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
507 |
aShowArray.Append(showInfo); |
|
508 |
CleanupStack::Pop(showInfo); |
|
509 |
rc = sqlite3_step(st); |
|
510 |
} |
|
511 |
CleanupStack::PopAndDestroy();//st |
|
512 |
} |
|
111 | 513 |
else |
514 |
{ |
|
515 |
User::Leave(KErrCorrupt); |
|
516 |
} |
|
2 | 517 |
|
518 |
// delete downloads that don't have a show |
|
519 |
||
520 |
_LIT(KSqlStatement2, "delete from downloads where uid not in (select downloads.uid from shows, downloads where shows.uid=downloads.uid)"); |
|
521 |
iSqlBuffer.Format(KSqlStatement2); |
|
522 |
||
523 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, &st, (const void**) NULL); |
|
524 |
||
525 |
if (rc == SQLITE_OK) |
|
526 |
{ |
|
111 | 527 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 528 |
rc = sqlite3_step(st); |
111 | 529 |
CleanupStack::PopAndDestroy(); // st |
530 |
} |
|
531 |
else |
|
532 |
{ |
|
533 |
User::Leave(KErrCorrupt); |
|
2 | 534 |
} |
535 |
} |
|
536 |
||
537 |
CShowInfo* CShowEngine::DBGetNextDownloadL() |
|
538 |
{ |
|
539 |
DP("CShowEngine::DBGetNextDownload"); |
|
540 |
CShowInfo *showInfo = NULL; |
|
541 |
_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"); |
|
542 |
iSqlBuffer.Format(KSqlStatement); |
|
543 |
||
544 |
#ifdef DONT_SORT_SQL |
|
545 |
_LIT(KSqlSort, " limit 1"); |
|
546 |
iSqlBuffer.Append(KSqlSort); |
|
547 |
#else |
|
548 |
_LIT(KSqlNoSort, " order by dl_index limit 1"); |
|
549 |
iSqlBuffer.Append(KSqlNoSort); |
|
550 |
#endif |
|
551 |
||
552 |
sqlite3_stmt *st; |
|
553 |
||
554 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
555 |
&st, (const void**) NULL); |
|
556 |
||
557 |
if (rc == SQLITE_OK) |
|
558 |
{ |
|
559 |
rc = sqlite3_step(st); |
|
560 |
Cleanup_sqlite3_finalize_PushL(st); |
|
561 |
if (rc == SQLITE_ROW) |
|
562 |
{ |
|
563 |
showInfo = CShowInfo::NewLC(); |
|
564 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
565 |
CleanupStack::Pop(showInfo); |
|
566 |
} |
|
111 | 567 |
else |
568 |
{ |
|
569 |
User::Leave(KErrUnknown); |
|
570 |
} |
|
2 | 571 |
CleanupStack::PopAndDestroy();//st |
572 |
} |
|
111 | 573 |
else |
574 |
{ |
|
575 |
User::Leave(KErrCorrupt); |
|
576 |
} |
|
2 | 577 |
|
578 |
return showInfo; |
|
579 |
} |
|
580 |
||
581 |
void CShowEngine::DBGetShowsByFeedL(RShowInfoArray& aShowArray, TUint aFeedUid) |
|
582 |
{ |
|
583 |
DP1("CShowEngine::DBGetShowsByFeed BEGIN, feedUid=%u", aFeedUid); |
|
584 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where feeduid=%u"); |
|
585 |
iSqlBuffer.Format(KSqlStatement, aFeedUid); |
|
586 |
||
587 |
#ifndef DONT_SORT_SQL |
|
588 |
_LIT(KSqlOrderByDate, " order by pubdate desc"); |
|
589 |
iSqlBuffer.Append(KSqlOrderByDate); |
|
590 |
#endif |
|
591 |
||
592 |
sqlite3_stmt *st; |
|
593 |
||
594 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
595 |
&st, (const void**) NULL); |
|
596 |
||
597 |
if (rc == SQLITE_OK) |
|
598 |
{ |
|
599 |
rc = sqlite3_step(st); |
|
600 |
Cleanup_sqlite3_finalize_PushL(st); |
|
601 |
while (rc == SQLITE_ROW) |
|
602 |
{ |
|
603 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
604 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
605 |
aShowArray.Append(showInfo); |
|
606 |
CleanupStack::Pop(showInfo); |
|
607 |
rc = sqlite3_step(st); |
|
608 |
} |
|
609 |
CleanupStack::PopAndDestroy();//st |
|
610 |
} |
|
111 | 611 |
else |
612 |
{ |
|
613 |
User::Leave(KErrCorrupt); |
|
614 |
} |
|
2 | 615 |
DP("CShowEngine::DBGetShowsByFeed END"); |
616 |
} |
|
617 |
||
111 | 618 |
TUint CShowEngine::DBGetDownloadsCountL() |
2 | 619 |
{ |
620 |
DP("CShowEngine::DBGetDownloadsCount"); |
|
621 |
||
622 |
_LIT(KSqlStatement, "select count(*) from downloads"); |
|
623 |
iSqlBuffer.Format(KSqlStatement); |
|
624 |
||
625 |
sqlite3_stmt *st; |
|
626 |
TUint count = 0; |
|
627 |
||
628 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
629 |
&st, (const void**) NULL); |
|
630 |
||
631 |
if (rc == SQLITE_OK) |
|
632 |
{ |
|
111 | 633 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 634 |
rc = sqlite3_step(st); |
635 |
||
636 |
if (rc == SQLITE_ROW) |
|
637 |
{ |
|
638 |
count = sqlite3_column_int(st, 0); |
|
639 |
} |
|
111 | 640 |
else |
641 |
{ |
|
642 |
User::Leave(KErrUnknown); |
|
643 |
} |
|
644 |
||
645 |
CleanupStack::PopAndDestroy(); //st |
|
646 |
} |
|
647 |
else |
|
648 |
{ |
|
649 |
User::Leave(KErrCorrupt); |
|
2 | 650 |
} |
651 |
return count; |
|
652 |
} |
|
653 |
||
654 |
void CShowEngine::DBGetDownloadedShowsL(RShowInfoArray& aShowArray) |
|
655 |
{ |
|
656 |
DP("CShowEngine::DBGetDownloadedShows"); |
|
657 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where downloadstate=%u"); |
|
658 |
iSqlBuffer.Format(KSqlStatement, EDownloaded); |
|
659 |
||
660 |
#ifndef DONT_SORT_SQL |
|
661 |
_LIT(KSqlSort, " order by title"); |
|
662 |
iSqlBuffer.Append(KSqlSort); |
|
663 |
#endif |
|
664 |
||
665 |
sqlite3_stmt *st; |
|
666 |
||
667 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
668 |
&st, (const void**) NULL); |
|
669 |
||
670 |
if (rc == SQLITE_OK) |
|
671 |
{ |
|
672 |
rc = sqlite3_step(st); |
|
673 |
Cleanup_sqlite3_finalize_PushL(st); |
|
674 |
while (rc == SQLITE_ROW) |
|
675 |
{ |
|
676 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
677 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
678 |
aShowArray.Append(showInfo); |
|
679 |
CleanupStack::Pop(showInfo); |
|
680 |
rc = sqlite3_step(st); |
|
681 |
} |
|
682 |
CleanupStack::PopAndDestroy();//st |
|
683 |
} |
|
111 | 684 |
else |
685 |
{ |
|
686 |
User::Leave(KErrCorrupt); |
|
687 |
} |
|
2 | 688 |
} |
689 |
||
690 |
void CShowEngine::DBGetNewShowsL(RShowInfoArray& aShowArray) |
|
691 |
{ |
|
692 |
DP("CShowEngine::DBGetNewShows"); |
|
693 |
_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where playstate=%u"); |
|
694 |
iSqlBuffer.Format(KSqlStatement, ENeverPlayed); |
|
695 |
||
696 |
sqlite3_stmt *st; |
|
697 |
||
698 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
699 |
&st, (const void**) NULL); |
|
700 |
||
701 |
if (rc == SQLITE_OK) |
|
702 |
{ |
|
703 |
rc = sqlite3_step(st); |
|
704 |
Cleanup_sqlite3_finalize_PushL(st); |
|
705 |
while (rc == SQLITE_ROW) |
|
706 |
{ |
|
707 |
CShowInfo* showInfo = CShowInfo::NewLC(); |
|
708 |
DBFillShowInfoFromStmtL(st, showInfo); |
|
709 |
aShowArray.Append(showInfo); |
|
710 |
CleanupStack::Pop(showInfo); |
|
711 |
rc = sqlite3_step(st); |
|
712 |
} |
|
713 |
CleanupStack::PopAndDestroy();//st |
|
714 |
} |
|
111 | 715 |
else |
716 |
{ |
|
717 |
User::Leave(KErrCorrupt); |
|
718 |
} |
|
2 | 719 |
} |
720 |
||
111 | 721 |
void CShowEngine::DBDeleteOldShowsByFeedL(TUint aFeedUid) |
2 | 722 |
{ |
723 |
DP("CShowEngine::DBDeleteOldShows"); |
|
724 |
||
725 |
// what we do: |
|
726 |
// 1. sort shows by pubdate |
|
727 |
// 2. select the first MaxListItems shows |
|
728 |
// 3. delete the rest if downloadstate is ENotDownloaded |
|
729 |
||
126 | 730 |
_LIT(KSqlStatement,"delete from shows where feeduid=%u and downloadstate=0 and uid not in (select uid from shows where feeduid=%u order by pubdate desc limit %u)"); |
2 | 731 |
iSqlBuffer.Format(KSqlStatement, aFeedUid, aFeedUid, iPodcastModel.SettingsEngine().MaxListItems()); |
732 |
||
733 |
sqlite3_stmt *st; |
|
734 |
||
735 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
736 |
&st, (const void**) NULL); |
|
737 |
||
738 |
if (rc == SQLITE_OK) |
|
739 |
{ |
|
740 |
rc = sqlite3_step(st); |
|
741 |
sqlite3_finalize(st); |
|
742 |
} |
|
111 | 743 |
else |
744 |
{ |
|
745 |
User::Leave(KErrCorrupt); |
|
746 |
} |
|
2 | 747 |
|
748 |
_LIT(KSqlStatement2, "delete from downloads where uid not in (select downloads.uid from shows, downloads where shows.uid=downloads.uid)"); |
|
749 |
iSqlBuffer.Format(KSqlStatement2); |
|
750 |
||
751 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, &st, (const void**) NULL); |
|
752 |
||
753 |
if (rc == SQLITE_OK) |
|
754 |
{ |
|
755 |
rc = sqlite3_step(st); |
|
756 |
sqlite3_finalize(st); |
|
757 |
} |
|
111 | 758 |
else |
759 |
{ |
|
760 |
User::Leave(KErrCorrupt); |
|
761 |
} |
|
2 | 762 |
} |
763 |
||
764 |
void CShowEngine::DBFillShowInfoFromStmtL(sqlite3_stmt *st, CShowInfo* showInfo) |
|
765 |
{ |
|
766 |
const void *urlz = sqlite3_column_text16(st, 0); |
|
767 |
TPtrC16 url((const TUint16*) urlz); |
|
768 |
showInfo->SetUrlL(url); |
|
769 |
||
770 |
const void *titlez = sqlite3_column_text16(st, 1); |
|
771 |
TPtrC16 title((const TUint16*) titlez); |
|
772 |
showInfo->SetTitleL(title); |
|
773 |
||
774 |
const void *descz = sqlite3_column_text16(st, 2); |
|
775 |
TPtrC16 desc((const TUint16*) descz); |
|
776 |
showInfo->SetDescriptionL(desc); |
|
777 |
||
778 |
const void *filez = sqlite3_column_text16(st, 3); |
|
779 |
TPtrC16 file((const TUint16*) filez); |
|
780 |
showInfo->SetFileNameL(file); |
|
781 |
||
782 |
sqlite3_int64 pos = sqlite3_column_int64(st, 4); |
|
783 |
TTimeIntervalMicroSeconds position(pos); |
|
784 |
showInfo->SetPosition(position); |
|
785 |
||
786 |
TUint playtime = sqlite3_column_int(st, 5); |
|
787 |
showInfo->SetPlayTime(playtime); |
|
788 |
||
789 |
TUint playstate = sqlite3_column_int(st, 6); |
|
790 |
showInfo->SetPlayState((TPlayState) playstate); |
|
791 |
||
792 |
TUint downloadstate = sqlite3_column_int(st, 7); |
|
793 |
showInfo->SetDownloadState((TDownloadState) downloadstate); |
|
794 |
||
795 |
TUint feeduid = sqlite3_column_int(st, 8); |
|
796 |
showInfo->SetFeedUid(feeduid); |
|
797 |
||
798 |
TUint uid = sqlite3_column_int(st, 9); |
|
799 |
showInfo->SetUid(uid); |
|
800 |
||
801 |
TUint showsize = sqlite3_column_int(st, 10); |
|
802 |
showInfo->SetShowSize(showsize); |
|
803 |
||
804 |
TUint trackno = sqlite3_column_int(st, 11); |
|
805 |
showInfo->SetTrackNo((TShowType) trackno); |
|
806 |
||
807 |
sqlite3_int64 pubdate = sqlite3_column_int64(st, 12); |
|
808 |
TTime timepubdate(pubdate); |
|
809 |
showInfo->SetPubDate(timepubdate); |
|
810 |
||
811 |
TUint showtype = sqlite3_column_int(st, 13); |
|
812 |
showInfo->SetShowType((TShowType) showtype); |
|
813 |
||
814 |
TInt lasterror = sqlite3_column_int(st, 14); |
|
815 |
showInfo->SetLastError(lasterror); |
|
816 |
} |
|
817 |
||
111 | 818 |
void CShowEngine::DBAddShowL(const CShowInfo& aItem) |
2 | 819 |
{ |
820 |
DP2("CShowEngine::DBAddShow, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
|
821 |
||
21 | 822 |
HBufC* titleBuf = HBufC::NewLC(KMaxLineLength); |
823 |
TPtr titlePtr(titleBuf->Des()); |
|
824 |
titlePtr.Copy(aItem.Title()); |
|
825 |
PodcastUtils::SQLEncode(titlePtr); |
|
826 |
||
827 |
HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
|
828 |
TPtr descPtr(descBuf->Des()); |
|
829 |
descPtr.Copy(aItem.Description()); |
|
830 |
PodcastUtils::SQLEncode(descPtr); |
|
831 |
||
126 | 832 |
_LIT(KSqlStatement, "insert into shows (url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype) values (\"%S\",\"%S\", \"%S\", \"%S\", \"%Lu\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%Lu\", \"%d\")"); |
21 | 833 |
|
834 |
iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
|
2 | 835 |
&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
836 |
aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
|
837 |
aItem.Uid(), aItem.ShowSize(), aItem.TrackNo(), |
|
838 |
aItem.PubDate().Int64(), aItem.ShowType()); |
|
839 |
||
21 | 840 |
CleanupStack::PopAndDestroy(descBuf); |
841 |
CleanupStack::PopAndDestroy(titleBuf); |
|
842 |
||
2 | 843 |
sqlite3_stmt *st; |
844 |
||
845 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
846 |
&st, (const void**) NULL); |
|
111 | 847 |
|
2 | 848 |
if (rc == SQLITE_OK) |
849 |
{ |
|
111 | 850 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 851 |
rc = sqlite3_step(st); |
111 | 852 |
if (rc != SQLITE_DONE) |
2 | 853 |
{ |
111 | 854 |
User::Leave(KErrAlreadyExists); |
2 | 855 |
} |
111 | 856 |
CleanupStack::PopAndDestroy(); // st |
2 | 857 |
} |
858 |
else |
|
859 |
{ |
|
111 | 860 |
User::Leave(KErrCorrupt); |
2 | 861 |
} |
862 |
} |
|
863 |
||
111 | 864 |
void CShowEngine::DBAddDownloadL(TUint aUid) |
2 | 865 |
{ |
866 |
DP1("CShowEngine::DBAddDownload, aUid=%u", aUid); |
|
867 |
||
868 |
_LIT(KSqlStatement, "insert into downloads (uid) values (%u)"); |
|
869 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
870 |
sqlite3_stmt *st; |
|
871 |
||
872 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
873 |
&st, (const void**) NULL); |
|
874 |
||
875 |
if (rc == SQLITE_OK) |
|
876 |
{ |
|
111 | 877 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 878 |
rc = sqlite3_step(st); |
116 | 879 |
if (rc != SQLITE_DONE) |
111 | 880 |
{ |
881 |
User::Leave(KErrUnknown); |
|
882 |
} |
|
883 |
CleanupStack::PopAndDestroy(); // st |
|
2 | 884 |
} |
111 | 885 |
else |
886 |
{ |
|
887 |
User::Leave(KErrCorrupt); |
|
888 |
} |
|
2 | 889 |
} |
890 |
||
111 | 891 |
void CShowEngine::DBUpdateShowL(CShowInfo& aItem) |
2 | 892 |
{ |
893 |
DP1("CShowEngine::DBUpdateShow, title='%S'", &aItem.Title()); |
|
894 |
||
30
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
895 |
HBufC* titleBuf = HBufC::NewLC(KMaxLineLength); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
896 |
TPtr titlePtr(titleBuf->Des()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
897 |
titlePtr.Copy(aItem.Title()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
898 |
PodcastUtils::SQLEncode(titlePtr); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
899 |
|
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
900 |
HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
901 |
TPtr descPtr(descBuf->Des()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
902 |
descPtr.Copy(aItem.Description()); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
903 |
PodcastUtils::SQLEncode(descPtr); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
904 |
|
134
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
126
diff
changeset
|
905 |
_LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\", playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\",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
|
906 |
iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
2 | 907 |
&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
908 |
aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
|
909 |
aItem.ShowSize(), aItem.TrackNo(), aItem.PubDate().Int64(), |
|
910 |
aItem.ShowType(), aItem.LastError(), aItem.Uid()); |
|
911 |
||
30
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
912 |
CleanupStack::PopAndDestroy(descBuf); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
913 |
CleanupStack::PopAndDestroy(titleBuf); |
7bca37ba5fa9
Added SQLEncoding for update of showinfo. Removed ABLD.BAT from repo
teknolog
parents:
22
diff
changeset
|
914 |
|
2 | 915 |
sqlite3_stmt *st; |
916 |
||
917 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
918 |
&st, (const void**) NULL); |
|
919 |
||
920 |
if (rc == SQLITE_OK) |
|
921 |
{ |
|
111 | 922 |
Cleanup_sqlite3_finalize_PushL(st); |
923 |
rc = sqlite3_step(st); |
|
2 | 924 |
|
116 | 925 |
if (rc != SQLITE_DONE) |
2 | 926 |
{ |
111 | 927 |
User::Leave(KErrUnknown); |
2 | 928 |
} |
111 | 929 |
CleanupStack::PopAndDestroy(); // st |
2 | 930 |
} |
931 |
else |
|
932 |
{ |
|
111 | 933 |
User::Leave(KErrCorrupt); |
2 | 934 |
} |
935 |
} |
|
936 |
||
111 | 937 |
void CShowEngine::DBDeleteShowL(TUint aUid) |
2 | 938 |
{ |
939 |
DP("CShowEngine::DBDeleteShow"); |
|
940 |
||
941 |
_LIT(KSqlStatement, "delete from shows where uid=%u"); |
|
942 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
943 |
||
944 |
sqlite3_stmt *st; |
|
945 |
||
946 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
947 |
&st, (const void**) NULL); |
|
948 |
||
949 |
if (rc == SQLITE_OK) |
|
950 |
{ |
|
111 | 951 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 952 |
rc = sqlite3_step(st); |
953 |
||
116 | 954 |
if (rc != SQLITE_DONE) |
2 | 955 |
{ |
111 | 956 |
User::Leave(KErrUnknown); |
2 | 957 |
} |
111 | 958 |
CleanupStack::PopAndDestroy(); // st |
2 | 959 |
} |
960 |
else |
|
961 |
{ |
|
111 | 962 |
User::Leave(KErrCorrupt); |
2 | 963 |
} |
964 |
} |
|
965 |
||
111 | 966 |
void CShowEngine::DBDeleteAllShowsByFeedL(TUint aFeedUid) |
2 | 967 |
{ |
968 |
DP("CShowEngine::DBDeleteAllShowsByFeed"); |
|
969 |
||
970 |
_LIT(KSqlStatement, "delete from shows where feeduid=%u"); |
|
971 |
iSqlBuffer.Format(KSqlStatement, aFeedUid); |
|
972 |
||
973 |
sqlite3_stmt *st; |
|
974 |
||
975 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
976 |
&st, (const void**) NULL); |
|
977 |
||
978 |
if (rc == SQLITE_OK) |
|
979 |
{ |
|
111 | 980 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 981 |
rc = sqlite3_step(st); |
982 |
||
116 | 983 |
if (rc != SQLITE_DONE) |
2 | 984 |
{ |
111 | 985 |
User::Leave(KErrUnknown); |
2 | 986 |
} |
111 | 987 |
CleanupStack::PopAndDestroy(); // st |
2 | 988 |
} |
989 |
else |
|
990 |
{ |
|
111 | 991 |
User::Leave(KErrCorrupt); |
2 | 992 |
} |
993 |
} |
|
994 |
||
111 | 995 |
void CShowEngine::DBRemoveAllDownloadsL() |
2 | 996 |
{ |
997 |
DP("CShowEngine::DBRemoveAllDownloads"); |
|
998 |
||
999 |
_LIT(KSqlStatement, "delete from downloads"); |
|
1000 |
iSqlBuffer.Format(KSqlStatement); |
|
1001 |
||
1002 |
sqlite3_stmt *st; |
|
1003 |
||
1004 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1005 |
&st, (const void**) NULL); |
|
1006 |
||
1007 |
if (rc == SQLITE_OK) |
|
1008 |
{ |
|
1009 |
rc = sqlite3_step(st); |
|
1010 |
sqlite3_finalize(st); |
|
1011 |
} |
|
111 | 1012 |
else |
1013 |
{ |
|
1014 |
User::Leave(KErrCorrupt); |
|
1015 |
} |
|
2 | 1016 |
|
1017 |
_LIT(KSqlStatement2, "update shows set downloadstate=0 where downloadstate=1"); |
|
1018 |
iSqlBuffer.Format(KSqlStatement2); |
|
1019 |
||
1020 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, &st, |
|
1021 |
(const void**) NULL); |
|
1022 |
||
1023 |
if (rc == SQLITE_OK) |
|
1024 |
{ |
|
111 | 1025 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 1026 |
rc = sqlite3_step(st); |
116 | 1027 |
if (rc != SQLITE_DONE) |
111 | 1028 |
{ |
1029 |
User::Leave(KErrUnknown); |
|
1030 |
} |
|
1031 |
CleanupStack::PopAndDestroy(); // st |
|
1032 |
} |
|
1033 |
else |
|
1034 |
{ |
|
1035 |
User::Leave(KErrCorrupt); |
|
2 | 1036 |
} |
1037 |
||
1038 |
} |
|
1039 |
||
111 | 1040 |
void CShowEngine::DBRemoveDownloadL(TUint aUid) |
2 | 1041 |
{ |
1042 |
DP("CShowEngine::DBRemoveDownload"); |
|
1043 |
||
1044 |
_LIT(KSqlStatement, "delete from downloads where uid=%u"); |
|
1045 |
iSqlBuffer.Format(KSqlStatement, aUid); |
|
1046 |
||
1047 |
sqlite3_stmt *st; |
|
1048 |
||
1049 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1050 |
&st, (const void**) NULL); |
|
1051 |
||
1052 |
if (rc == SQLITE_OK) |
|
1053 |
{ |
|
111 | 1054 |
Cleanup_sqlite3_finalize_PushL(st); |
2 | 1055 |
rc = sqlite3_step(st); |
116 | 1056 |
if (rc != SQLITE_DONE) |
111 | 1057 |
{ |
1058 |
User::Leave(KErrUnknown); |
|
1059 |
} |
|
1060 |
CleanupStack::PopAndDestroy(); // st |
|
1061 |
} |
|
1062 |
else |
|
1063 |
{ |
|
1064 |
User::Leave(KErrCorrupt); |
|
2 | 1065 |
} |
1066 |
} |
|
1067 |
||
151 | 1068 |
void CShowEngine::DBSwapDownloadsL(TDownload aFirstDL, TDownload aSecondDL) |
1069 |
{ |
|
1070 |
DP("CShowEngine::DBSwapDownloadsL"); |
|
1071 |
_LIT(KSqlStatement, "update downloads set uid=%u where dl_index=%d"); |
|
1072 |
||
1073 |
iSqlBuffer.Format(KSqlStatement, aFirstDL.iUid, aSecondDL.iIndex); |
|
1074 |
sqlite3_stmt *st; |
|
1075 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1076 |
&st, (const void**) NULL); |
|
1077 |
||
1078 |
if (rc == SQLITE_OK) |
|
1079 |
{ |
|
1080 |
Cleanup_sqlite3_finalize_PushL(st); |
|
1081 |
rc = sqlite3_step(st); |
|
1082 |
if (rc != SQLITE_DONE) |
|
1083 |
{ |
|
1084 |
User::Leave(KErrUnknown); |
|
1085 |
} |
|
1086 |
CleanupStack::PopAndDestroy(); // st |
|
1087 |
} |
|
1088 |
else |
|
1089 |
{ |
|
1090 |
User::Leave(KErrCorrupt); |
|
1091 |
} |
|
1092 |
||
1093 |
iSqlBuffer.Format(KSqlStatement, aSecondDL.iUid, aFirstDL.iIndex); |
|
1094 |
||
1095 |
rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1096 |
&st, (const void**) NULL); |
|
1097 |
||
1098 |
if (rc == SQLITE_OK) |
|
1099 |
{ |
|
1100 |
Cleanup_sqlite3_finalize_PushL(st); |
|
1101 |
rc = sqlite3_step(st); |
|
1102 |
if (rc != SQLITE_DONE) |
|
1103 |
{ |
|
1104 |
User::Leave(KErrUnknown); |
|
1105 |
} |
|
1106 |
CleanupStack::PopAndDestroy(); // st |
|
1107 |
} |
|
1108 |
else |
|
1109 |
{ |
|
1110 |
User::Leave(KErrCorrupt); |
|
1111 |
} |
|
1112 |
} |
|
1113 |
||
2 | 1114 |
EXPORT_C CShowInfo* CShowEngine::GetNextShowByTrackL(CShowInfo* aShowInfo) |
1115 |
{ |
|
1116 |
CShowInfo* nextShow = NULL; |
|
1117 |
RShowInfoArray array; |
|
1118 |
DBGetShowsByFeedL(array, aShowInfo->FeedUid()); |
|
1119 |
TUint diff = KMaxTInt; |
|
1120 |
for (TInt loop = 0; loop < array.Count(); loop++) |
|
1121 |
{ |
|
1122 |
if (aShowInfo->TrackNo() < array[loop]->TrackNo()) |
|
1123 |
{ |
|
1124 |
if ((array[loop]->TrackNo() - aShowInfo->TrackNo()) < diff) |
|
1125 |
{ |
|
1126 |
diff = array[loop]->TrackNo() - aShowInfo->TrackNo(); |
|
1127 |
nextShow = array[loop]; |
|
1128 |
} |
|
1129 |
} |
|
1130 |
} |
|
1131 |
array.ResetAndDestroy(); |
|
1132 |
return nextShow; |
|
1133 |
} |
|
1134 |
||
1135 |
TBool CShowEngine::CompareShowsByUid(const CShowInfo &a, const CShowInfo &b) |
|
1136 |
{ |
|
1137 |
return a.Uid() == b.Uid(); |
|
1138 |
} |
|
1139 |
||
1140 |
TInt CShowEngine::CompareShowsByDate(const CShowInfo &a, const CShowInfo &b) |
|
1141 |
{ |
|
1142 |
if (a.PubDate() > b.PubDate()) |
|
1143 |
{ |
|
1144 |
// DP2("Sorting %S less than %S", &a.iTitle, &b.iTitle); |
|
1145 |
return -1; |
|
1146 |
} |
|
1147 |
else if (a.PubDate() == b.PubDate()) |
|
1148 |
{ |
|
1149 |
// DP2("Sorting %S equal to %S", &a.iTitle, &b.iTitle); |
|
1150 |
return 0; |
|
1151 |
} |
|
1152 |
else |
|
1153 |
{ |
|
1154 |
// DP2("Sorting %S greater than %S", &a.iTitle, &b.iTitle); |
|
1155 |
return 1; |
|
1156 |
} |
|
1157 |
} |
|
1158 |
||
1159 |
TInt CShowEngine::CompareShowsByTrackNo(const CShowInfo &a, const CShowInfo &b) |
|
1160 |
{ |
|
1161 |
if (a.TrackNo() < b.TrackNo()) |
|
1162 |
{ |
|
1163 |
return -1; |
|
1164 |
} |
|
1165 |
else if (a.TrackNo() == b.TrackNo()) |
|
1166 |
{ |
|
1167 |
return 0; |
|
1168 |
} |
|
1169 |
else |
|
1170 |
{ |
|
1171 |
return 1; |
|
1172 |
} |
|
1173 |
} |
|
1174 |
||
1175 |
TInt CShowEngine::CompareShowsByTitle(const CShowInfo &a, const CShowInfo &b) |
|
1176 |
{ |
|
1177 |
if (a.Title() < b.Title()) |
|
1178 |
{ |
|
1179 |
// DP2("Sorting %S less than %S", &a.iTitle, &b.iTitle); |
|
1180 |
return -1; |
|
1181 |
} |
|
1182 |
else if (a.Title() == b.Title()) |
|
1183 |
{ |
|
1184 |
// DP2("Sorting %S equal to %S", &a.iTitle, &b.iTitle); |
|
1185 |
return 0; |
|
1186 |
} |
|
1187 |
else |
|
1188 |
{ |
|
1189 |
// DP2("Sorting %S greater than %S", &a.iTitle, &b.iTitle); |
|
1190 |
return 1; |
|
1191 |
} |
|
1192 |
} |
|
1193 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1194 |
EXPORT_C void CShowEngine::DeletePlayedShowsL(RShowInfoArray &aShowInfoArray) |
2 | 1195 |
{ |
1196 |
for (TInt i = 0; i < aShowInfoArray.Count(); i++) |
|
1197 |
{ |
|
1198 |
if (aShowInfoArray[i]->PlayState() == EPlayed |
|
1199 |
&& aShowInfoArray[i]->FileName().Length() > 0) |
|
1200 |
{ |
|
1201 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), aShowInfoArray[i]->FileName()); |
|
1202 |
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
|
1203 |
DBUpdateShowL(*aShowInfoArray[i]); |
2 | 1204 |
} |
1205 |
} |
|
1206 |
} |
|
1207 |
||
1208 |
EXPORT_C void CShowEngine::DeleteAllShowsByFeedL(TUint aFeedUid, TBool aDeleteFiles) |
|
1209 |
{ |
|
1210 |
RShowInfoArray array; |
|
1211 |
DBGetShowsByFeedL(array, aFeedUid); |
|
1212 |
||
1213 |
const TInt count = array.Count(); |
|
1214 |
||
1215 |
for (TInt i = count - 1; i >= 0; i--) |
|
1216 |
{ |
|
53 | 1217 |
if (iShowDownloading && iShowDownloading->Uid() == array[i]->Uid()) |
1218 |
{ |
|
1219 |
// trying to delete the active download |
|
1220 |
RemoveDownloadL(iShowDownloading->Uid()); |
|
1221 |
} |
|
1222 |
||
1223 |
// delete downloaded file |
|
2 | 1224 |
if (array[i]->FileName().Length() > 0) |
1225 |
{ |
|
1226 |
if (aDeleteFiles) |
|
1227 |
{ |
|
1228 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), array[i]->FileName()); |
|
1229 |
} |
|
1230 |
} |
|
1231 |
} |
|
1232 |
array.ResetAndDestroy(); |
|
53 | 1233 |
|
1234 |
// delete all shows from DB |
|
111 | 1235 |
DBDeleteAllShowsByFeedL(aFeedUid); |
53 | 1236 |
|
1237 |
// this will clear out deleted shows from the download queue |
|
1238 |
DBGetAllDownloadsL(array); |
|
1239 |
array.ResetAndDestroy(); |
|
1240 |
||
1241 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1242 |
} |
1243 |
||
111 | 1244 |
EXPORT_C void CShowEngine::DeleteOldShowsByFeedL(TUint aFeedUid) |
2 | 1245 |
{ |
111 | 1246 |
DBDeleteOldShowsByFeedL(aFeedUid); |
2 | 1247 |
} |
1248 |
||
1249 |
EXPORT_C void CShowEngine::DeleteShowL(TUint aShowUid, TBool aRemoveFile) |
|
1250 |
{ |
|
1251 |
||
1252 |
CShowInfo *info = DBGetShowByUidL(aShowUid); |
|
1253 |
||
1254 |
if (info != NULL) |
|
1255 |
{ |
|
1256 |
if (info->FileName().Length() > 0 && aRemoveFile) |
|
1257 |
{ |
|
1258 |
BaflUtils::DeleteFile(iPodcastModel.FsSession(), info->FileName()); |
|
1259 |
} |
|
1260 |
||
1261 |
info->SetDownloadState(ENotDownloaded); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1262 |
DBUpdateShowL(*info); |
2 | 1263 |
delete info; |
1264 |
} |
|
1265 |
} |
|
1266 |
||
1267 |
EXPORT_C void CShowEngine::GetShowsByFeedL(RShowInfoArray& aShowArray, TUint aFeedUid) |
|
1268 |
{ |
|
1269 |
DP("CShowEngine::GetShowsByFeed"); |
|
1270 |
DBGetShowsByFeedL(aShowArray, aFeedUid); |
|
1271 |
} |
|
1272 |
||
1273 |
EXPORT_C void CShowEngine::GetAllShowsL(RShowInfoArray &aArray) |
|
1274 |
{ |
|
1275 |
DP("CShowEngine::GetAllShows"); |
|
1276 |
DBGetAllShowsL(aArray); |
|
1277 |
} |
|
1278 |
||
1279 |
EXPORT_C void CShowEngine::GetShowsDownloadedL(RShowInfoArray &aArray) |
|
1280 |
{ |
|
1281 |
DP("CShowEngine::GetShowsDownloaded"); |
|
1282 |
DBGetDownloadedShowsL(aArray); |
|
1283 |
} |
|
1284 |
||
1285 |
EXPORT_C void CShowEngine::GetNewShowsL(RShowInfoArray &aArray) |
|
1286 |
{ |
|
1287 |
DP("CShowEngine::GetNewShows"); |
|
1288 |
DBGetNewShowsL(aArray); |
|
1289 |
} |
|
1290 |
||
1291 |
EXPORT_C void CShowEngine::GetShowsDownloadingL(RShowInfoArray &aArray) |
|
1292 |
{ |
|
1293 |
DP("CShowEngine::GetShowsDownloading"); |
|
1294 |
DBGetAllDownloadsL(aArray); |
|
1295 |
} |
|
1296 |
||
1297 |
EXPORT_C TInt CShowEngine::GetNumDownloadingShows() |
|
1298 |
{ |
|
116 | 1299 |
TUint count = 0; |
111 | 1300 |
TRAP_IGNORE(count = DBGetDownloadsCountL()); |
1301 |
||
1302 |
return (const TInt) count; |
|
2 | 1303 |
} |
1304 |
||
1305 |
EXPORT_C void CShowEngine::AddDownloadL(CShowInfo& aInfo) |
|
1306 |
{ |
|
1307 |
aInfo.SetDownloadState(EQueued); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1308 |
DBUpdateShowL(aInfo); |
111 | 1309 |
DBAddDownloadL(aInfo.Uid()); |
2 | 1310 |
DownloadNextShowL(); |
1311 |
} |
|
1312 |
||
1313 |
void CShowEngine::DownloadNextShowL() |
|
1314 |
{ |
|
1315 |
DP("CShowEngine::DownloadNextShowL BEGIN"); |
|
1316 |
// Check if we have anything in the download queue |
|
111 | 1317 |
const TInt count = DBGetDownloadsCountL(); |
2 | 1318 |
DP("CShowEngine::DownloadNextShow\tTrying to start new download");DP1("CShowEngine::DownloadNextShow\tShows in download queue %d", count); |
1319 |
||
1320 |
if (count > 0) |
|
1321 |
{ |
|
1322 |
if (iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
1323 |
{ |
|
1324 |
DP("CShowEngine::DownloadNextShow\tDownload process is suspended, ABORTING"); |
|
34 | 1325 |
// Inform the observers |
1326 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1327 |
return; |
1328 |
} |
|
1329 |
else if (iShowClient->IsActive()) |
|
1330 |
{ |
|
1331 |
DP("CShowEngine::DownloadNextShow\tDownload process is already active."); |
|
34 | 1332 |
// Inform the observers |
1333 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1334 |
return; |
1335 |
} |
|
1336 |
else |
|
1337 |
{ |
|
116 | 1338 |
if (iShowDownloading) { |
1339 |
delete iShowDownloading; |
|
1340 |
} |
|
1341 |
||
2 | 1342 |
// Start the download |
116 | 1343 |
iShowDownloading = DBGetNextDownloadL(); |
1344 |
||
1345 |
while(iShowDownloading != NULL) |
|
2 | 1346 |
{ |
116 | 1347 |
DP1("CShowEngine::DownloadNextShow\tDownloading: %S", &(iShowDownloading->Title())); |
1348 |
iShowDownloading->SetDownloadState(EDownloading); |
|
1349 |
iShowDownloading->SetLastError(KErrNone); |
|
1350 |
DBUpdateShowL(*iShowDownloading); |
|
34 | 1351 |
// Inform the observers |
1352 |
// important to do this after we change download state |
|
1353 |
NotifyDownloadQueueUpdatedL(); |
|
1354 |
||
116 | 1355 |
TRAPD(error,GetShowL(iShowDownloading)); |
1356 |
if (error == KErrNone) |
|
2 | 1357 |
{ |
1358 |
break; |
|
1359 |
} |
|
116 | 1360 |
else |
1361 |
{ |
|
1362 |
iShowDownloading->SetDownloadState(EFailedDownload); |
|
1363 |
DBRemoveDownloadL(iShowDownloading->Uid()); |
|
1364 |
DBUpdateShowL(*iShowDownloading); |
|
1365 |
CleanupStack::PopAndDestroy(iShowDownloading); |
|
1366 |
||
1367 |
iShowDownloading = DBGetNextDownloadL(); |
|
1368 |
if(iShowDownloading == NULL) |
|
1369 |
{ |
|
1370 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
1371 |
} |
|
1372 |
} |
|
2 | 1373 |
} |
1374 |
} |
|
1375 |
} |
|
1376 |
else |
|
1377 |
{ |
|
34 | 1378 |
// Inform the observers |
1379 |
NotifyDownloadQueueUpdatedL(); |
|
2 | 1380 |
iShowDownloading = NULL;DP("CShowEngine::DownloadNextShow\tNothing to download"); |
1381 |
} |
|
1382 |
DP("CShowEngine::DownloadNextShowL END"); |
|
1383 |
} |
|
1384 |
||
1385 |
void CShowEngine::NotifyDownloadQueueUpdatedL() |
|
1386 |
{ |
|
1387 |
const TInt count = iObservers.Count(); |
|
1388 |
for (TInt i = 0; i < count; i++) |
|
1389 |
{ |
|
111 | 1390 |
iObservers[i]->DownloadQueueUpdatedL(1, DBGetDownloadsCountL() - 1); |
2 | 1391 |
} |
1392 |
} |
|
1393 |
||
1394 |
void CShowEngine::NotifyShowDownloadUpdatedL(TInt aBytesOfCurrentDownload, TInt aBytesTotal) |
|
1395 |
{ |
|
1396 |
const TInt count = iObservers.Count(); |
|
1397 |
for (TInt i = 0; i < count; i++) |
|
1398 |
{ |
|
1399 |
iObservers[i]->ShowDownloadUpdatedL(aBytesOfCurrentDownload, aBytesTotal); |
|
1400 |
} |
|
1401 |
} |
|
1402 |
||
1403 |
void CShowEngine::NotifyShowFinishedL(TInt aError) |
|
1404 |
{ |
|
1405 |
const TInt count = iObservers.Count(); |
|
1406 |
for (TInt i = 0; i < count; i++) |
|
1407 |
{ |
|
1408 |
iObservers[i]->ShowDownloadFinishedL(iShowDownloading?iShowDownloading->Uid():0, aError); |
|
1409 |
} |
|
1410 |
} |
|
1411 |
||
1412 |
EXPORT_C void CShowEngine::NotifyShowListUpdatedL() |
|
1413 |
{ |
|
1414 |
for (TInt i = 0; i < iObservers.Count(); i++) |
|
1415 |
{ |
|
1416 |
iObservers[i]->ShowListUpdatedL(); |
|
1417 |
} |
|
1418 |
} |
|
1419 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1420 |
void CShowEngine::ReadMetaDataL(CShowInfo& aShowInfo) |
2 | 1421 |
{ |
1422 |
//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
|
1423 |
DBUpdateShowL(aShowInfo); |
2 | 1424 |
} |
1425 |
||
1426 |
void CShowEngine::ReadMetaDataCompleteL() |
|
1427 |
{ |
|
1428 |
NotifyShowListUpdatedL(); |
|
1429 |
MetaDataReader().SetIgnoreTrackNo(EFalse); |
|
1430 |
} |
|
1431 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1432 |
EXPORT_C void CShowEngine::UpdateShowL(CShowInfo& aInfo) |
2 | 1433 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
30
diff
changeset
|
1434 |
DBUpdateShowL(aInfo); |
2 | 1435 |
} |
1436 |
||
1437 |
EXPORT_C CMetaDataReader& CShowEngine::MetaDataReader() |
|
1438 |
{ |
|
1439 |
return *iMetaDataReader; |
|
1440 |
} |
|
1441 |
||
1442 |
void CShowEngine::FileError(TUint /*aError*/) |
|
1443 |
{ |
|
1444 |
iDownloadErrors = KMaxDownloadErrors; |
|
1445 |
} |
|
118
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1446 |
|
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1447 |
EXPORT_C void CShowEngine::CheckForDeletedShows(TUint aFeedUid) |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1448 |
{ |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1449 |
RShowInfoArray shows; |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1450 |
|
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1451 |
TRAPD(err, DBGetShowsByFeedL(shows, aFeedUid)); |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1452 |
|
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1453 |
if (err != KErrNone) |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1454 |
{ |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1455 |
// probably a catastrophic error, but it doesn't |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1456 |
// matter for this method |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1457 |
return; |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1458 |
} |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1459 |
|
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1460 |
for (int i=0;i<shows.Count();i++) |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1461 |
{ |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1462 |
if (shows[i]->DownloadState() == EDownloaded && shows[i]->FileName() != KNullDesC) |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1463 |
{ |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1464 |
if(!BaflUtils::FileExists(iPodcastModel.FsSession(),shows[i]->FileName())) |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1465 |
{ |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1466 |
// file doesn't exist anymore, assume it was deleted from outside |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1467 |
DP1("Show %S does not exist on disk, flagging as non downloaded", &shows[i]->FileName()); |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1468 |
shows[i]->SetDownloadState(ENotDownloaded); |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1469 |
shows[i]->SetPlayState(EPlayed); |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1470 |
TRAP_IGNORE(DBUpdateShowL(*shows[i])); |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1471 |
} |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1472 |
} |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1473 |
} |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1474 |
} |
b03018fb3418
Added method that checks for deleted downloaded files and updates DB accordingly
teknolog
parents:
117
diff
changeset
|
1475 |
|
151 | 1476 |
EXPORT_C void CShowEngine::MoveDownloadUpL(TUint aUid) |
1477 |
{ |
|
1478 |
DP("CShowEngine::MoveDownLoadUpL"); |
|
1479 |
_LIT(KSqlStatement, "select * from downloads"); |
|
1480 |
iSqlBuffer.Format(KSqlStatement); |
|
1481 |
||
1482 |
sqlite3_stmt *st; |
|
1483 |
||
1484 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1485 |
&st, (const void**) NULL); |
|
1486 |
||
1487 |
if (rc == SQLITE_OK) |
|
1488 |
{ |
|
1489 |
RArray<TDownload> downloads; |
|
1490 |
CleanupClosePushL(downloads); |
|
1491 |
||
1492 |
rc = sqlite3_step(st); |
|
1493 |
Cleanup_sqlite3_finalize_PushL(st); |
|
1494 |
||
1495 |
TInt selectedIdx = -1; |
|
1496 |
while (rc == SQLITE_ROW && selectedIdx == -1) |
|
1497 |
{ |
|
1498 |
TDownload download; |
|
1499 |
||
1500 |
download.iIndex = sqlite3_column_int(st, 0); |
|
1501 |
download.iUid = sqlite3_column_int(st, 1); |
|
1502 |
||
1503 |
downloads.Append(download); |
|
1504 |
||
1505 |
if (download.iUid == aUid) |
|
1506 |
{ |
|
1507 |
selectedIdx = downloads.Count()-1; |
|
1508 |
} |
|
1509 |
||
1510 |
rc = sqlite3_step(st); |
|
1511 |
} |
|
1512 |
CleanupStack::PopAndDestroy();//st, downloads |
|
1513 |
||
1514 |
// If the selected download was found in the database |
|
1515 |
if (selectedIdx != -1) |
|
1516 |
{ |
|
1517 |
// Swap the specified download with the one above it |
|
1518 |
TDownload selectedDownload = downloads[selectedIdx]; |
|
1519 |
TDownload previousDownload = downloads[selectedIdx - 1]; |
|
1520 |
||
1521 |
// SQL - Update index (with index of selected download) where uid is of previous download |
|
1522 |
// and update index (with index of previous download) where uid if of selected download |
|
1523 |
DBSwapDownloadsL(selectedDownload, previousDownload); |
|
1524 |
} |
|
1525 |
else |
|
1526 |
{ |
|
1527 |
User::Leave(KErrNotFound); |
|
1528 |
} |
|
1529 |
||
1530 |
CleanupStack::PopAndDestroy(); // downloads |
|
1531 |
} |
|
1532 |
else |
|
1533 |
{ |
|
1534 |
User::Leave(KErrCorrupt); |
|
1535 |
} |
|
1536 |
} |
|
1537 |
||
1538 |
EXPORT_C void CShowEngine::MoveDownloadDownL(TUint aUid) |
|
1539 |
{ |
|
1540 |
DP("CShowEngine::MoveDownLoadDownL"); |
|
1541 |
||
1542 |
// An upside-down list will result in the download moving down |
|
1543 |
_LIT(KSqlStatement, "select * from downloads order by dl_index desc"); |
|
1544 |
iSqlBuffer.Format(KSqlStatement); |
|
1545 |
||
1546 |
sqlite3_stmt *st; |
|
1547 |
||
1548 |
int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
1549 |
&st, (const void**) NULL); |
|
1550 |
||
1551 |
if (rc == SQLITE_OK) |
|
1552 |
{ |
|
1553 |
RArray<TDownload> downloads; |
|
1554 |
CleanupClosePushL(downloads); |
|
1555 |
||
1556 |
rc = sqlite3_step(st); |
|
1557 |
Cleanup_sqlite3_finalize_PushL(st); |
|
1558 |
||
1559 |
TInt selectedIdx = -1; |
|
1560 |
while (rc == SQLITE_ROW && selectedIdx == -1) |
|
1561 |
{ |
|
1562 |
TDownload download; |
|
1563 |
||
1564 |
download.iIndex = sqlite3_column_int(st, 0); |
|
1565 |
download.iUid = sqlite3_column_int(st, 1); |
|
1566 |
||
1567 |
downloads.Append(download); |
|
1568 |
||
1569 |
if (download.iUid == aUid) |
|
1570 |
{ |
|
1571 |
selectedIdx = downloads.Count()-1; |
|
1572 |
} |
|
1573 |
||
1574 |
rc = sqlite3_step(st); |
|
1575 |
} |
|
1576 |
CleanupStack::PopAndDestroy();//st, downloads |
|
1577 |
||
1578 |
// If the selected download was found in the database |
|
1579 |
if (selectedIdx != -1) |
|
1580 |
{ |
|
1581 |
// Swap the specified download with the one above it |
|
1582 |
TDownload selectedDownload = downloads[selectedIdx]; |
|
1583 |
TDownload previousDownload = downloads[selectedIdx - 1]; |
|
1584 |
||
1585 |
// SQL - Update index (with index of selected download) where uid is of previous download |
|
1586 |
// and update index (with index of previous download) where uid if of selected download |
|
1587 |
DBSwapDownloadsL(selectedDownload, previousDownload); |
|
1588 |
} |
|
1589 |
else |
|
1590 |
{ |
|
1591 |
User::Leave(KErrNotFound); |
|
1592 |
} |
|
1593 |
||
1594 |
CleanupStack::PopAndDestroy(); // downloads |
|
1595 |
} |
|
1596 |
else |
|
1597 |
{ |
|
1598 |
User::Leave(KErrCorrupt); |
|
1599 |
} |
|
165
d886725e4499
Fix for 2608 - Title is sometimes not reset to "Podcatcher" after leaving ShowsView
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
1600 |
} |