242 |
242 |
243 // the current artist is equal to deleted song's artist |
243 // the current artist is equal to deleted song's artist |
244 if ( artistId == aArtist ) |
244 if ( artistId == aArtist ) |
245 { |
245 { |
246 TUint32 newArtistId = ArtistForAlbumL(aId); |
246 TUint32 newArtistId = ArtistForAlbumL(aId); |
247 |
247 if ( artistId != newArtistId ) |
248 _LIT( KFormatArtistId, "Artist=%d" ); |
|
249 HBufC* setStr = HBufC::NewLC(KFormatArtistId().Length() + KMCIntegerLen); |
|
250 setStr->Des().Format(KFormatArtistId, newArtistId); |
|
251 |
|
252 iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId); |
|
253 CleanupStack::PopAndDestroy(setStr); |
|
254 |
|
255 if (aItemChangedMessages) |
|
256 { |
248 { |
257 // add the item changed message |
249 _LIT( KFormatArtistId, "Artist=%d" ); |
258 MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified, |
250 HBufC* setStr = HBufC::NewLC(KFormatArtistId().Length() + KMCIntegerLen); |
259 EMPXAlbum, KDBPluginUid, ETrue, 0 ); |
251 setStr->Des().Format(KFormatArtistId, newArtistId); |
|
252 |
|
253 iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId); |
|
254 CleanupStack::PopAndDestroy(setStr); |
|
255 |
|
256 if (aItemChangedMessages) |
|
257 { |
|
258 // add the item changed message |
|
259 MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified, |
|
260 EMPXAlbum, KDBPluginUid, ETrue, 0 ); |
|
261 } |
260 } |
262 } |
261 } |
263 } |
262 |
264 |
263 // decrement the number of songs for the category |
265 // decrement the number of songs for the category |
264 query = PreProcessStringLC(KQueryCategoryDecrementSongCount); |
266 query = PreProcessStringLC(KQueryCategoryDecrementSongCount); |
265 iDbManager.ExecuteQueryL(aDriveId, *query, aId); |
267 iDbManager.ExecuteQueryL(aDriveId, *query, aId); |
266 CleanupStack::PopAndDestroy(query); |
268 CleanupStack::PopAndDestroy(query); |
267 } |
269 } |