mpserviceplugins/mpxsqlitedbplugin/src/mpxdbalbum.cpp
changeset 22 ecf06a08d4d9
parent 20 82baf59ce8dd
child 23 d45f4c087764
child 25 3ec52facab4d
child 34 2c5162224003
equal deleted inserted replaced
20:82baf59ce8dd 22:ecf06a08d4d9
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Responsible for interation with the category tables:
       
    15 *                Artist, Album, Genre and Composer
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <sqldb.h>
       
    22 
       
    23 #include <mpxlog.h>
       
    24 
       
    25 #include "mpxdbcommonutil.h"
       
    26 #include "mpxdbcommondef.h"
       
    27 #include "mpxdbmanager.h"
       
    28 
       
    29 #include "mpxcollectiondbdef.h"
       
    30 #include "mpxmediamusicdefs.h"
       
    31 #include "mpxdbpluginqueries.h"
       
    32 #include "mpxdbutil.h"
       
    33 #include "mpxdbalbum.h"
       
    34 
       
    35 // ============================ MEMBER FUNCTIONS ==============================
       
    36 
       
    37 // ----------------------------------------------------------------------------
       
    38 // Two-phased constructor.
       
    39 // ----------------------------------------------------------------------------
       
    40 //
       
    41 CMPXDbAlbum* CMPXDbAlbum::NewL(
       
    42     CMPXDbManager& aDbManager,
       
    43     TMPXGeneralCategory aCategory,
       
    44     MMPXDbAlbumObserver& aObserver)
       
    45     {
       
    46     MPX_FUNC("CMPXDbAlbum::NewL");
       
    47 
       
    48     CMPXDbAlbum* self = CMPXDbAlbum::NewLC(aDbManager, aCategory, aObserver);
       
    49     CleanupStack::Pop(self);
       
    50     return self;
       
    51     }
       
    52 
       
    53 // ----------------------------------------------------------------------------
       
    54 // Two-phased constructor.
       
    55 // ----------------------------------------------------------------------------
       
    56 //
       
    57 CMPXDbAlbum* CMPXDbAlbum::NewLC(
       
    58     CMPXDbManager& aDbManager,
       
    59     TMPXGeneralCategory aCategory,
       
    60     MMPXDbAlbumObserver& aObserver)
       
    61     {
       
    62     MPX_FUNC("CMPXDbAlbum::NewLC");
       
    63 
       
    64     CMPXDbAlbum* self = new (ELeave) CMPXDbAlbum(aDbManager, aCategory, aObserver);
       
    65     CleanupStack::PushL(self);
       
    66     self->ConstructL();
       
    67     return self;
       
    68     }
       
    69 
       
    70 // ----------------------------------------------------------------------------
       
    71 // Destructor
       
    72 // ----------------------------------------------------------------------------
       
    73 //
       
    74 CMPXDbAlbum::~CMPXDbAlbum()
       
    75     {
       
    76     MPX_FUNC("CMPXDbAlbum::~CMPXDbAlbum");
       
    77     }
       
    78 
       
    79 // ----------------------------------------------------------------------------
       
    80 // Constructor
       
    81 // ----------------------------------------------------------------------------
       
    82 //
       
    83 CMPXDbAlbum::CMPXDbAlbum(
       
    84     CMPXDbManager& aDbManager,
       
    85     TMPXGeneralCategory aCategory,
       
    86     MMPXDbAlbumObserver& aObserver) :
       
    87     CMPXDbCategory(aDbManager, aCategory),
       
    88     iObserver(aObserver)
       
    89     {
       
    90     MPX_FUNC("CMPXDbAlbum::CMPXDbAlbum");
       
    91     }
       
    92 
       
    93 // ----------------------------------------------------------------------------
       
    94 // Second phase constructor.
       
    95 // ----------------------------------------------------------------------------
       
    96 //
       
    97 void CMPXDbAlbum::ConstructL()
       
    98     {
       
    99     MPX_FUNC("CMPXDbAlbum::ConstructL");
       
   100 
       
   101     BaseConstructL();
       
   102     }
       
   103 
       
   104 // ----------------------------------------------------------------------------
       
   105 // CMPXDbAlbum::AddItemL
       
   106 // ----------------------------------------------------------------------------
       
   107 //
       
   108 TUint32 CMPXDbAlbum::AddItemL(
       
   109     const TDesC& aName,
       
   110     TUint32 aArtist,
       
   111     const TDesC& aArt,
       
   112     TInt aDriveId,
       
   113     TBool& aNewRecord,
       
   114     TBool aCaseSensitive)
       
   115     {
       
   116     MPX_FUNC("CMPXDbAlbum::AddItemL");
       
   117     
       
   118     // try to find the item first
       
   119     TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), iCategory,
       
   120         aName, aCaseSensitive));
       
   121     aNewRecord = !CategoryItemExistsL(aDriveId, rowId);
       
   122 
       
   123     if (aNewRecord)
       
   124         {      
       
   125         // insert new
       
   126         HBufC* query = PreProcessStringLC(KQueryAlbumInsert);
       
   127         HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(aName);
       
   128 		HBufC* art = MPXDbCommonUtil::ProcessSingleQuotesLC(aArt);
       
   129 
       
   130         iDbManager.ExecuteQueryL(aDriveId, *query, rowId, name, 1, aArtist, art);
       
   131 
       
   132 		CleanupStack::PopAndDestroy(art);
       
   133         CleanupStack::PopAndDestroy(name);
       
   134         CleanupStack::PopAndDestroy(query);
       
   135         }
       
   136     else
       
   137         {
       
   138         // retrieve the existing record
       
   139         HBufC* query = NULL;
       
   140         query = PreProcessStringLC(KQueryCategoryItem);
       
   141         RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, rowId));
       
   142         CleanupStack::PopAndDestroy(query);
       
   143 		
       
   144         CleanupClosePushL(recordset);
       
   145 		
       
   146         if (recordset.Next() != KSqlAtRow)
       
   147             {
       
   148             User::Leave(KErrNotFound);
       
   149 	    }
       
   150 
       
   151         // Artist
       
   152         TUint32 artistId = recordset.ColumnInt64(EAlbumArtist);
       
   153 	    
       
   154         // the current one is Unknown and the new one is Not Unknown.
       
   155         if ( IsUnknownArtistL( artistId ) && !IsUnknownArtistL( aArtist ) )
       
   156             {
       
   157             _LIT( KFormatArtistId, "Artist=%d" );
       
   158             HBufC* setStr = HBufC::NewLC(KFormatArtistId().Length() + KMCIntegerLen);
       
   159             setStr->Des().Format( KFormatArtistId, aArtist );
       
   160         
       
   161             iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, rowId);
       
   162             CleanupStack::PopAndDestroy(setStr);            
       
   163             }
       
   164 	        
       
   165         // Album Art
       
   166         TPtrC art(KNullDesC);
       
   167         art.Set(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArt));
       
   168 	
       
   169         // the current one is Unknown and the new one is Not Unknown
       
   170         if ( art == KNullDesC && aArt != KNullDesC )
       
   171             {
       
   172             _LIT( KFormatArt, "Art=\'%S\'" );
       
   173             HBufC* setStr = HBufC::NewLC(256);
       
   174             setStr->Des().Format( KFormatArt, &aArt );
       
   175             
       
   176             iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, rowId);
       
   177             CleanupStack::PopAndDestroy(setStr);		    
       
   178             }
       
   179 		
       
   180         CleanupStack::PopAndDestroy(&recordset);
       
   181 		
       
   182         // increment the number of songs for the category
       
   183         query = PreProcessStringLC(KQueryCategoryIncrementSongCount);
       
   184         iDbManager.ExecuteQueryL(aDriveId, *query, rowId);
       
   185         CleanupStack::PopAndDestroy(query);
       
   186         }
       
   187 
       
   188     return rowId;
       
   189     }
       
   190 
       
   191 // ----------------------------------------------------------------------------
       
   192 // CMPXDbAlbum::DecrementSongsForCategoryL
       
   193 // ----------------------------------------------------------------------------
       
   194 //
       
   195 void CMPXDbAlbum::DecrementSongsForCategoryL(
       
   196     const TUint32 aId,
       
   197     TInt aDriveId,
       
   198     CMPXMessageArray* aItemChangedMessages,
       
   199     TBool& aItemExist,
       
   200     const TUint32 aArtist)
       
   201     {
       
   202     MPX_FUNC("CMPXDbAlbum::DecrementSongsForCategoryL");
       
   203 
       
   204     // if just one song uses this category. Use <= just in case
       
   205     if (GetSongsCountL(aDriveId, aId) <= 1)
       
   206         {
       
   207         aItemExist = EFalse;
       
   208         // delete the category
       
   209         DeleteCategoryL(aId, aDriveId);
       
   210 
       
   211         if (aItemChangedMessages)
       
   212             {
       
   213             // add the item changed message
       
   214             MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemDeleted,
       
   215                 iCategory, KDBPluginUid);
       
   216             }
       
   217         }
       
   218     else
       
   219         {
       
   220         aItemExist = ETrue;
       
   221         
       
   222         // retrieve the existing record
       
   223         HBufC* query = PreProcessStringLC(KQueryCategoryItem);
       
   224         RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, aId));
       
   225         CleanupStack::PopAndDestroy(query);
       
   226         
       
   227         CleanupClosePushL(recordset);
       
   228         
       
   229         if (recordset.Next() != KSqlAtRow)
       
   230             {
       
   231             User::Leave(KErrNotFound);
       
   232         }
       
   233 
       
   234         TUint32 artistId = recordset.ColumnInt64(EAlbumArtist);
       
   235         
       
   236         CleanupStack::PopAndDestroy(&recordset);
       
   237         
       
   238         // the current artist is equal to deleted song's artist
       
   239         if ( artistId == aArtist )
       
   240             {
       
   241             TUint32 newArtistId = ArtistForAlbumL(aId);
       
   242             
       
   243             _LIT( KFormatArtistId, "Artist=%d" );
       
   244             HBufC* setStr = HBufC::NewLC(KFormatArtistId().Length() + KMCIntegerLen);
       
   245             setStr->Des().Format(KFormatArtistId, newArtistId);
       
   246         
       
   247             iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
       
   248             CleanupStack::PopAndDestroy(setStr);
       
   249             
       
   250             if (aItemChangedMessages)
       
   251                 {
       
   252                 // add the item changed message
       
   253                 MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
       
   254                     iCategory, KDBPluginUid);
       
   255                 }
       
   256             }
       
   257 
       
   258         // decrement the number of songs for the category
       
   259         query = PreProcessStringLC(KQueryCategoryDecrementSongCount);
       
   260         iDbManager.ExecuteQueryL(aDriveId, *query, aId);
       
   261         CleanupStack::PopAndDestroy(query);
       
   262         }
       
   263     }
       
   264 
       
   265 // ----------------------------------------------------------------------------
       
   266 // CMPXDbAlbum::GetAllCategoryItemsL
       
   267 // ----------------------------------------------------------------------------
       
   268 //
       
   269 void CMPXDbAlbum::GetAllCategoryItemsL(
       
   270     const TArray<TMPXAttribute>& aAttrs,
       
   271     CMPXMediaArray& aMediaArray)
       
   272     {
       
   273     MPX_FUNC("CMPXDbAlbum::GetAllCategoryItemsL");
       
   274 
       
   275     HBufC* query = PreProcessStringLC(KQueryAlbumAll);
       
   276     RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query));
       
   277     CleanupStack::PopAndDestroy(query);
       
   278 
       
   279     CleanupClosePushL(recordset);
       
   280     ProcessRecordsetL(aAttrs, recordset, aMediaArray);
       
   281     CleanupStack::PopAndDestroy(&recordset);
       
   282     }
       
   283 
       
   284 // ----------------------------------------------------------------------------
       
   285 // CMPXDbAlbum::UpdateItemL
       
   286 // ----------------------------------------------------------------------------
       
   287 //
       
   288 void CMPXDbAlbum::UpdateItemL(
       
   289     TUint32 aId, 
       
   290     const CMPXMedia& aMedia, 
       
   291     TInt aDriveId, 
       
   292     CMPXMessageArray* aItemChangedMessages)
       
   293 	{
       
   294 	MPX_FUNC("CMPXDbAlbum::UpdateItemL");
       
   295 
       
   296 	CDesCArrayFlat* fields = new (ELeave) CDesCArrayFlat(EAlbumFieldCount);
       
   297 	CleanupStack::PushL(fields);
       
   298 	CDesCArrayFlat* values = new (ELeave) CDesCArrayFlat(EAlbumFieldCount);
       
   299 	CleanupStack::PushL(values);
       
   300 
       
   301 	// process the media parameter and construct the fields and values array
       
   302 	GenerateAlbumFieldsValuesL(aMedia, *fields, *values);
       
   303 
       
   304 	// construct the SET string
       
   305 	HBufC* setStr = MPXDbCommonUtil::StringFromArraysLC(*fields, *values, KMCEqualSign, KMCCommaSign);
       
   306 
       
   307     if (setStr->Length())
       
   308         {
       
   309         // execute the query
       
   310         iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
       
   311 	    TInt oldSongId = (aMedia.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)).iId2;	
       
   312 	    MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
       
   313             EMPXAlbum, KDBPluginUid, oldSongId );
       
   314         }
       
   315 
       
   316 	CleanupStack::PopAndDestroy(setStr);
       
   317 	CleanupStack::PopAndDestroy(values);
       
   318 	CleanupStack::PopAndDestroy(fields);
       
   319 	}
       
   320 
       
   321 // ----------------------------------------------------------------------------
       
   322 // CMPXDbAlbum::GetAlbumsCountForArtistL
       
   323 // ----------------------------------------------------------------------------
       
   324 //
       
   325 TInt CMPXDbAlbum::GetAlbumsCountForArtistL(TUint32 aArtistId)
       
   326 	{
       
   327     RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryCategorySubcategoryItems, aArtistId));
       
   328 
       
   329     TInt prevId(0);
       
   330     TInt count(0);
       
   331 	TInt err(KErrNone);
       
   332 	
       
   333     while ((err = recordset.Next()) == KSqlAtRow)
       
   334 		{
       
   335 		TUint32 rowId(recordset.ColumnInt64(EAlbumUniqueId));
       
   336         if (prevId == rowId)
       
   337             {
       
   338             continue;
       
   339             }
       
   340 		
       
   341 		count++;
       
   342 		prevId = rowId;
       
   343 		}
       
   344 
       
   345     if (err != KSqlAtEnd)
       
   346         {
       
   347         User::Leave(err);
       
   348         }
       
   349 
       
   350 	return count;
       
   351 
       
   352 	}
       
   353 
       
   354 // ----------------------------------------------------------------------------
       
   355 // CMPXDbAlbum::GetSongsCountInAlbumMatchingArtistL
       
   356 // ----------------------------------------------------------------------------
       
   357 //
       
   358 TInt CMPXDbAlbum::GetSongsCountInAlbumMatchingArtistL(TUint32 aArtistId, TUint32 aAlbumId)
       
   359 	{
       
   360 	MPX_FUNC("CMPXDbAlbum::GetSongsCountInAlbumMatchingArtistL");
       
   361 	
       
   362 	return ExecuteSumQueryL(KQuerySongsInArtistAlbum, aArtistId, aAlbumId);
       
   363 	}
       
   364 
       
   365 // ----------------------------------------------------------------------------
       
   366 // CMPXDbAlbum::UpdateMediaL
       
   367 // ----------------------------------------------------------------------------
       
   368 //
       
   369 void CMPXDbAlbum::UpdateMediaL(
       
   370     RSqlStatement& aRecord,
       
   371     const TArray<TMPXAttribute>& aAttrs,
       
   372     CMPXMedia& aMedia)
       
   373     {
       
   374     MPX_FUNC("CMPXDbAlbum::UpdateMediaL");
       
   375 
       
   376     TInt count(aAttrs.Count());
       
   377     for (TInt i = 0; i < count; ++i)
       
   378         {
       
   379         TInt contentId(aAttrs[i].ContentId());
       
   380         TUint attributeId(aAttrs[i].AttributeId());
       
   381 
       
   382         if (contentId == KMPXMediaIdGeneral)
       
   383             {
       
   384             if (attributeId & EMPXMediaGeneralId)
       
   385                 {
       
   386                 MPX_DEBUG1("    EMPXMediaGeneralId");
       
   387                 
       
   388                 aMedia.SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId,
       
   389                     aRecord.ColumnInt64(EAlbumUniqueId));
       
   390                 }
       
   391             if (attributeId & EMPXMediaGeneralTitle)
       
   392                 {
       
   393                 MPX_DEBUG1("    EMPXMediaGeneralTitle");
       
   394                 
       
   395                 TPtrC album( MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumName) );
       
   396                 aMedia.SetTextValueL(KMPXMediaGeneralTitle,
       
   397                     MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumName));
       
   398                 MPX_DEBUG2("	Album[%S]", &album );
       
   399                 }
       
   400             if (attributeId & EMPXMediaGeneralCount)
       
   401                 {
       
   402                 MPX_DEBUG1("    EMPXMediaGeneralCount");
       
   403 
       
   404 				TInt songCount = GetSongsCountL(KDbManagerAllDrives,
       
   405 					aRecord.ColumnInt64(EAlbumUniqueId));
       
   406                 aMedia.SetTObjectValueL<TInt>(KMPXMediaGeneralCount, songCount );
       
   407 				MPX_DEBUG2("	SongCount[%d]", songCount );
       
   408                 }
       
   409             } // end if contentId == KMPXMediaIdGeneral
       
   410 		else if ( contentId == KMPXMediaIdMusic )
       
   411 			{
       
   412 			if (attributeId & EMPXMediaMusicArtist)
       
   413 				{				
       
   414 				MPX_DEBUG1("	EMPXMediaMusicArtist");
       
   415 
       
   416 				TPtrC artistName(KNullDesC);
       
   417 				
       
   418 				// if album is unknown, ignore arist name
       
   419 				if (MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumName) != KNullDesC)
       
   420 					{
       
   421 					artistName.Set(MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumArtistName));
       
   422 					}
       
   423 				
       
   424 				aMedia.SetTextValueL(KMPXMediaMusicArtist, artistName);
       
   425 				MPX_DEBUG2("	Artist[%S]", &artistName);
       
   426 				}
       
   427 			if (attributeId & EMPXMediaMusicAlbumArtFileName)
       
   428 				{
       
   429 				MPX_DEBUG1("	EMPXMediaMusicAlbumArtFileName");
       
   430 
       
   431 				TPtrC art(KNullDesC);
       
   432 				
       
   433 				// if album is unknown, ignore album art name
       
   434 				if (MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumName) != KNullDesC)
       
   435 					{
       
   436 					art.Set(MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumArt));
       
   437 					}
       
   438 				
       
   439 				aMedia.SetTextValueL(KMPXMediaMusicAlbumArtFileName, art);
       
   440 				MPX_DEBUG2("	Art[%S]", &art);
       
   441 				}
       
   442 			}
       
   443 		} // end for
       
   444 
       
   445     aMedia.SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem);
       
   446     aMedia.SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, iCategory);
       
   447     }
       
   448 
       
   449 // ----------------------------------------------------------------------------
       
   450 // CMPXDbAlbum::GenerateAlbumFieldsValuesL
       
   451 // ----------------------------------------------------------------------------
       
   452 //
       
   453 void CMPXDbAlbum::GenerateAlbumFieldsValuesL(const CMPXMedia& aMedia, CDesCArray& aFields, CDesCArray& aValues)
       
   454 	{
       
   455 	if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName))
       
   456 		{
       
   457 		const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen);
       
   458 		MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicArt, albumArtFilename);
       
   459 		}
       
   460 		
       
   461 	if (aMedia.IsSupported(KMPXMediaMusicArtist))
       
   462 	    {
       
   463 	    const TDesC& artistName = aMedia.ValueText(KMPXMediaMusicArtist).Left(KMCMaxTextLen);
       
   464 	    TUint32 artistId = MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), EMPXArtist,
       
   465 	            artistName, ETrue);
       
   466 	    MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicArtist, artistId);	    
       
   467 	    }
       
   468 	}
       
   469 
       
   470 // ----------------------------------------------------------------------------
       
   471 // CMPXDbAlbum::IsUnknownArtistL
       
   472 // ----------------------------------------------------------------------------
       
   473 //
       
   474 TBool CMPXDbAlbum::IsUnknownArtistL(TUint32 aId)
       
   475 	{
       
   476 	return iObserver.HandleIsUnknownArtistL(aId);
       
   477 	}
       
   478 
       
   479 // ----------------------------------------------------------------------------
       
   480 // CMPXDbAlbum::ArtistForAlbumL
       
   481 // ----------------------------------------------------------------------------
       
   482 //
       
   483 TUint32 CMPXDbAlbum::ArtistForAlbumL(const TUint32 aId)
       
   484     {
       
   485     return iObserver.HandleArtistForAlbumL(aId);
       
   486     }
       
   487 
       
   488 // ----------------------------------------------------------------------------
       
   489 // CMPXDbAlbum::CreateTableL
       
   490 // ----------------------------------------------------------------------------
       
   491 //
       
   492 void CMPXDbAlbum::CreateTableL(
       
   493     RSqlDatabase& aDatabase,
       
   494     TBool /* aCorruptTable */)
       
   495     {
       
   496     MPX_FUNC("CMPXDbCategory::CreateTableL");
       
   497 
       
   498     // create the table
       
   499     HBufC* query = PreProcessStringLC(KAlbumCreateTable);
       
   500     User::LeaveIfError(aDatabase.Exec(*query));
       
   501     CleanupStack::PopAndDestroy(query);
       
   502 
       
   503     // do not create an index on the Name field
       
   504     // as it only slows down the insert/update queries overall
       
   505     }
       
   506 
       
   507 // ----------------------------------------------------------------------------
       
   508 // CMPXDbAlbum::CheckTableL
       
   509 // ----------------------------------------------------------------------------
       
   510 //
       
   511 TBool CMPXDbAlbum::CheckTableL(
       
   512     RSqlDatabase& aDatabase)
       
   513     {
       
   514     MPX_FUNC("CMPXDbCategory::CheckTableL");
       
   515 
       
   516     HBufC* query = PreProcessStringLC(KAlbumCheckTable);
       
   517     TBool check(DoCheckTable(aDatabase, *query));
       
   518     CleanupStack::PopAndDestroy(query);
       
   519 
       
   520     return check;
       
   521     }
       
   522 
       
   523 // End of File