engine/src/PodcastModel.cpp
author Sebastian Brannstrom <sebastianb@symbian.org>
Mon, 22 Nov 2010 15:41:41 +0000
branch3rded
changeset 390 d7abecc9d189
parent 343 9c56bf585696
permissions -rw-r--r--
Catch up with 5th ed; New SIS version 1.10 (1)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     1
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     2
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     3
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     4
* All rights reserved.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     5
* This component and the accompanying materials are made available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     6
* under the terms of the License "Eclipse Public License v1.0"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     7
* which accompanies this distribution, and is available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     9
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    10
* Initial Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    11
* EmbedDev AB - initial contribution.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    12
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    13
* Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    14
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    15
* Description:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    16
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    17
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    18
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    19
#include <commdb.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#include "PodcastModel.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
#include "FeedEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
#include "SettingsEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
#include "ShowEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
#include "connectionengine.h"
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    25
#include "podcastutils.h"
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    26
#include "Podcatcher.pan"
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
#include <bautils.h>
90
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
    28
#include <aknserverapp.h>  // MAknServerAppExitObserver
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
    29
#include <DocumentHandler.h>
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
164
000f9fc147b2 Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 148
diff changeset
    31
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
const TInt KDefaultGranu = 5;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
_LIT(KDBFileName, "podcatcher.sqlite");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
_LIT(KDBTemplateFileName, "podcatcher.sqlite.template");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
EXPORT_C CPodcastModel* CPodcastModel::NewL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
	CPodcastModel* self = new (ELeave) CPodcastModel;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
	CleanupStack::PushL(self);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
	self->ConstructL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
	CleanupStack::Pop(self);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
	return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
CPodcastModel::~CPodcastModel()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
	delete iFeedEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
	delete iSettingsEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
	delete iShowEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
	delete iIapNameArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
	iIapIdArray.Close();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
	delete iSNAPNameArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
	iSNAPIdArray.Close();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
	delete iCommDB;	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
	sqlite3_close(iDB);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
	iFsSession.Close();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
	iActiveShowList.ResetAndDestroy();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
	iActiveShowList.Close();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
	delete iConnectionEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
	delete iImageHandler;
90
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
    64
	delete iDocHandler;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
