mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp
branchRCL_3
changeset 14 943ff5625028
parent 11 13afc0e517bd
child 15 171e07ac910f
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp	Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp	Fri Mar 12 15:42:25 2010 +0200
@@ -483,14 +483,7 @@
 
     if ((aDeprecatedId != 0) && (aId != aDeprecatedId))
         {
-        if ( aCategory == EMPXAlbum && aChangeType == EMPXItemModified )
-            {
-            aMessage.SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aId);
-            }
-        else
-            {
-            aMessage.SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aDeprecatedId);
-            }
+        aMessage.SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aDeprecatedId);
         }
     }
 
@@ -1285,5 +1278,33 @@
     return text;
 	}
 
+// ----------------------------------------------------------------------------
+// Add an album item changed message to the message array
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void MPXDbCommonUtil::AddItemAlbumChangedMessageL(
+    CMPXMessageArray& aMessageArray,
+    TMPXItemId aId,
+    TMPXChangeEventType aChangeType,
+    TMPXGeneralCategory aCategory,
+    TUint aUid,
+    TBool aAlbumArt,
+    TMPXItemId aDeprecatedId)
+    {
+    MPX_FUNC("MPXDbCommonUtil::AddItemChangedMessageL");
+    CMPXMessage* message = CMPXMedia::NewL();
+    CleanupStack::PushL(message);
 
+    FillItemChangedMessageL(*message, aId, aChangeType, aCategory, aUid,
+    		aDeprecatedId );
+    if ( aAlbumArt )
+        {
+        message->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aId);
+        }
+    if (FindItemChangedMessageL(aMessageArray, *message) == KErrNotFound)
+        {
+        aMessageArray.AppendL(*message); // ownership xfer
+        }
+    CleanupStack::PopAndDestroy(message);
+    }
 // End of File