mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp
branchRCL_3
changeset 18 c54d95799c80
parent 15 171e07ac910f
child 26 70a8526f03f2
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp	Wed Mar 31 21:26:33 2010 +0300
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp	Wed Apr 14 15:54:18 2010 +0300
@@ -244,22 +244,24 @@
         if ( artistId == aArtist )
             {
             TUint32 newArtistId = ArtistForAlbumL(aId);
-
-            _LIT( KFormatArtistId, "Artist=%d" );
-            HBufC* setStr = HBufC::NewLC(KFormatArtistId().Length() + KMCIntegerLen);
-            setStr->Des().Format(KFormatArtistId, newArtistId);
+            if ( artistId != newArtistId )
+                {
+                _LIT( KFormatArtistId, "Artist=%d" );
+                HBufC* setStr = HBufC::NewLC(KFormatArtistId().Length() + KMCIntegerLen);
+                setStr->Des().Format(KFormatArtistId, newArtistId);
 
-            iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
-            CleanupStack::PopAndDestroy(setStr);
-
-            if (aItemChangedMessages)
-                {
-                // add the item changed message
-                MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
-                    EMPXAlbum, KDBPluginUid, ETrue, 0 );  
+                iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
+                CleanupStack::PopAndDestroy(setStr);
+                
+                if (aItemChangedMessages)
+                    {
+                    // add the item changed message
+                    MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+                        EMPXAlbum, KDBPluginUid, ETrue, 0 );  
+                    }
                 }
             }
-
+        
         // decrement the number of songs for the category
         query = PreProcessStringLC(KQueryCategoryDecrementSongCount);
         iDbManager.ExecuteQueryL(aDriveId, *query, aId);