CPodcastModel::CPodcastModel()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
{	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
void CPodcastModel::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
	DP("CPodcastModel::ConstructL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
	User::LeaveIfError(iFsSession.Connect());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
	iCommDB = CCommsDatabase::NewL (EDatabaseTypeUnspecified);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
	iIapNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
	iSNAPNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu);
164
000f9fc147b2 Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 148
diff changeset
    78
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    79
	iImageHandler = CImageHandler::NewL(FsSession(), *this);
90
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
    80
	iDocHandler = CDocumentHandler::NewL(CEikonEnv::Static()->Process());
164
000f9fc147b2 Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 148
diff changeset
    81
176
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
    82
	UpdateIAPListL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    83
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    84
	iSettingsEngine = CSettingsEngine::NewL(*this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
	iConnectionEngine = CConnectionEngine::NewL(*this);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
	
176
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
    87
	TRAPD(err, OpenDBL());
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    88
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    89
	if (err != KErrNone)
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    90
		{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    91
		ResetDB();
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    92
		
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    93
		TRAP(err, OpenDBL());
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    94
		
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    95
		if (err != KErrNone)
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    96
			{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    97
			Panic(EPodcatcherPanicDB);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    98
			}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
    99
		
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   100
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   101
	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
	iFeedEngine = CFeedEngine::NewL(*this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
	iShowEngine = CShowEngine::NewL(*this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
	DP("CPodcastModel::ConstructL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
EXPORT_C void CPodcastModel::UpdateIAPListL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
	iIapNameArray->Reset();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
	iIapIdArray.Reset();	   
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
	CCommsDbTableView* table = iCommDB->OpenTableLC (TPtrC (IAP)); 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
	TInt ret = table->GotoFirstRecord ();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   117
	TPodcastIAPItem IAPItem;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
	TBuf <KCommsDbSvrMaxFieldLength> bufName;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
	while (ret == KErrNone) // There was a first record
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   120
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   121
		table->ReadUintL(TPtrC(COMMDB_ID), IAPItem.iIapId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
		table->ReadTextL (TPtrC(COMMDB_NAME), bufName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
		table->ReadTextL (TPtrC(IAP_BEARER_TYPE), IAPItem.iBearerType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
		table->ReadTextL (TPtrC(IAP_SERVICE_TYPE), IAPItem.iServiceType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
		iIapIdArray.Append(IAPItem);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
		iIapNameArray->AppendL(bufName); 		 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
		ret = table->GotoNextRecord();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   130
	CleanupStack::PopAndDestroy(); // Close table
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
EXPORT_C void CPodcastModel::UpdateSNAPListL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   134
{
176
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   135
//	DP("CPodcastModel::UpdateSNAPListL BEGIN");
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   136
//	iSNAPNameArray->Reset();
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   137
//	iSNAPIdArray.Reset();
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   138
//	
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   139
//	RCmDestination destination;
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   140
//	TPodcastIAPItem IAPItem;
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   141
//	
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   142
//	RArray<TUint32> destArray;
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   143
//	CleanupClosePushL(destArray);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   144
//	iCmManager.AllDestinationsL(destArray);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   145
//	
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   146
//	TInt cnt = destArray.Count();
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   147
//	DP1("destArray.Count==%d", cnt);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   148
//	for(TInt loop = 0;loop<cnt;loop++)
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   149
//		{
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   150
//		destination = iCmManager.DestinationL (destArray[loop]);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   151
//		CleanupClosePushL(destination);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   152
//		if(!destination.IsHidden())
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   153
//			{
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   154
//			IAPItem.iIapId = destArray[loop];
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   155
//			HBufC* name = destination.NameLC();
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   156
//			DP1(" destination.NameLC==%S", name);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   157
//			iSNAPNameArray->AppendL(*name);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   158
//			CleanupStack::PopAndDestroy(name);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   159
//			iSNAPIdArray.Append(IAPItem);
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   160
//			}
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   161
//		CleanupStack::PopAndDestroy();//close destination
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   162
//		}
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   163
//	CleanupStack::PopAndDestroy();// close destArray
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   164
//
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 164
diff changeset
   165
//	DP("CPodcastModel::UpdateSNAPListL END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   166
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   167
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   168
EXPORT_C CDesCArrayFlat* CPodcastModel::IAPNames()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
	return iIapNameArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   173
EXPORT_C RArray<TPodcastIAPItem>& CPodcastModel::IAPIds()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   174
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
	return iIapIdArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   176
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   177
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   178
EXPORT_C CDesCArrayFlat* CPodcastModel::SNAPNames()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   179
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
	return iSNAPNameArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   181
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
EXPORT_C RArray<TPodcastIAPItem>& CPodcastModel::SNAPIds()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
	return iSNAPIdArray;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
RFs& CPodcastModel::FsSession()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   190
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
	return iFsSession;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
EXPORT_C void CPodcastModel::SetPlayingPodcast(CShowInfo* aPodcast)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
	iPlayingPodcast = aPodcast;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
EXPORT_C CShowInfo* CPodcastModel::PlayingPodcast()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
	return iPlayingPodcast;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   203
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   204
EXPORT_C CFeedEngine& CPodcastModel::FeedEngine()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   205
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   206
	return *iFeedEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   207
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   208
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   209
EXPORT_C CShowEngine& CPodcastModel::ShowEngine()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   210
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
	return *iShowEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
EXPORT_C CSettingsEngine& CPodcastModel::SettingsEngine()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   216
	return *iSettingsEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   218
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
EXPORT_C CConnectionEngine& CPodcastModel::ConnectionEngine()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   220
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
	return *iConnectionEngine;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   223
164
000f9fc147b2 Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 148
diff changeset
   224
EXPORT_C void CPodcastModel::PlayPausePodcastL(CShowInfo* aPodcast, TBool /* aPlayOnInit */) 
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
	{
136
cee38af14bcf Merged show playback error handling from S^3 branch
teknolog
parents: 90
diff changeset
   226
	DP("CPodcastModel::PlayPausePodcastL BEGIN");
90
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   227
	TRAPD(err, LaunchFileEmbeddedL(aPodcast->FileName()));
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   228
	
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   229
	if (err == KErrNone)
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   230
		{
390
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   231
		iShowEngine->PostPlayHandling(aPodcast);
90
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   232
		}
136
cee38af14bcf Merged show playback error handling from S^3 branch
teknolog
parents: 90
diff changeset
   233
	else
cee38af14bcf Merged show playback error handling from S^3 branch
teknolog
parents: 90
diff changeset
   234
		{
cee38af14bcf Merged show playback error handling from S^3 branch
teknolog
parents: 90
diff changeset
   235
		User::Leave(err);
cee38af14bcf Merged show playback error handling from S^3 branch
teknolog
parents: 90
diff changeset
   236
		}
cee38af14bcf Merged show playback error handling from S^3 branch
teknolog
parents: 90
diff changeset
   237
	DP("CPodcastModel::PlayPausePodcastL END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
EXPORT_C CFeedInfo* CPodcastModel::ActiveFeedInfo()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   241
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
	return iActiveFeed;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
EXPORT_C void CPodcastModel::SetActiveFeedInfo(CFeedInfo* aFeedInfo)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   247
	iActiveFeed = aFeedInfo;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   248
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   249
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   250
EXPORT_C RShowInfoArray& CPodcastModel::ActiveShowList()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   251
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   252
	return iActiveShowList;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   254
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   255
void CPodcastModel::SetActiveShowList(RShowInfoArray& aShowArray)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   256
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   257
	iActiveShowList.ResetAndDestroy();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   258
	TInt cnt = aShowArray.Count();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   260
	for(TInt loop = 0;loop < cnt; loop++)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   262
		iActiveShowList.Append(aShowArray[loop]);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   263
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   264
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   265
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   266
EXPORT_C void CPodcastModel::DropDB()
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   267
	{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   268
	if (iDB != NULL)
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   269
		{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   270
		sqlite3_close(iDB);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   271
		iDB = NULL;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   272
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   273
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   274
	TFileName dbFileName;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   275
	dbFileName.Copy(iSettingsEngine->PrivatePath());
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   276
	dbFileName.Append(KDBFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   277
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   278
	// remove the old DB file
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   279
	if (BaflUtils::FileExists(iFsSession, dbFileName))
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   280
		{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   281
		BaflUtils::DeleteFile(iFsSession, dbFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   282
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   283
	}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   284
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   285
void CPodcastModel::ResetDB()
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   286
	{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   287
	DP("CPodcastModel::ResetDB BEGIN");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   288
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   289
	DropDB();
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   290
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   291
	TFileName dbFileName;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   292
	dbFileName.Copy(iSettingsEngine->PrivatePath());
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   293
	dbFileName.Append(KDBFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   294
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   295
	// remove the old DB file
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   296
	if (BaflUtils::FileExists(iFsSession, dbFileName))
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   297
		{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   298
		BaflUtils::DeleteFile(iFsSession, dbFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   299
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   300
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   301
	// copy template to new DB
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   302
	TFileName dbTemplate;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   303
	dbTemplate.Copy(iSettingsEngine->PrivatePath());
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   304
	dbTemplate.Append(KDBTemplateFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   305
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   306
	DP1("Copy template DB from: %S", &dbTemplate);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   307
	DP1("Copy template DB to: %S", &dbFileName);
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   308
	
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   309
	BaflUtils::CopyFile(iFsSession, dbTemplate,dbFileName);
343
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   310
	
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   311
	// important to set this file to not be read only if copying from Z:
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   312
	iFsSession.SetAtt(dbFileName, 0, KEntryAttReadOnly); 
9c56bf585696 Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 176
diff changeset
   313
	
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   314
	iIsFirstStartup = ETrue;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   315
	DP("CPodcastModel::ResetDB END");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   316
	}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   317
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   318
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   319
void CPodcastModel::OpenDBL()
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   320
	{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   321
	DP("CPodcastModel::OpenDBL BEGIN");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   322
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   323
	if (iDB != NULL)
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   324
		{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   325
		sqlite3_close(iDB);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   326
		iDB = NULL;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   327
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   328
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   329
	TFileName dbFileName;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   330
	dbFileName.Copy(iSettingsEngine->PrivatePath());
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   331
	dbFileName.Append(KDBFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   332
		
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   333
	if (!BaflUtils::FileExists(iFsSession, dbFileName))
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   334
		{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   335
		User::Leave(KErrNotFound);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   336
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   337
	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   338
	if (iDB == NULL) {	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   339
		// open DB
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   340
		TBuf8<KMaxFileName> filename8;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   341
		filename8.Copy(dbFileName);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   342
		int rc = sqlite3_open((const char*) filename8.PtrZ(), &iDB);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   343
		if(rc != SQLITE_OK){
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   344
			User::Leave(KErrCorrupt);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   345
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   346
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   347
		// do a test query 
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   348
		sqlite3_stmt *st;
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   349
		rc = sqlite3_prepare_v2(iDB,"select count(*) from feeds" , -1, &st, (const char**) NULL);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   350
		if( rc==SQLITE_OK )
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   351
			{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   352
			Cleanup_sqlite3_finalize_PushL(st);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   353
			rc = sqlite3_step(st);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   354
					
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   355
			if (rc != SQLITE_ROW)
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   356
				{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   357
				User::Leave(KErrCorrupt);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   358
				}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   359
			CleanupStack::PopAndDestroy(); // st
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   360
			}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   361
		else
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   362
			{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   363
			User::Leave(KErrCorrupt);
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   364
			}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   365
		}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   366
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   367
	DP("CPodcastModel::OpenDBL END");	
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   368
	}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   369
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   370
sqlite3* CPodcastModel::DB()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   371
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   372
	return iDB;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   373
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   374
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   375
void CPodcastModel::SetProxyUsageIfNeededL(RHTTPSession& aSession)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   376
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   377
	TBool useProxy = EFalse;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   378
	HBufC* serverName = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   379
	TUint32 port = 0;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   380
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   381
	TRAPD(err,GetProxyInformationForConnectionL(useProxy, serverName, port));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   382
	if (err == KErrNone && useProxy)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   383
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   384
		CleanupStack::PushL(serverName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   385
		TBuf8<128> proxyAddr;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   386
		proxyAddr.Append(*serverName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   387
		proxyAddr.Append(':');
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   388
		proxyAddr.AppendNum(port);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   389
				
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   390
		RStringF prxAddr = aSession.StringPool().OpenFStringL(proxyAddr);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   391
		CleanupClosePushL(prxAddr);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   392
		THTTPHdrVal prxUsage(aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   393
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   394
		aSession.ConnectionInfo().SetPropertyL(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   395
						aSession.StringPool().StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   396
						aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   397
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   398
		aSession.ConnectionInfo().SetPropertyL(aSession.StringPool().StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), prxAddr); 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   399
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   400
		CleanupStack::PopAndDestroy(&prxAddr);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   401
		CleanupStack::PopAndDestroy(serverName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   402
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   403
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   404
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   405
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   406
void CPodcastModel::GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aProxyServerName, TUint32& aPort)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   407
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   408
	TInt iapId = GetIapId();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   409
	CCommsDbTableView* table = iCommDB->OpenViewMatchingUintLC(TPtrC(IAP), TPtrC(COMMDB_ID), iapId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   410
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   411
	TUint32 iapService;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   412
	HBufC* iapServiceType;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   413
	table->ReadUintL(TPtrC(IAP_SERVICE), iapService);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   414
	iapServiceType = table->ReadLongTextLC(TPtrC(IAP_SERVICE_TYPE));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   415
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   416
	CCommsDbTableView* proxyTableView = iCommDB->OpenViewOnProxyRecordLC(iapService, *iapServiceType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   417
	TInt err = proxyTableView->GotoFirstRecord();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   418
	if( err != KErrNone)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   419
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   420
		User::Leave(KErrNotFound);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   421
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   422
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   423
	proxyTableView->ReadBoolL(TPtrC(PROXY_USE_PROXY_SERVER), aIsUsed);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   424
	if(aIsUsed)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   425
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   426
		HBufC* serverName = proxyTableView->ReadLongTextLC(TPtrC(PROXY_SERVER_NAME));
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   427
		proxyTableView->ReadUintL(TPtrC(PROXY_PORT_NUMBER), aPort);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   428
		aProxyServerName = serverName->AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   429
		CleanupStack::PopAndDestroy(serverName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   430
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   431
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   432
	CleanupStack::PopAndDestroy(proxyTableView);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   433
	CleanupStack::PopAndDestroy(iapServiceType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   434
	CleanupStack::PopAndDestroy(table);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   435
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   436
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   437
TInt CPodcastModel::GetIapId()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   438
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   439
	_LIT(KSetting, "IAP\\Id");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   440
	TUint32 iapId = 0;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   441
	iConnectionEngine->Connection().GetIntSetting(KSetting, iapId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   442
	return iapId;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   443
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   444
8
aab3aa4acdd6 Checked all TRAP_IGNORE
teknolog
parents: 2
diff changeset
   445
EXPORT_C void CPodcastModel::GetShowsDownloadingL()
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   446
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   447
	iActiveShowList.ResetAndDestroy();
8
aab3aa4acdd6 Checked all TRAP_IGNORE
teknolog
parents: 2
diff changeset
   448
	iShowEngine->GetShowsDownloadingL(iActiveShowList);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   449
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   450
8
aab3aa4acdd6 Checked all TRAP_IGNORE
teknolog
parents: 2
diff changeset
   451
EXPORT_C void CPodcastModel::GetShowsByFeedL(TUint aFeedUid)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   452
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   453
	iActiveShowList.ResetAndDestroy();
88
f4b512d870e8 Moved call to DeleteOldShowsByFeedL to when a feed is listed. This prevents a race condition which likely caused
teknolog
parents: 67
diff changeset
   454
	iShowEngine->DeleteOldShowsByFeedL(aFeedUid);
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   455
	iShowEngine->CheckForDeletedShows(aFeedUid);
8
aab3aa4acdd6 Checked all TRAP_IGNORE
teknolog
parents: 2
diff changeset
   456
	iShowEngine->GetShowsByFeedL(iActiveShowList, aFeedUid);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   457
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   458
390
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   459
EXPORT_C void CPodcastModel::GetNewShowsL()
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   460
	{
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   461
	iActiveShowList.ResetAndDestroy();
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   462
	iShowEngine->GetNewShowsL(iActiveShowList);
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   463
	}
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   464
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 8
diff changeset
   465
EXPORT_C void CPodcastModel::MarkSelectionPlayedL()
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   466
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   467
	for (int i=0;i<iActiveShowList.Count();i++) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   468
		if(iActiveShowList[i]->PlayState() != EPlayed) {
390
d7abecc9d189 Catch up with 5th ed; New SIS version 1.10 (1)
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 343
diff changeset
   469
			ShowEngine().PostPlayHandling(iActiveShowList[i]);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   470
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   471
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   472
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   473
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   474
TInt CPodcastModel::FindActiveShowByUid(TUint aUid)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   475
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   476
	for (int i=0;i<iActiveShowList.Count();i++) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   477
		if (iActiveShowList[i]->Uid() == aUid) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   478
			return i;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   479
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   480
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   481
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   482
	return KErrNotFound;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   483
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   484
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   485
EXPORT_C TBool CPodcastModel::IsFirstStartup()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   486
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   487
	return iIsFirstStartup;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   488
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   489
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   490
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 32
diff changeset
   491
void CPodcastModel::ImageOperationCompleteL(TInt /*aError*/, TUint /*aHandle*/, CPodcastModel& /*aPodcastModel*/)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   492
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   493
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   494
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   495
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   496
EXPORT_C CImageHandler& CPodcastModel::ImageHandler()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   497
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   498
	return *iImageHandler;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   499
	}
90
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   500
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   501
void CPodcastModel::LaunchFileEmbeddedL(const TDesC& aFilename)
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   502
    {
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   503
    //Set the exit observer so HandleServerAppExit will be called
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   504
    iDocHandler->SetExitObserver(this);   
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   505
 
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   506
    TDataType emptyDataType = TDataType();
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   507
    //Open a file embedded
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   508
    iDocHandler->OpenFileEmbeddedL(aFilename, emptyDataType);             
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   509
    }
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   510
 
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   511
void CPodcastModel::HandleServerAppExit(TInt aReason)
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   512
    {
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   513
    //Handle closing the handler application
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   514
    MAknServerAppExitObserver::HandleServerAppExit(aReason);
d0c0c3e6f7a1 Added support for launching music and video player when tapping on a downloaded show
teknolog
parents: 88
diff changeset
   515
    }
164
000f9fc147b2 Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 148
diff changeset
   516