--- a/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Wed Mar 31 22:04:35 2010 +0300
@@ -22,6 +22,9 @@
#include "hspsdomdocument.h"
#include "hspsresource.h"
+// ODT version number
+_LIT( KHpspOdtVersion, "3.0" );
+
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
@@ -62,7 +65,6 @@
aTarget.SetThemeFullNameL( aSource.ThemeFullName() );
aTarget.SetThemeShortNameL( aSource.ThemeShortName() );
aTarget.SetThemeVersionL( aSource.ThemeVersion() );
- aTarget.SetPackageVersionL( aSource.PackageVersion() );
aTarget.SetDescriptionL( aSource.Description() );
aTarget.SetLogoFileL( aSource.LogoFile() );
aTarget.SetPreviewFileL( aSource.PreviewFile() );
@@ -126,7 +128,6 @@
delete iThemeFullName;
delete iThemeShortName;
delete iThemeVersion;
- delete iPackageVersion;
// clean up the array
if( iResourceList )
{
@@ -219,14 +220,10 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
void ChspsODT::ExternalizeHeaderL( RWriteStream& aStream ) const
- {
- const TDesC& packageVersion = PackageVersion();
- aStream.WriteInt32L( packageVersion.Length() );
- if( packageVersion.Length() > 0 )
- {
- aStream << packageVersion;
- }
-
+ {
+ aStream.WriteInt32L( KHpspOdtVersion().Length() );
+ aStream << KHpspOdtVersion();
+
aStream.WriteUint32L( iThemeUid );
const TDesC& providerName = ProviderName();
@@ -297,11 +294,8 @@
TInt ChspsODT::HeaderSize() const
{
TInt size = sizeof( TInt32 );
- if( PackageVersion().Length() > 0 )
- {
- size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality.
- size += PackageVersion().Size();
- }
+ size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality.
+ size += KHpspOdtVersion().Size();
size += sizeof( TUint32 ); // iThemeUid
@@ -370,42 +364,18 @@
EXPORT_C void ChspsODT::InternalizeHeaderL( RReadStream& aStream )
{
TInt len = aStream.ReadInt32L();
- HBufC* version = NULL;
- if( len > 0 )
- {
- version = HBufC::NewL( aStream, len );
- }
- CleanupStack::PushL( version );
-
- // Check version request.
- if( iPackageVersion )
+ HBufC* odtVersion = NULL;
+ if ( len > 0 )
{
- TBool supported = ETrue;
- if( version == NULL )
- {
- supported = EFalse;
- }
- else if( version &&
- version->Compare( *iPackageVersion ) != 0 )
- {
- supported = EFalse;
- }
-
- if( !supported )
- {
- // Package version check requested (iPackageVersion defined)
- // and package version not supported
- User::Leave( KErrNotSupported );
- }
+ odtVersion = HBufC::NewL( aStream, len );
}
-
- if( version )
+ CleanupStack::PushL( odtVersion );
+ // ODT version check.
+ if ( KHpspOdtVersion() != *odtVersion )
{
- delete iPackageVersion;
- iPackageVersion = NULL;
- iPackageVersion = version->AllocL();
+ User::Leave( KErrNotSupported );
}
- CleanupStack::PopAndDestroy( version );
+ CleanupStack::PopAndDestroy( odtVersion );
iThemeUid = aStream.ReadUint32L();
@@ -927,42 +897,6 @@
}
// -----------------------------------------------------------------------------
-// ChspsODT::SetPackageVersionL
-// Set package version
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-EXPORT_C void ChspsODT::SetPackageVersionL( const TDesC& aVersion )
- {
- if( iPackageVersion )
- {
- delete iPackageVersion;
- iPackageVersion = NULL;
- }
-
- if( aVersion.Length() != 0 )
- {
- iPackageVersion = aVersion.AllocL();
- }
- }
-
-// -----------------------------------------------------------------------------
-// ChspsODT::PackageVersion
-// Get package version
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-EXPORT_C const TDesC& ChspsODT::PackageVersion() const
- {
- if ( iPackageVersion )
- {
- return *iPackageVersion;
- }
- else
- {
- return KNullDesC;
- }
- }
-
-// -----------------------------------------------------------------------------
// ChspsODT::SetFamily
// -----------------------------------------------------------------------------
EXPORT_C void ChspsODT::SetFamily( const TUint32 aFamilyMask )