201033
authorhgs
Tue, 24 Aug 2010 03:36:14 -0500
changeset 51 560ce2306a17
parent 47 4cc1412daed0
child 55 f3930dda3342
201033
app/inc/mpmainwindow.h
app/src/mpglobalpopuphandler.cpp
app/src/mpmainwindow.cpp
inc/mpcollectiondatamodel.h
inc/mpcollectiontbonelistdatamodel.h
inc/mpengine.h
inc/mpmpxcollectiondata.h
inc/mpmpxcollectionviewdefs.h
inc/mpplaybackdata.h
inc/mpviewbase.h
layers.sysdef.xml
mpdata/bwins/mpdatau.def
mpdata/eabi/mpdatau.def
mpdata/inc/mpmpxcollectiondata_p.h
mpdata/src/mpcollectiondatamodel.cpp
mpdata/src/mpcollectiontbonelistdatamodel.cpp
mpdata/src/mpmpxcollectiondata.cpp
mpdata/src/mpmpxcollectiondata_p.cpp
mpdata/src/mpplaybackdata.cpp
mpdata/src/mpsongdata_p.cpp
mpdata/tsrc/unittest_mpcollectiondatamodel/inc/unittest_mpcollectiondatamodel.h
mpdata/tsrc/unittest_mpcollectiondatamodel/src/unittest_mpcollectiondatamodel.cpp
mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h
mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpmpxcollectiondata.cpp
mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_mpmpxcollectiondata.h
mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_mpmpxcollectiondata.cpp
mpengine/bwins/mpengineu.def
mpengine/eabi/mpengineu.def
mpengine/inc/mpmpxplaybackframeworkwrapper.h
mpengine/inc/mpmpxplaybackframeworkwrapper_p.h
mpengine/src/mpengine.cpp
mpengine/src/mpequalizerframeworkwrapper_p.cpp
mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp
mpengine/src/mpmpxisolatedcollectionhelper.cpp
mpengine/src/mpmpxplaybackframeworkwrapper.cpp
mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp
mpengine/tsrc/unittest_mpengine/src/unittest_mpengine.cpp
mpengine/tsrc/unittest_mpequalizerframeworkwrapper/src/unittest_mpequalizerframeworkwrapper.cpp
mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp
mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpmpxcollectiondata.h
mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpmpxcollectiondata.cpp
mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionopenutility.cpp
mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionuihelper.cpp
mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionutility.cpp
mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/src/unittest_mpmpxisolatedcollectionhelper.cpp
mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/stub/src/mpxcollectionopenutility.cpp
mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h
mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp
mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxcollectiondbdef.h
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbalbum.h
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbartist.h
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h
mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbpluginqueries.h
mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp
mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbartist.cpp
mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbcategory.cpp
mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp
mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp
mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp
mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h
mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontaineralbums.h
mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerallsongs.h
mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerartists.h
mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerplaylists.h
mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h
mpviewplugins/mpcollectionviewplugin/resources/musiccollection.docml
mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp
mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp
mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerallsongs.cpp
mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp
mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp
mpviewplugins/mpcollectionviewplugin/src/mpcollectionpopuphandler.cpp
mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp
mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/src/unittest_mpcollectioncontainers.cpp
mpviewplugins/mpdetailsviewplugin/inc/mpdetailsview.h
mpviewplugins/mpdetailsviewplugin/inc/mpquerymanager.h
mpviewplugins/mpdetailsviewplugin/src/mpdetailsview.cpp
mpviewplugins/mpdetailsviewplugin/src/mpquerymanager.cpp
mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp
mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiondatamodel.h
mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiontbonelistdatamodel.h
mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpmpxcollectiondata.h
mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpcollectiondatamodel.cpp
mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpcollectiontbonelistdatamodel.cpp
mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpmpxcollectiondata.cpp
mpviewplugins/mpplaybackviewplugin/inc/mpequalizerwidget.h
mpviewplugins/mpplaybackviewplugin/inc/mpplaybackview.h
mpviewplugins/mpplaybackviewplugin/resources/playbackwidget.docml
mpviewplugins/mpplaybackviewplugin/src/mpequalizerwidget.cpp
mpviewplugins/mpplaybackviewplugin/src/mpplaybackview.cpp
mpviewplugins/mpplaybackviewplugin/src/mpplaybackwidget.cpp
mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/src/unittest_mpequalizerwidget.cpp
mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpengine.cpp
mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpviewbase.h
tsrc/mpfetchertestapp/mpfetchertestapp.pro
utilities/mpnowplayingbanner/src/mpnowplayingwidget_p.cpp
--- a/app/inc/mpmainwindow.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/app/inc/mpmainwindow.h	Tue Aug 24 03:36:14 2010 -0500
@@ -40,7 +40,8 @@
 public:
 
     enum ViewType {
-        CollectionView = 1,
+        NoView = 0,
+        CollectionView,
         PlaybackView,
         SettingsView,
         DetailsView,
@@ -88,6 +89,7 @@
     MpxViewPlugin         *mMediaWallViewPlugin;  // Own
     MpxViewPlugin         *mCurrentViewPlugin;    // Own
     ViewType              mVerticalViewType;
+    ViewType              mPreviousVerticalViewType;
     MusicServices         *mMusicServices;         // Own
     MpGlobalPopupHandler  *mPopupHandler;          // Own
     bool                   mUserExit;
--- a/app/src/mpglobalpopuphandler.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/app/src/mpglobalpopuphandler.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -43,7 +43,6 @@
 const QString KScanFinished = QString( "ScanFinishedDialog" );
 const QString KUnableToContinueDueUSB = QString( "UnableToContinueDueUSB" );
 const QString KUsbBlockingNote = QString( "UsbBlockingNote" );
-const QString KPromptRefresh = QString( "PromptRefresh" );
 const QString KMTPInfoDialog = QString( "MTPInfoDialog" );
 
 // Popups Actions
@@ -317,13 +316,9 @@
 void MpGlobalPopupHandler::launchDiskFullDialog()
 {
     TX_ENTRY
-    QString diskfull;
-    diskfull = hbTrId( "txt_mus_title_refresh_cancelled" );
-    diskfull.append(" ");
-    diskfull.append( hbTrId( "txt_mus_info_out_of_disk_space" ) );
     HbMessageBox *diskFullDialog = new HbMessageBox();
     diskFullDialog->setIcon( HbIcon( QString("qtg_small_fail") ) );
-    diskFullDialog->setText( diskfull );
+    diskFullDialog->setText( hbTrId( "txt_mus_info_out_of_disk_space" ) );
     diskFullDialog->setTimeout( HbPopup::NoTimeout);
     diskFullDialog->setAttribute( Qt::WA_DeleteOnClose );
     diskFullDialog->setObjectName( KDiskFullDialog );
--- a/app/src/mpmainwindow.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/app/src/mpmainwindow.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -58,6 +58,7 @@
       mMediaWallViewPlugin(0),
       mCurrentViewPlugin(0),
       mVerticalViewType( CollectionView ),
+      mPreviousVerticalViewType( NoView ),
       mMusicServices(0),
       mPopupHandler(0),
       mUserExit( false ),
@@ -221,19 +222,22 @@
             lower();
             break;
         case MpCommon::ActivateCollectionView:
-            activateView(CollectionView);
+            activateView( CollectionView );
             break;
         case MpCommon::ActivatePlaybackView:
-            activateView(PlaybackView);
+            activateView( PlaybackView );
             break;
         case MpCommon::ActivateSettingsView:
-            activateView(SettingsView);
+            activateView( SettingsView );
             break;
         case MpCommon::ActivateDetailsView:
-            activateView(DetailsView);
+            activateView( DetailsView );
             break;
         case MpCommon::ActivatePreviousView:
-            activateView(mVerticalViewType);
+            if ( orientation() == Qt::Vertical 
+                    && mPreviousVerticalViewType != NoView ) {
+                activateView( mPreviousVerticalViewType );
+            }
             break;
     }
     TX_EXIT
@@ -248,7 +252,7 @@
             activateView( mVerticalViewType );   
         }
         else {
-            activateView(MediaWallView);
+            activateView( MediaWallView );
         }
 }
 
@@ -281,7 +285,13 @@
     Q_ASSERT( mCurrentViewPlugin );
 
     if ( mCurrentViewPlugin ) {
-        if ( viewType != MediaWallView && viewType != DetailsView ) {
+        if ( viewType != MediaWallView ) {
+            //storing previous vertical view type only if it is not the same
+            //view, this to be able to keep track of the previously activated 
+            //view excluding media wall switching.
+            if ( mVerticalViewType != viewType ) {
+                mPreviousVerticalViewType = mVerticalViewType;
+            }
             mVerticalViewType = viewType;
         }
         addView( reinterpret_cast<HbView*>( mCurrentViewPlugin->getView() ) );
@@ -336,8 +346,7 @@
     }
     else if ( mCollectionViewPlugin && mCurrentViewPlugin != mCollectionViewPlugin ) {
         activateView( CollectionView );
-        MpViewBase* collectionView = reinterpret_cast<MpViewBase*>(mCollectionViewPlugin->getView());
-        collectionView->setDefaultView();
+
     }
 
     TX_EXIT
--- a/inc/mpcollectiondatamodel.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpcollectiondatamodel.h	Tue Aug 24 03:36:14 2010 -0500
@@ -24,6 +24,7 @@
 
 class MpMpxCollectionData;
 class MpCollectionAlbumArtManager;
+class MpPlaybackData;
 
 #if defined(BUILD_MPDATA_LIB)
 #define MPDATA_EXPORT Q_DECL_EXPORT
@@ -37,7 +38,7 @@
    
 public:
 
-    explicit MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent=0 );
+    explicit MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData = 0, QObject *parent=0 );
     virtual ~MpCollectionDataModel();
 
     int rowCount(const QModelIndex &parent=QModelIndex()) const;
@@ -52,6 +53,8 @@
     
     MpMpxCollectionData *collectionData();
     
+    void setLayout(TCollectionLayout layout);
+    
 signals:
 
     void orderChanged( int containerId, int itemId, int itemOrdinal, int newOrdinal );
@@ -63,14 +66,18 @@
     void updateAlbumArt( int index );
     void refreshModel();
     void reloadData();
+    void reloadData( int fromIndex, int toIndex );
+    void fileCorrupted( int songId );     
 
 private:
 
     MpMpxCollectionData             *mCollectionData;       // Not own
+    MpPlaybackData                  *mPlaybackData;         // Not own
     MpCollectionAlbumArtManager     *mAlbumArtManager;      // Own
     int                             mRowCount;
     int                             mAlbumIndexOffset;
     int                             mHiddenItemIndex;
+    TCollectionLayout               mCollectionLayout;
 
 };
 
--- a/inc/mpcollectiontbonelistdatamodel.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpcollectiontbonelistdatamodel.h	Tue Aug 24 03:36:14 2010 -0500
@@ -43,6 +43,7 @@
 
     int rowCount(const QModelIndex &parent=QModelIndex()) const;
     QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
+    void enablePlaybackIndicatorEnable(bool enable);
 
 signals:
 
@@ -54,6 +55,8 @@
     void refreshModel();
     void updateSong();
     void updatePlaybackState();
+    void fileCorrupted(int songId);
+    
 
 private:
 
@@ -62,6 +65,7 @@
     int                             mRowCount;
     int                             mCurrentSongId;
     bool                            mPlaybackActive;
+    bool                            mPlaybackIndicatorEnabled;
 
 };
 
--- a/inc/mpengine.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpengine.h	Tue Aug 24 03:36:14 2010 -0500
@@ -147,6 +147,7 @@
 
     // Playback related
     void volumePropertyChanged( MpCommon::MpVolumeProperty property, int value );
+    void corruptedStop();
 
     // Equalizer related
     void equalizerReady();
--- a/inc/mpmpxcollectiondata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpmpxcollectiondata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -19,6 +19,7 @@
 #define MPMPXCOLLECTIONDATA_H
 
 #include <QObject>
+#include <QAbstractListModel>
 
 #include "mpmpxcollectionviewdefs.h"
 
@@ -50,6 +51,11 @@
         Rating,
         AlbumArtUri
     };
+    
+    enum DataProperty {
+        Corrupted,
+        DrmExpired
+    };
 
     explicit MpMpxCollectionData( QObject *parent=0 );
     virtual ~MpMpxCollectionData();
@@ -74,18 +80,26 @@
     int currentAlbumIndex() const;
     int albumSongsCount() const;
     QString albumSongData( int index, MpMpxCollectionData::DataType type ) const;
+    bool hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
+    bool hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
 
     void setMpxMedia( const CMPXMedia& entries, bool reopen=false );
+    void incrementalOpenUpdate();
     const CMPXMedia& containerMedia();
     void setContext( TCollectionContext context );
     void setAlbumContent( const CMPXMedia& albumContent );
     int itemIndex( int itemUniqueId );
     int albumSongIndex( int songUniqueId );
+    QList<int> songIndex( int songUniqueId );
+    void setCorruptValue(QModelIndex index, bool tBone );
+    void setReloadAlbumContent( bool reloadAlbum );
+
 
 signals:
 
     void contextChanged( TCollectionContext context );
     void dataChanged();
+    void dataChanged( int fromIndex, int toIndex );
     void albumDataChanged();
     void refreshAlbumSongs();
 
--- a/inc/mpmpxcollectionviewdefs.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpmpxcollectionviewdefs.h	Tue Aug 24 03:36:14 2010 -0500
@@ -38,5 +38,12 @@
 // Register so type can be used in signal and slot connection
 Q_DECLARE_METATYPE(TCollectionContext)
 
+// Layout where the collection is being shown.
+enum TCollectionLayout {
+    ECollectionListView = 0,
+    ECollectionSelectionDialog,
+    ECollectionArrangeSongsDialog
+};
+
 #endif  // MPMPXCOLLECTIONVIEWDEFS_H
 
--- a/inc/mpplaybackdata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpplaybackdata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -76,6 +76,7 @@
 
     void commitPlaybackInfo();
     void resetData();
+    void setCorrupted( int id );
     
 
 public slots:
@@ -89,6 +90,7 @@
     void albumArtReady();
     void playbackStateChanged();
     void playbackInfoChanged();
+    void fileCorrupted(int id );
     
 private:
 
--- a/inc/mpviewbase.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/inc/mpviewbase.h	Tue Aug 24 03:36:14 2010 -0500
@@ -30,7 +30,6 @@
 
     void setViewMode(MpCommon::MpViewMode viewMode) { mViewMode = viewMode; }
     MpCommon::MpViewMode viewMode() { return mViewMode; }
-    virtual void setDefaultView() { }
 
 signals:
 
--- a/layers.sysdef.xml	Fri Aug 06 16:51:36 2010 -0500
+++ b/layers.sysdef.xml	Tue Aug 24 03:36:14 2010 -0500
@@ -3,7 +3,7 @@
   <!ENTITY layer_real_source_path "sf/app/musicplayer" >
 ]> 
 
-<SystemDefinition name="avdomain" schema="1.5.1">
+<SystemDefinition name="musicplayer" schema="1.5.1">
 	<systemModel>
   <!-- Common file for prebuild layers-->
   	<layer name="app_layer">
--- a/mpdata/bwins/mpdatau.def	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/bwins/mpdatau.def	Tue Aug 24 03:36:14 2010 -0500
@@ -1,170 +1,184 @@
 EXPORTS
 	?tr@MpMpxCollectionData@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString MpMpxCollectionData::tr(char const *, char const *)
-	?dropMimeData@MpCollectionDataModel@@UAE_NPBVQMimeData@@W4DropAction@Qt@@HHABVQModelIndex@@@Z @ 2 NONAME ; bool MpCollectionDataModel::dropMimeData(class QMimeData const *, enum Qt::DropAction, int, int, class QModelIndex const &)
-	?currentAlbumIndex@MpMpxCollectionData@@QBEHXZ @ 3 NONAME ; int MpMpxCollectionData::currentAlbumIndex(void) const
-	?refreshModel@MpCollectionDataModel@@QAEXXZ @ 4 NONAME ; void MpCollectionDataModel::refreshModel(void)
-	?contextChanged@MpMpxCollectionData@@IAEXW4TCollectionContext@@@Z @ 5 NONAME ; void MpMpxCollectionData::contextChanged(enum TCollectionContext)
-	?mimeData@MpCollectionDataModel@@UBEPAVQMimeData@@ABV?$QList@VQModelIndex@@@@@Z @ 6 NONAME ; class QMimeData * MpCollectionDataModel::mimeData(class QList<class QModelIndex> const &) const
-	?fileName@MpSongData@@QBE?AVQString@@XZ @ 7 NONAME ; class QString MpSongData::fileName(void) const
-	?trUtf8@MpMpxCollectionData@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString MpMpxCollectionData::trUtf8(char const *, char const *, int)
-	?tr@MpMpxCollectionData@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString MpMpxCollectionData::tr(char const *, char const *, int)
-	??_EMpMpxCollectionData@@UAE@I@Z @ 10 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(unsigned int)
-	?qt_metacast@MpCollectionDataModel@@UAEPAXPBD@Z @ 11 NONAME ; void * MpCollectionDataModel::qt_metacast(char const *)
-	?updateAlbumArt@MpCollectionDataModel@@QAEXH@Z @ 12 NONAME ; void MpCollectionDataModel::updateAlbumArt(int)
-	?resetData@MpPlaybackData@@QAEXXZ @ 13 NONAME ; void MpPlaybackData::resetData(void)
-	??_EMpPlaybackData@@UAE@I@Z @ 14 NONAME ; MpPlaybackData::~MpPlaybackData(unsigned int)
-	?metaObject@MpPlaybackData@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * MpPlaybackData::metaObject(void) const
-	?refreshModel@MpCollectionTBoneListDataModel@@QAEXXZ @ 16 NONAME ; void MpCollectionTBoneListDataModel::refreshModel(void)
-	?title@MpSongData@@QBE?AVQString@@XZ @ 17 NONAME ; class QString MpSongData::title(void) const
-	?data@MpCollectionDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 18 NONAME ; class QVariant MpCollectionDataModel::data(class QModelIndex const &, int) const
-	?setAlbumId@MpPlaybackData@@QAE_NH@Z @ 19 NONAME ; bool MpPlaybackData::setAlbumId(int)
-	?mimeType@MpSongData@@QBE?AVQString@@XZ @ 20 NONAME ; class QString MpSongData::mimeType(void) const
-	?removeItem@MpMpxCollectionData@@QAEXH@Z @ 21 NONAME ; void MpMpxCollectionData::removeItem(int)
-	?getStaticMetaObject@MpMpxCollectionData@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & MpMpxCollectionData::getStaticMetaObject(void)
-	?itemCount@MpMpxCollectionData@@QAEHH@Z @ 23 NONAME ; int MpMpxCollectionData::itemCount(int)
-	?isAutoPlaylist@MpMpxCollectionData@@QAE_NH@Z @ 24 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(int)
-	?position@MpPlaybackData@@QBEHXZ @ 25 NONAME ; int MpPlaybackData::position(void) const
-	?setAlbumArtUri@MpPlaybackData@@QAEXABVQString@@@Z @ 26 NONAME ; void MpPlaybackData::setAlbumArtUri(class QString const &)
-	??_EMpCollectionDataModel@@UAE@I@Z @ 27 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(unsigned int)
-	?qt_metacast@MpSongData@@UAEPAXPBD@Z @ 28 NONAME ; void * MpSongData::qt_metacast(char const *)
-	?positionChanged@MpPlaybackData@@IAEXXZ @ 29 NONAME ; void MpPlaybackData::positionChanged(void)
-	?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *, int)
-	?itemIndex@MpMpxCollectionData@@QAEHH@Z @ 31 NONAME ; int MpMpxCollectionData::itemIndex(int)
-	?title@MpPlaybackData@@QBEABVQString@@XZ @ 32 NONAME ; class QString const & MpPlaybackData::title(void) const
-	?qt_metacall@MpCollectionDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 33 NONAME ; int MpCollectionDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?artist@MpSongData@@QBE?AVQString@@XZ @ 34 NONAME ; class QString MpSongData::artist(void) const
-	?setMpxMedia@MpMpxCollectionData@@QAEXABVCMPXMedia@@_N@Z @ 35 NONAME ; void MpMpxCollectionData::setMpxMedia(class CMPXMedia const &, bool)
-	?staticMetaObject@MpSongData@@2UQMetaObject@@B @ 36 NONAME ; struct QMetaObject const MpSongData::staticMetaObject
-	?playbackState@MpPlaybackData@@QBE?AW4SimplifiedState@1@XZ @ 37 NONAME ; enum MpPlaybackData::SimplifiedState MpPlaybackData::playbackState(void) const
-	?tr@MpSongData@@SA?AVQString@@PBD0H@Z @ 38 NONAME ; class QString MpSongData::tr(char const *, char const *, int)
-	?context@MpMpxCollectionData@@QBE?AW4TCollectionContext@@XZ @ 39 NONAME ; enum TCollectionContext MpMpxCollectionData::context(void) const
-	?supportedDropActions@MpCollectionDataModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 40 NONAME ; class QFlags<enum Qt::DropAction> MpCollectionDataModel::supportedDropActions(void) const
-	?setContext@MpMpxCollectionData@@QAEXW4TCollectionContext@@@Z @ 41 NONAME ; void MpMpxCollectionData::setContext(enum TCollectionContext)
-	?durationChanged@MpPlaybackData@@IAEXXZ @ 42 NONAME ; void MpPlaybackData::durationChanged(void)
-	?staticMetaObject@MpPlaybackData@@2UQMetaObject@@B @ 43 NONAME ; struct QMetaObject const MpPlaybackData::staticMetaObject
-	?staticMetaObject@MpCollectionTBoneListDataModel@@2UQMetaObject@@B @ 44 NONAME ; struct QMetaObject const MpCollectionTBoneListDataModel::staticMetaObject
-	?orderChanged@MpCollectionDataModel@@IAEXHHHH@Z @ 45 NONAME ; void MpCollectionDataModel::orderChanged(int, int, int, int)
-	?metaObject@MpCollectionTBoneListDataModel@@UBEPBUQMetaObject@@XZ @ 46 NONAME ; struct QMetaObject const * MpCollectionTBoneListDataModel::metaObject(void) const
-	?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 47 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *)
-	?bitRate@MpSongData@@QBE?AVQString@@XZ @ 48 NONAME ; class QString MpSongData::bitRate(void) const
-	?albumDataAvailable@MpCollectionTBoneListDataModel@@IAEXXZ @ 49 NONAME ; void MpCollectionTBoneListDataModel::albumDataAvailable(void)
-	?setUri@MpPlaybackData@@QAE_NABVQString@@@Z @ 50 NONAME ; bool MpPlaybackData::setUri(class QString const &)
-	?qt_metacast@MpCollectionTBoneListDataModel@@UAEPAXPBD@Z @ 51 NONAME ; void * MpCollectionTBoneListDataModel::qt_metacast(char const *)
-	?removeAlbumArtFile@MpSongData@@QBEXXZ @ 52 NONAME ; void MpSongData::removeAlbumArtFile(void) const
-	?duration@MpSongData@@QBE?AVQString@@XZ @ 53 NONAME ; class QString MpSongData::duration(void) const
-	?qt_metacall@MpCollectionTBoneListDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 54 NONAME ; int MpCollectionTBoneListDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0MpCollectionDataModel@@QAE@PAVMpMpxCollectionData@@PAVQObject@@@Z @ 55 NONAME ; MpCollectionDataModel::MpCollectionDataModel(class MpMpxCollectionData *, class QObject *)
-	?isAutoPlaylist@MpMpxCollectionData@@QAE_NXZ @ 56 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(void)
-	?updatePlaybackState@MpCollectionTBoneListDataModel@@QAEXXZ @ 57 NONAME ; void MpCollectionTBoneListDataModel::updatePlaybackState(void)
-	?setAlbum@MpPlaybackData@@QAE_NABVQString@@@Z @ 58 NONAME ; bool MpPlaybackData::setAlbum(class QString const &)
-	?setCurrentAlbum@MpMpxCollectionData@@QAE_NH@Z @ 59 NONAME ; bool MpMpxCollectionData::setCurrentAlbum(int)
-	?itemId@MpMpxCollectionData@@QAEHH@Z @ 60 NONAME ; int MpMpxCollectionData::itemId(int)
-	?trUtf8@MpSongData@@SA?AVQString@@PBD0H@Z @ 61 NONAME ; class QString MpSongData::trUtf8(char const *, char const *, int)
-	?artist@MpPlaybackData@@QBEABVQString@@XZ @ 62 NONAME ; class QString const & MpPlaybackData::artist(void) const
-	?setContext@MpCollectionDataModel@@QAEXW4TCollectionContext@@@Z @ 63 NONAME ; void MpCollectionDataModel::setContext(enum TCollectionContext)
-	?sampleRate@MpSongData@@QBE?AVQString@@XZ @ 64 NONAME ; class QString MpSongData::sampleRate(void) const
-	?playbackStateChanged@MpPlaybackData@@IAEXXZ @ 65 NONAME ; void MpPlaybackData::playbackStateChanged(void)
-	?copyright@MpSongData@@QBE?AVQString@@XZ @ 66 NONAME ; class QString MpSongData::copyright(void) const
-	?duration@MpPlaybackData@@QBEHXZ @ 67 NONAME ; int MpPlaybackData::duration(void) const
-	?genre@MpSongData@@QBE?AVQString@@XZ @ 68 NONAME ; class QString MpSongData::genre(void) const
-	??0MpCollectionTBoneListDataModel@@QAE@PAVMpMpxCollectionData@@PAVMpPlaybackData@@PAVQObject@@@Z @ 69 NONAME ; MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel(class MpMpxCollectionData *, class MpPlaybackData *, class QObject *)
-	?getStaticMetaObject@MpCollectionDataModel@@SAABUQMetaObject@@XZ @ 70 NONAME ; struct QMetaObject const & MpCollectionDataModel::getStaticMetaObject(void)
-	?setDuration@MpPlaybackData@@QAEXH@Z @ 71 NONAME ; void MpPlaybackData::setDuration(int)
-	?albumDataChanged@MpMpxCollectionData@@IAEXXZ @ 72 NONAME ; void MpMpxCollectionData::albumDataChanged(void)
-	??0MpSongData@@QAE@PAVQObject@@@Z @ 73 NONAME ; MpSongData::MpSongData(class QObject *)
-	?uri@MpPlaybackData@@QBEABVQString@@XZ @ 74 NONAME ; class QString const & MpPlaybackData::uri(void) const
-	?albumArtReady@MpSongData@@IAEXXZ @ 75 NONAME ; void MpSongData::albumArtReady(void)
-	?rowCount@MpCollectionDataModel@@UBEHABVQModelIndex@@@Z @ 76 NONAME ; int MpCollectionDataModel::rowCount(class QModelIndex const &) const
-	?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 77 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *, int)
-	?thumbnailReady@MpPlaybackData@@QAEXABVQPixmap@@PAXHH@Z @ 78 NONAME ; void MpPlaybackData::thumbnailReady(class QPixmap const &, void *, int, int)
-	?staticMetaObject@MpMpxCollectionData@@2UQMetaObject@@B @ 79 NONAME ; struct QMetaObject const MpMpxCollectionData::staticMetaObject
-	?tr@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 80 NONAME ; class QString MpPlaybackData::tr(char const *, char const *, int)
-	?modified@MpSongData@@QBE?AVQString@@XZ @ 81 NONAME ; class QString MpSongData::modified(void) const
-	?setRealAudio@MpPlaybackData@@QAE_N_N@Z @ 82 NONAME ; bool MpPlaybackData::setRealAudio(bool)
-	?qt_metacall@MpMpxCollectionData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 83 NONAME ; int MpMpxCollectionData::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?albumArtReady@MpPlaybackData@@IAEXXZ @ 84 NONAME ; void MpPlaybackData::albumArtReady(void)
-	?album@MpPlaybackData@@QBEABVQString@@XZ @ 85 NONAME ; class QString const & MpPlaybackData::album(void) const
-	?albumSongsCount@MpMpxCollectionData@@QBEHXZ @ 86 NONAME ; int MpMpxCollectionData::albumSongsCount(void) const
-	?count@MpMpxCollectionData@@QBEHXZ @ 87 NONAME ; int MpMpxCollectionData::count(void) const
-	??1MpSongData@@UAE@XZ @ 88 NONAME ; MpSongData::~MpSongData(void)
-	?dataReloaded@MpCollectionDataModel@@IAEXXZ @ 89 NONAME ; void MpCollectionDataModel::dataReloaded(void)
-	?testCachedItem@MpMpxCollectionData@@QAE_NH@Z @ 90 NONAME ; bool MpMpxCollectionData::testCachedItem(int)
-	?setMpxMedia@MpSongData@@QAEXABVCMPXMedia@@@Z @ 91 NONAME ; void MpSongData::setMpxMedia(class CMPXMedia const &)
-	?tr@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 92 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *)
-	?setTitle@MpPlaybackData@@QAE_NABVQString@@@Z @ 93 NONAME ; bool MpPlaybackData::setTitle(class QString const &)
-	?getStaticMetaObject@MpCollectionTBoneListDataModel@@SAABUQMetaObject@@XZ @ 94 NONAME ; struct QMetaObject const & MpCollectionTBoneListDataModel::getStaticMetaObject(void)
-	?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 95 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *)
-	?musicURL@MpSongData@@QBE?AVQString@@XZ @ 96 NONAME ; class QString MpSongData::musicURL(void) const
-	?realAudio@MpPlaybackData@@QAE_NXZ @ 97 NONAME ; bool MpPlaybackData::realAudio(void)
-	?staticMetaObject@MpCollectionDataModel@@2UQMetaObject@@B @ 98 NONAME ; struct QMetaObject const MpCollectionDataModel::staticMetaObject
-	?rowCount@MpCollectionTBoneListDataModel@@UBEHABVQModelIndex@@@Z @ 99 NONAME ; int MpCollectionTBoneListDataModel::rowCount(class QModelIndex const &) const
-	?dataChanged@MpMpxCollectionData@@IAEXXZ @ 100 NONAME ; void MpMpxCollectionData::dataChanged(void)
-	?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *, int)
-	?getStaticMetaObject@MpSongData@@SAABUQMetaObject@@XZ @ 102 NONAME ; struct QMetaObject const & MpSongData::getStaticMetaObject(void)
-	?setItemVisibility@MpCollectionDataModel@@QAEXABVQModelIndex@@_N@Z @ 103 NONAME ; void MpCollectionDataModel::setItemVisibility(class QModelIndex const &, bool)
-	?songDetailInfoChanged@MpSongData@@IAEXXZ @ 104 NONAME ; void MpSongData::songDetailInfoChanged(void)
-	?mimeTypes@MpCollectionDataModel@@UBE?AVQStringList@@XZ @ 105 NONAME ; class QStringList MpCollectionDataModel::mimeTypes(void) const
-	?albumArt@MpSongData@@QBEXAAVHbIcon@@@Z @ 106 NONAME ; void MpSongData::albumArt(class HbIcon &) const
-	?isDrmProtected@MpSongData@@QBE_NXZ @ 107 NONAME ; bool MpSongData::isDrmProtected(void) const
-	?collectionTitle@MpMpxCollectionData@@QBE?AVQString@@XZ @ 108 NONAME ; class QString MpMpxCollectionData::collectionTitle(void) const
-	?albumTrack@MpSongData@@QBE?AVQString@@XZ @ 109 NONAME ; class QString MpSongData::albumTrack(void) const
-	?tr@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 110 NONAME ; class QString MpPlaybackData::tr(char const *, char const *)
-	?qt_metacall@MpPlaybackData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 111 NONAME ; int MpPlaybackData::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?albumSongData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 112 NONAME ; class QString MpMpxCollectionData::albumSongData(int, enum MpMpxCollectionData::DataType) const
-	?playbackInfoChanged@MpSongData@@IAEXXZ @ 113 NONAME ; void MpSongData::playbackInfoChanged(void)
-	?insertCachedItem@MpMpxCollectionData@@QAEXH@Z @ 114 NONAME ; void MpMpxCollectionData::insertCachedItem(int)
-	?setAlbumContent@MpMpxCollectionData@@QAEXABVCMPXMedia@@@Z @ 115 NONAME ; void MpMpxCollectionData::setAlbumContent(class CMPXMedia const &)
-	??0MpMpxCollectionData@@QAE@PAVQObject@@@Z @ 116 NONAME ; MpMpxCollectionData::MpMpxCollectionData(class QObject *)
-	?setArtist@MpPlaybackData@@QAE_NABVQString@@@Z @ 117 NONAME ; bool MpPlaybackData::setArtist(class QString const &)
-	?trUtf8@MpSongData@@SA?AVQString@@PBD0@Z @ 118 NONAME ; class QString MpSongData::trUtf8(char const *, char const *)
-	?albumId@MpPlaybackData@@QAEHXZ @ 119 NONAME ; int MpPlaybackData::albumId(void)
-	??1MpMpxCollectionData@@UAE@XZ @ 120 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(void)
-	??0MpPlaybackData@@QAE@PAVQObject@@@Z @ 121 NONAME ; MpPlaybackData::MpPlaybackData(class QObject *)
-	?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 122 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *, int)
-	?metaObject@MpMpxCollectionData@@UBEPBUQMetaObject@@XZ @ 123 NONAME ; struct QMetaObject const * MpMpxCollectionData::metaObject(void) const
-	?qt_metacast@MpMpxCollectionData@@UAEPAXPBD@Z @ 124 NONAME ; void * MpMpxCollectionData::qt_metacast(char const *)
-	?qt_metacast@MpPlaybackData@@UAEPAXPBD@Z @ 125 NONAME ; void * MpPlaybackData::qt_metacast(char const *)
-	?size@MpSongData@@QBE?AVQString@@XZ @ 126 NONAME ; class QString MpSongData::size(void) const
-	??_EMpSongData@@UAE@I@Z @ 127 NONAME ; MpSongData::~MpSongData(unsigned int)
-	?containerId@MpMpxCollectionData@@QAEHXZ @ 128 NONAME ; int MpMpxCollectionData::containerId(void)
-	?containerMedia@MpMpxCollectionData@@QAEABVCMPXMedia@@XZ @ 129 NONAME ; class CMPXMedia const & MpMpxCollectionData::containerMedia(void)
-	??_EMpCollectionTBoneListDataModel@@UAE@I@Z @ 130 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(unsigned int)
-	??1MpCollectionDataModel@@UAE@XZ @ 131 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(void)
-	?tr@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 132 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *, int)
-	?reloadData@MpCollectionDataModel@@QAEXXZ @ 133 NONAME ; void MpCollectionDataModel::reloadData(void)
-	??1MpCollectionTBoneListDataModel@@UAE@XZ @ 134 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(void)
-	?qt_metacall@MpSongData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 135 NONAME ; int MpSongData::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?reservedLength@MpSongData@@QBEHXZ @ 136 NONAME ; int MpSongData::reservedLength(void) const
-	?collectionData@MpCollectionDataModel@@QAEPAVMpMpxCollectionData@@XZ @ 137 NONAME ; class MpMpxCollectionData * MpCollectionDataModel::collectionData(void)
-	?trUtf8@MpMpxCollectionData@@SA?AVQString@@PBD0@Z @ 138 NONAME ; class QString MpMpxCollectionData::trUtf8(char const *, char const *)
-	?setPosition@MpPlaybackData@@QAEXH@Z @ 139 NONAME ; void MpPlaybackData::setPosition(int)
-	??1MpPlaybackData@@UAE@XZ @ 140 NONAME ; MpPlaybackData::~MpPlaybackData(void)
-	?tr@MpSongData@@SA?AVQString@@PBD0@Z @ 141 NONAME ; class QString MpSongData::tr(char const *, char const *)
-	?refreshAlbumSongs@MpMpxCollectionData@@IAEXXZ @ 142 NONAME ; void MpMpxCollectionData::refreshAlbumSongs(void)
-	?setPlaybackState@MpPlaybackData@@QAEXW4SimplifiedState@1@@Z @ 143 NONAME ; void MpPlaybackData::setPlaybackState(enum MpPlaybackData::SimplifiedState)
-	?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 144 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *)
-	?albumDataChanged@MpCollectionTBoneListDataModel@@IAEXXZ @ 145 NONAME ; void MpCollectionTBoneListDataModel::albumDataChanged(void)
-	?comment@MpSongData@@QBE?AVQString@@XZ @ 146 NONAME ; class QString MpSongData::comment(void) const
-	?year@MpSongData@@QBE?AVQString@@XZ @ 147 NONAME ; class QString MpSongData::year(void) const
-	?data@MpCollectionTBoneListDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 148 NONAME ; class QVariant MpCollectionTBoneListDataModel::data(class QModelIndex const &, int) const
-	?albumSongIndex@MpMpxCollectionData@@QAEHH@Z @ 149 NONAME ; int MpMpxCollectionData::albumSongIndex(int)
-	?getStaticMetaObject@MpPlaybackData@@SAABUQMetaObject@@XZ @ 150 NONAME ; struct QMetaObject const & MpPlaybackData::getStaticMetaObject(void)
-	?composer@MpSongData@@QBE?AVQString@@XZ @ 151 NONAME ; class QString MpSongData::composer(void) const
-	?albumArt@MpPlaybackData@@QBEXAAVHbIcon@@@Z @ 152 NONAME ; void MpPlaybackData::albumArt(class HbIcon &) const
-	?commitPlaybackInfo@MpPlaybackData@@QAEXXZ @ 153 NONAME ; void MpPlaybackData::commitPlaybackInfo(void)
-	?removeRows@MpCollectionDataModel@@UAE_NHHABVQModelIndex@@@Z @ 154 NONAME ; bool MpCollectionDataModel::removeRows(int, int, class QModelIndex const &)
-	?albumSongId@MpMpxCollectionData@@QAEHH@Z @ 155 NONAME ; int MpMpxCollectionData::albumSongId(int)
-	?thumbnailReady@MpSongData@@QAEXVQPixmap@@PAXHH@Z @ 156 NONAME ; void MpSongData::thumbnailReady(class QPixmap, void *, int, int)
-	?id@MpPlaybackData@@QAEHXZ @ 157 NONAME ; int MpPlaybackData::id(void)
-	?album@MpSongData@@QBE?AVQString@@XZ @ 158 NONAME ; class QString MpSongData::album(void) const
-	?albumArtBase64@MpSongData@@QBE?AVQString@@XZ @ 159 NONAME ; class QString MpSongData::albumArtBase64(void) const
-	?playbackInfoChanged@MpPlaybackData@@IAEXXZ @ 160 NONAME ; void MpPlaybackData::playbackInfoChanged(void)
-	?itemData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 161 NONAME ; class QString MpMpxCollectionData::itemData(int, enum MpMpxCollectionData::DataType) const
-	?link@MpSongData@@QBE?AVQString@@XZ @ 162 NONAME ; class QString MpSongData::link(void) const
-	?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 163 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *)
-	?updateSong@MpCollectionTBoneListDataModel@@QAEXXZ @ 164 NONAME ; void MpCollectionTBoneListDataModel::updateSong(void)
-	?setId@MpPlaybackData@@QAE_NH@Z @ 165 NONAME ; bool MpPlaybackData::setId(int)
-	?metaObject@MpCollectionDataModel@@UBEPBUQMetaObject@@XZ @ 166 NONAME ; struct QMetaObject const * MpCollectionDataModel::metaObject(void) const
-	?metaObject@MpSongData@@UBEPBUQMetaObject@@XZ @ 167 NONAME ; struct QMetaObject const * MpSongData::metaObject(void) const
-	?setLink@MpSongData@@QAEXABVQString@@@Z @ 168 NONAME ; void MpSongData::setLink(class QString const &)
+	?setCorrupted@MpPlaybackData@@QAEXH@Z @ 2 NONAME ; void MpPlaybackData::setCorrupted(int)
+	?dropMimeData@MpCollectionDataModel@@UAE_NPBVQMimeData@@W4DropAction@Qt@@HHABVQModelIndex@@@Z @ 3 NONAME ; bool MpCollectionDataModel::dropMimeData(class QMimeData const *, enum Qt::DropAction, int, int, class QModelIndex const &)
+	?currentAlbumIndex@MpMpxCollectionData@@QBEHXZ @ 4 NONAME ; int MpMpxCollectionData::currentAlbumIndex(void) const
+	?refreshModel@MpCollectionDataModel@@QAEXXZ @ 5 NONAME ; void MpCollectionDataModel::refreshModel(void)
+	?contextChanged@MpMpxCollectionData@@IAEXW4TCollectionContext@@@Z @ 6 NONAME ; void MpMpxCollectionData::contextChanged(enum TCollectionContext)
+	?mimeData@MpCollectionDataModel@@UBEPAVQMimeData@@ABV?$QList@VQModelIndex@@@@@Z @ 7 NONAME ; class QMimeData * MpCollectionDataModel::mimeData(class QList<class QModelIndex> const &) const
+	?fileName@MpSongData@@QBE?AVQString@@XZ @ 8 NONAME ; class QString MpSongData::fileName(void) const
+	?trUtf8@MpMpxCollectionData@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString MpMpxCollectionData::trUtf8(char const *, char const *, int)
+	?tr@MpMpxCollectionData@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString MpMpxCollectionData::tr(char const *, char const *, int)
+	??_EMpMpxCollectionData@@UAE@I@Z @ 11 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(unsigned int)
+	?qt_metacast@MpCollectionDataModel@@UAEPAXPBD@Z @ 12 NONAME ; void * MpCollectionDataModel::qt_metacast(char const *)
+	?updateAlbumArt@MpCollectionDataModel@@QAEXH@Z @ 13 NONAME ; void MpCollectionDataModel::updateAlbumArt(int)
+	?resetData@MpPlaybackData@@QAEXXZ @ 14 NONAME ; void MpPlaybackData::resetData(void)
+	??_EMpPlaybackData@@UAE@I@Z @ 15 NONAME ; MpPlaybackData::~MpPlaybackData(unsigned int)
+	?setLink@MpSongData@@QAEXABVQString@@@Z @ 16 NONAME ; void MpSongData::setLink(class QString const &)
+	?metaObject@MpPlaybackData@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * MpPlaybackData::metaObject(void) const
+	?refreshModel@MpCollectionTBoneListDataModel@@QAEXXZ @ 18 NONAME ; void MpCollectionTBoneListDataModel::refreshModel(void)
+	?title@MpSongData@@QBE?AVQString@@XZ @ 19 NONAME ; class QString MpSongData::title(void) const
+	?data@MpCollectionDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 20 NONAME ; class QVariant MpCollectionDataModel::data(class QModelIndex const &, int) const
+	?setAlbumId@MpPlaybackData@@QAE_NH@Z @ 21 NONAME ; bool MpPlaybackData::setAlbumId(int)
+	?mimeType@MpSongData@@QBE?AVQString@@XZ @ 22 NONAME ; class QString MpSongData::mimeType(void) const
+	?removeItem@MpMpxCollectionData@@QAEXH@Z @ 23 NONAME ; void MpMpxCollectionData::removeItem(int)
+	?getStaticMetaObject@MpMpxCollectionData@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & MpMpxCollectionData::getStaticMetaObject(void)
+	?itemCount@MpMpxCollectionData@@QAEHH@Z @ 25 NONAME ; int MpMpxCollectionData::itemCount(int)
+	?isAutoPlaylist@MpMpxCollectionData@@QAE_NH@Z @ 26 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(int)
+	?position@MpPlaybackData@@QBEHXZ @ 27 NONAME ; int MpPlaybackData::position(void) const
+	?setAlbumArtUri@MpPlaybackData@@QAEXABVQString@@@Z @ 28 NONAME ; void MpPlaybackData::setAlbumArtUri(class QString const &)
+	??_EMpCollectionDataModel@@UAE@I@Z @ 29 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(unsigned int)
+	?qt_metacast@MpSongData@@UAEPAXPBD@Z @ 30 NONAME ; void * MpSongData::qt_metacast(char const *)
+	?positionChanged@MpPlaybackData@@IAEXXZ @ 31 NONAME ; void MpPlaybackData::positionChanged(void)
+	?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 32 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *, int)
+	?itemIndex@MpMpxCollectionData@@QAEHH@Z @ 33 NONAME ; int MpMpxCollectionData::itemIndex(int)
+	?title@MpPlaybackData@@QBEABVQString@@XZ @ 34 NONAME ; class QString const & MpPlaybackData::title(void) const
+	?hasAlbumSongProperty@MpMpxCollectionData@@QBE_NHW4DataProperty@1@@Z @ 35 NONAME ; bool MpMpxCollectionData::hasAlbumSongProperty(int, enum MpMpxCollectionData::DataProperty) const
+	?qt_metacall@MpCollectionDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 36 NONAME ; int MpCollectionDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?artist@MpSongData@@QBE?AVQString@@XZ @ 37 NONAME ; class QString MpSongData::artist(void) const
+	?setMpxMedia@MpMpxCollectionData@@QAEXABVCMPXMedia@@_N@Z @ 38 NONAME ; void MpMpxCollectionData::setMpxMedia(class CMPXMedia const &, bool)
+	?staticMetaObject@MpSongData@@2UQMetaObject@@B @ 39 NONAME ; struct QMetaObject const MpSongData::staticMetaObject
+	?playbackState@MpPlaybackData@@QBE?AW4SimplifiedState@1@XZ @ 40 NONAME ; enum MpPlaybackData::SimplifiedState MpPlaybackData::playbackState(void) const
+	?tr@MpSongData@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString MpSongData::tr(char const *, char const *, int)
+	?context@MpMpxCollectionData@@QBE?AW4TCollectionContext@@XZ @ 42 NONAME ; enum TCollectionContext MpMpxCollectionData::context(void) const
+	?supportedDropActions@MpCollectionDataModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 43 NONAME ; class QFlags<enum Qt::DropAction> MpCollectionDataModel::supportedDropActions(void) const
+	?setContext@MpMpxCollectionData@@QAEXW4TCollectionContext@@@Z @ 44 NONAME ; void MpMpxCollectionData::setContext(enum TCollectionContext)
+	?durationChanged@MpPlaybackData@@IAEXXZ @ 45 NONAME ; void MpPlaybackData::durationChanged(void)
+	?staticMetaObject@MpPlaybackData@@2UQMetaObject@@B @ 46 NONAME ; struct QMetaObject const MpPlaybackData::staticMetaObject
+	?staticMetaObject@MpCollectionTBoneListDataModel@@2UQMetaObject@@B @ 47 NONAME ; struct QMetaObject const MpCollectionTBoneListDataModel::staticMetaObject
+	?orderChanged@MpCollectionDataModel@@IAEXHHHH@Z @ 48 NONAME ; void MpCollectionDataModel::orderChanged(int, int, int, int)
+	?metaObject@MpCollectionTBoneListDataModel@@UBEPBUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const * MpCollectionTBoneListDataModel::metaObject(void) const
+	?tr@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 50 NONAME ; class QString MpCollectionTBoneListDataModel::tr(char const *, char const *)
+	?bitRate@MpSongData@@QBE?AVQString@@XZ @ 51 NONAME ; class QString MpSongData::bitRate(void) const
+	?albumDataAvailable@MpCollectionTBoneListDataModel@@IAEXXZ @ 52 NONAME ; void MpCollectionTBoneListDataModel::albumDataAvailable(void)
+	?setUri@MpPlaybackData@@QAE_NABVQString@@@Z @ 53 NONAME ; bool MpPlaybackData::setUri(class QString const &)
+	?qt_metacast@MpCollectionTBoneListDataModel@@UAEPAXPBD@Z @ 54 NONAME ; void * MpCollectionTBoneListDataModel::qt_metacast(char const *)
+	?removeAlbumArtFile@MpSongData@@QBEXXZ @ 55 NONAME ; void MpSongData::removeAlbumArtFile(void) const
+	?duration@MpSongData@@QBE?AVQString@@XZ @ 56 NONAME ; class QString MpSongData::duration(void) const
+	?qt_metacall@MpCollectionTBoneListDataModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 57 NONAME ; int MpCollectionTBoneListDataModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?isAutoPlaylist@MpMpxCollectionData@@QAE_NXZ @ 58 NONAME ; bool MpMpxCollectionData::isAutoPlaylist(void)
+	?updatePlaybackState@MpCollectionTBoneListDataModel@@QAEXXZ @ 59 NONAME ; void MpCollectionTBoneListDataModel::updatePlaybackState(void)
+	?setReloadAlbumContent@MpMpxCollectionData@@QAEX_N@Z @ 60 NONAME ; void MpMpxCollectionData::setReloadAlbumContent(bool)
+	?setAlbum@MpPlaybackData@@QAE_NABVQString@@@Z @ 61 NONAME ; bool MpPlaybackData::setAlbum(class QString const &)
+	?setCurrentAlbum@MpMpxCollectionData@@QAE_NH@Z @ 62 NONAME ; bool MpMpxCollectionData::setCurrentAlbum(int)
+	?itemId@MpMpxCollectionData@@QAEHH@Z @ 63 NONAME ; int MpMpxCollectionData::itemId(int)
+	?trUtf8@MpSongData@@SA?AVQString@@PBD0H@Z @ 64 NONAME ; class QString MpSongData::trUtf8(char const *, char const *, int)
+	?artist@MpPlaybackData@@QBEABVQString@@XZ @ 65 NONAME ; class QString const & MpPlaybackData::artist(void) const
+	?setContext@MpCollectionDataModel@@QAEXW4TCollectionContext@@@Z @ 66 NONAME ; void MpCollectionDataModel::setContext(enum TCollectionContext)
+	?sampleRate@MpSongData@@QBE?AVQString@@XZ @ 67 NONAME ; class QString MpSongData::sampleRate(void) const
+	?playbackStateChanged@MpPlaybackData@@IAEXXZ @ 68 NONAME ; void MpPlaybackData::playbackStateChanged(void)
+	?copyright@MpSongData@@QBE?AVQString@@XZ @ 69 NONAME ; class QString MpSongData::copyright(void) const
+	?duration@MpPlaybackData@@QBEHXZ @ 70 NONAME ; int MpPlaybackData::duration(void) const
+	?genre@MpSongData@@QBE?AVQString@@XZ @ 71 NONAME ; class QString MpSongData::genre(void) const
+	??0MpCollectionTBoneListDataModel@@QAE@PAVMpMpxCollectionData@@PAVMpPlaybackData@@PAVQObject@@@Z @ 72 NONAME ; MpCollectionTBoneListDataModel::MpCollectionTBoneListDataModel(class MpMpxCollectionData *, class MpPlaybackData *, class QObject *)
+	?getStaticMetaObject@MpCollectionDataModel@@SAABUQMetaObject@@XZ @ 73 NONAME ; struct QMetaObject const & MpCollectionDataModel::getStaticMetaObject(void)
+	?setDuration@MpPlaybackData@@QAEXH@Z @ 74 NONAME ; void MpPlaybackData::setDuration(int)
+	?albumDataChanged@MpMpxCollectionData@@IAEXXZ @ 75 NONAME ; void MpMpxCollectionData::albumDataChanged(void)
+	??0MpSongData@@QAE@PAVQObject@@@Z @ 76 NONAME ; MpSongData::MpSongData(class QObject *)
+	?uri@MpPlaybackData@@QBEABVQString@@XZ @ 77 NONAME ; class QString const & MpPlaybackData::uri(void) const
+	?albumArtReady@MpSongData@@IAEXXZ @ 78 NONAME ; void MpSongData::albumArtReady(void)
+	?rowCount@MpCollectionDataModel@@UBEHABVQModelIndex@@@Z @ 79 NONAME ; int MpCollectionDataModel::rowCount(class QModelIndex const &) const
+	?fileCorrupted@MpPlaybackData@@IAEXH@Z @ 80 NONAME ; void MpPlaybackData::fileCorrupted(int)
+	?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 81 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *, int)
+	?thumbnailReady@MpPlaybackData@@QAEXABVQPixmap@@PAXHH@Z @ 82 NONAME ; void MpPlaybackData::thumbnailReady(class QPixmap const &, void *, int, int)
+	?staticMetaObject@MpMpxCollectionData@@2UQMetaObject@@B @ 83 NONAME ; struct QMetaObject const MpMpxCollectionData::staticMetaObject
+	?tr@MpPlaybackData@@SA?AVQString@@PBD0H@Z @ 84 NONAME ; class QString MpPlaybackData::tr(char const *, char const *, int)
+	?modified@MpSongData@@QBE?AVQString@@XZ @ 85 NONAME ; class QString MpSongData::modified(void) const
+	?setRealAudio@MpPlaybackData@@QAE_N_N@Z @ 86 NONAME ; bool MpPlaybackData::setRealAudio(bool)
+	?qt_metacall@MpMpxCollectionData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 87 NONAME ; int MpMpxCollectionData::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?albumArtReady@MpPlaybackData@@IAEXXZ @ 88 NONAME ; void MpPlaybackData::albumArtReady(void)
+	?album@MpPlaybackData@@QBEABVQString@@XZ @ 89 NONAME ; class QString const & MpPlaybackData::album(void) const
+	?albumSongsCount@MpMpxCollectionData@@QBEHXZ @ 90 NONAME ; int MpMpxCollectionData::albumSongsCount(void) const
+	??0MpCollectionDataModel@@QAE@PAVMpMpxCollectionData@@PAVMpPlaybackData@@PAVQObject@@@Z @ 91 NONAME ; MpCollectionDataModel::MpCollectionDataModel(class MpMpxCollectionData *, class MpPlaybackData *, class QObject *)
+	?count@MpMpxCollectionData@@QBEHXZ @ 92 NONAME ; int MpMpxCollectionData::count(void) const
+	??1MpSongData@@UAE@XZ @ 93 NONAME ; MpSongData::~MpSongData(void)
+	?dataReloaded@MpCollectionDataModel@@IAEXXZ @ 94 NONAME ; void MpCollectionDataModel::dataReloaded(void)
+	?hasItemProperty@MpMpxCollectionData@@QBE_NHW4DataProperty@1@@Z @ 95 NONAME ; bool MpMpxCollectionData::hasItemProperty(int, enum MpMpxCollectionData::DataProperty) const
+	?testCachedItem@MpMpxCollectionData@@QAE_NH@Z @ 96 NONAME ; bool MpMpxCollectionData::testCachedItem(int)
+	?setMpxMedia@MpSongData@@QAEXABVCMPXMedia@@@Z @ 97 NONAME ; void MpSongData::setMpxMedia(class CMPXMedia const &)
+	?tr@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 98 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *)
+	?setTitle@MpPlaybackData@@QAE_NABVQString@@@Z @ 99 NONAME ; bool MpPlaybackData::setTitle(class QString const &)
+	?getStaticMetaObject@MpCollectionTBoneListDataModel@@SAABUQMetaObject@@XZ @ 100 NONAME ; struct QMetaObject const & MpCollectionTBoneListDataModel::getStaticMetaObject(void)
+	?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *)
+	?musicURL@MpSongData@@QBE?AVQString@@XZ @ 102 NONAME ; class QString MpSongData::musicURL(void) const
+	?realAudio@MpPlaybackData@@QAE_NXZ @ 103 NONAME ; bool MpPlaybackData::realAudio(void)
+	?staticMetaObject@MpCollectionDataModel@@2UQMetaObject@@B @ 104 NONAME ; struct QMetaObject const MpCollectionDataModel::staticMetaObject
+	?rowCount@MpCollectionTBoneListDataModel@@UBEHABVQModelIndex@@@Z @ 105 NONAME ; int MpCollectionTBoneListDataModel::rowCount(class QModelIndex const &) const
+	?setCorruptValue@MpMpxCollectionData@@QAEXVQModelIndex@@_N@Z @ 106 NONAME ; void MpMpxCollectionData::setCorruptValue(class QModelIndex, bool)
+	?dataChanged@MpMpxCollectionData@@IAEXXZ @ 107 NONAME ; void MpMpxCollectionData::dataChanged(void)
+	?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0H@Z @ 108 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *, int)
+	?getStaticMetaObject@MpSongData@@SAABUQMetaObject@@XZ @ 109 NONAME ; struct QMetaObject const & MpSongData::getStaticMetaObject(void)
+	?setItemVisibility@MpCollectionDataModel@@QAEXABVQModelIndex@@_N@Z @ 110 NONAME ; void MpCollectionDataModel::setItemVisibility(class QModelIndex const &, bool)
+	?songDetailInfoChanged@MpSongData@@IAEXXZ @ 111 NONAME ; void MpSongData::songDetailInfoChanged(void)
+	?mimeTypes@MpCollectionDataModel@@UBE?AVQStringList@@XZ @ 112 NONAME ; class QStringList MpCollectionDataModel::mimeTypes(void) const
+	?albumArt@MpSongData@@QBEXAAVHbIcon@@@Z @ 113 NONAME ; void MpSongData::albumArt(class HbIcon &) const
+	?isDrmProtected@MpSongData@@QBE_NXZ @ 114 NONAME ; bool MpSongData::isDrmProtected(void) const
+	?collectionTitle@MpMpxCollectionData@@QBE?AVQString@@XZ @ 115 NONAME ; class QString MpMpxCollectionData::collectionTitle(void) const
+	?albumTrack@MpSongData@@QBE?AVQString@@XZ @ 116 NONAME ; class QString MpSongData::albumTrack(void) const
+	?tr@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 117 NONAME ; class QString MpPlaybackData::tr(char const *, char const *)
+	?qt_metacall@MpPlaybackData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 118 NONAME ; int MpPlaybackData::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?albumSongData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 119 NONAME ; class QString MpMpxCollectionData::albumSongData(int, enum MpMpxCollectionData::DataType) const
+	?playbackInfoChanged@MpSongData@@IAEXXZ @ 120 NONAME ; void MpSongData::playbackInfoChanged(void)
+	?insertCachedItem@MpMpxCollectionData@@QAEXH@Z @ 121 NONAME ; void MpMpxCollectionData::insertCachedItem(int)
+	?setAlbumContent@MpMpxCollectionData@@QAEXABVCMPXMedia@@@Z @ 122 NONAME ; void MpMpxCollectionData::setAlbumContent(class CMPXMedia const &)
+	?enablePlaybackIndicatorEnable@MpCollectionTBoneListDataModel@@QAEX_N@Z @ 123 NONAME ; void MpCollectionTBoneListDataModel::enablePlaybackIndicatorEnable(bool)
+	??0MpMpxCollectionData@@QAE@PAVQObject@@@Z @ 124 NONAME ; MpMpxCollectionData::MpMpxCollectionData(class QObject *)
+	?setArtist@MpPlaybackData@@QAE_NABVQString@@@Z @ 125 NONAME ; bool MpPlaybackData::setArtist(class QString const &)
+	?trUtf8@MpSongData@@SA?AVQString@@PBD0@Z @ 126 NONAME ; class QString MpSongData::trUtf8(char const *, char const *)
+	?fileCorrupted@MpCollectionTBoneListDataModel@@QAEXH@Z @ 127 NONAME ; void MpCollectionTBoneListDataModel::fileCorrupted(int)
+	?albumId@MpPlaybackData@@QAEHXZ @ 128 NONAME ; int MpPlaybackData::albumId(void)
+	??1MpMpxCollectionData@@UAE@XZ @ 129 NONAME ; MpMpxCollectionData::~MpMpxCollectionData(void)
+	??0MpPlaybackData@@QAE@PAVQObject@@@Z @ 130 NONAME ; MpPlaybackData::MpPlaybackData(class QObject *)
+	?trUtf8@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 131 NONAME ; class QString MpCollectionDataModel::trUtf8(char const *, char const *, int)
+	?metaObject@MpMpxCollectionData@@UBEPBUQMetaObject@@XZ @ 132 NONAME ; struct QMetaObject const * MpMpxCollectionData::metaObject(void) const
+	?qt_metacast@MpMpxCollectionData@@UAEPAXPBD@Z @ 133 NONAME ; void * MpMpxCollectionData::qt_metacast(char const *)
+	?qt_metacast@MpPlaybackData@@UAEPAXPBD@Z @ 134 NONAME ; void * MpPlaybackData::qt_metacast(char const *)
+	?size@MpSongData@@QBE?AVQString@@XZ @ 135 NONAME ; class QString MpSongData::size(void) const
+	??_EMpSongData@@UAE@I@Z @ 136 NONAME ; MpSongData::~MpSongData(unsigned int)
+	?containerId@MpMpxCollectionData@@QAEHXZ @ 137 NONAME ; int MpMpxCollectionData::containerId(void)
+	?containerMedia@MpMpxCollectionData@@QAEABVCMPXMedia@@XZ @ 138 NONAME ; class CMPXMedia const & MpMpxCollectionData::containerMedia(void)
+	??_EMpCollectionTBoneListDataModel@@UAE@I@Z @ 139 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(unsigned int)
+	??1MpCollectionDataModel@@UAE@XZ @ 140 NONAME ; MpCollectionDataModel::~MpCollectionDataModel(void)
+	?fileCorrupted@MpCollectionDataModel@@QAEXH@Z @ 141 NONAME ; void MpCollectionDataModel::fileCorrupted(int)
+	?tr@MpCollectionDataModel@@SA?AVQString@@PBD0H@Z @ 142 NONAME ; class QString MpCollectionDataModel::tr(char const *, char const *, int)
+	?reloadData@MpCollectionDataModel@@QAEXXZ @ 143 NONAME ; void MpCollectionDataModel::reloadData(void)
+	??1MpCollectionTBoneListDataModel@@UAE@XZ @ 144 NONAME ; MpCollectionTBoneListDataModel::~MpCollectionTBoneListDataModel(void)
+	?qt_metacall@MpSongData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 145 NONAME ; int MpSongData::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?reservedLength@MpSongData@@QBEHXZ @ 146 NONAME ; int MpSongData::reservedLength(void) const
+	?collectionData@MpCollectionDataModel@@QAEPAVMpMpxCollectionData@@XZ @ 147 NONAME ; class MpMpxCollectionData * MpCollectionDataModel::collectionData(void)
+	?trUtf8@MpMpxCollectionData@@SA?AVQString@@PBD0@Z @ 148 NONAME ; class QString MpMpxCollectionData::trUtf8(char const *, char const *)
+	?setPosition@MpPlaybackData@@QAEXH@Z @ 149 NONAME ; void MpPlaybackData::setPosition(int)
+	??1MpPlaybackData@@UAE@XZ @ 150 NONAME ; MpPlaybackData::~MpPlaybackData(void)
+	?tr@MpSongData@@SA?AVQString@@PBD0@Z @ 151 NONAME ; class QString MpSongData::tr(char const *, char const *)
+	?setPlaybackState@MpPlaybackData@@QAEXW4SimplifiedState@1@@Z @ 152 NONAME ; void MpPlaybackData::setPlaybackState(enum MpPlaybackData::SimplifiedState)
+	?refreshAlbumSongs@MpMpxCollectionData@@IAEXXZ @ 153 NONAME ; void MpMpxCollectionData::refreshAlbumSongs(void)
+	?trUtf8@MpPlaybackData@@SA?AVQString@@PBD0@Z @ 154 NONAME ; class QString MpPlaybackData::trUtf8(char const *, char const *)
+	?albumDataChanged@MpCollectionTBoneListDataModel@@IAEXXZ @ 155 NONAME ; void MpCollectionTBoneListDataModel::albumDataChanged(void)
+	?comment@MpSongData@@QBE?AVQString@@XZ @ 156 NONAME ; class QString MpSongData::comment(void) const
+	?year@MpSongData@@QBE?AVQString@@XZ @ 157 NONAME ; class QString MpSongData::year(void) const
+	?data@MpCollectionTBoneListDataModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 158 NONAME ; class QVariant MpCollectionTBoneListDataModel::data(class QModelIndex const &, int) const
+	?albumSongIndex@MpMpxCollectionData@@QAEHH@Z @ 159 NONAME ; int MpMpxCollectionData::albumSongIndex(int)
+	?getStaticMetaObject@MpPlaybackData@@SAABUQMetaObject@@XZ @ 160 NONAME ; struct QMetaObject const & MpPlaybackData::getStaticMetaObject(void)
+	?composer@MpSongData@@QBE?AVQString@@XZ @ 161 NONAME ; class QString MpSongData::composer(void) const
+	?albumArt@MpPlaybackData@@QBEXAAVHbIcon@@@Z @ 162 NONAME ; void MpPlaybackData::albumArt(class HbIcon &) const
+	?commitPlaybackInfo@MpPlaybackData@@QAEXXZ @ 163 NONAME ; void MpPlaybackData::commitPlaybackInfo(void)
+	?removeRows@MpCollectionDataModel@@UAE_NHHABVQModelIndex@@@Z @ 164 NONAME ; bool MpCollectionDataModel::removeRows(int, int, class QModelIndex const &)
+	?albumSongId@MpMpxCollectionData@@QAEHH@Z @ 165 NONAME ; int MpMpxCollectionData::albumSongId(int)
+	?thumbnailReady@MpSongData@@QAEXVQPixmap@@PAXHH@Z @ 166 NONAME ; void MpSongData::thumbnailReady(class QPixmap, void *, int, int)
+	?songIndex@MpMpxCollectionData@@QAE?AV?$QList@H@@H@Z @ 167 NONAME ; class QList<int> MpMpxCollectionData::songIndex(int)
+	?album@MpSongData@@QBE?AVQString@@XZ @ 168 NONAME ; class QString MpSongData::album(void) const
+	?id@MpPlaybackData@@QAEHXZ @ 169 NONAME ; int MpPlaybackData::id(void)
+	?albumArtBase64@MpSongData@@QBE?AVQString@@XZ @ 170 NONAME ; class QString MpSongData::albumArtBase64(void) const
+	?playbackInfoChanged@MpPlaybackData@@IAEXXZ @ 171 NONAME ; void MpPlaybackData::playbackInfoChanged(void)
+	?itemData@MpMpxCollectionData@@QBE?AVQString@@HW4DataType@1@@Z @ 172 NONAME ; class QString MpMpxCollectionData::itemData(int, enum MpMpxCollectionData::DataType) const
+	?link@MpSongData@@QBE?AVQString@@XZ @ 173 NONAME ; class QString MpSongData::link(void) const
+	?trUtf8@MpCollectionTBoneListDataModel@@SA?AVQString@@PBD0@Z @ 174 NONAME ; class QString MpCollectionTBoneListDataModel::trUtf8(char const *, char const *)
+	?updateSong@MpCollectionTBoneListDataModel@@QAEXXZ @ 175 NONAME ; void MpCollectionTBoneListDataModel::updateSong(void)
+	?setId@MpPlaybackData@@QAE_NH@Z @ 176 NONAME ; bool MpPlaybackData::setId(int)
+	?metaObject@MpCollectionDataModel@@UBEPBUQMetaObject@@XZ @ 177 NONAME ; struct QMetaObject const * MpCollectionDataModel::metaObject(void) const
+	?metaObject@MpSongData@@UBEPBUQMetaObject@@XZ @ 178 NONAME ; struct QMetaObject const * MpSongData::metaObject(void) const
+	?setLayout@MpCollectionDataModel@@QAEXW4TCollectionLayout@@@Z @ 179 NONAME ; void MpCollectionDataModel::setLayout(enum TCollectionLayout)
+	?dataChanged@MpMpxCollectionData@@IAEXHH@Z @ 180 NONAME ; void MpMpxCollectionData::dataChanged(int, int)
+	?reloadData@MpCollectionDataModel@@QAEXHH@Z @ 181 NONAME ; void MpCollectionDataModel::reloadData(int, int)
+	?incrementalOpenUpdate@MpMpxCollectionData@@QAEXXZ @ 182 NONAME ; void MpMpxCollectionData::incrementalOpenUpdate(void)
 
--- a/mpdata/eabi/mpdatau.def	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/eabi/mpdatau.def	Tue Aug 24 03:36:14 2010 -0500
@@ -8,163 +8,177 @@
 	_ZN10MpSongData19getStaticMetaObjectEv @ 7 NONAME
 	_ZN10MpSongData19playbackInfoChangedEv @ 8 NONAME
 	_ZN10MpSongData21songDetailInfoChangedEv @ 9 NONAME
-	_ZN10MpSongDataC1EP7QObject @ 10 NONAME
-	_ZN10MpSongDataC2EP7QObject @ 11 NONAME
-	_ZN10MpSongDataD0Ev @ 12 NONAME
-	_ZN10MpSongDataD1Ev @ 13 NONAME
-	_ZN10MpSongDataD2Ev @ 14 NONAME
-	_ZN14MpPlaybackData10setAlbumIdEi @ 15 NONAME
-	_ZN14MpPlaybackData11qt_metacallEN11QMetaObject4CallEiPPv @ 16 NONAME
-	_ZN14MpPlaybackData11qt_metacastEPKc @ 17 NONAME
-	_ZN14MpPlaybackData11setDurationEi @ 18 NONAME
-	_ZN14MpPlaybackData11setPositionEi @ 19 NONAME
-	_ZN14MpPlaybackData12setRealAudioEb @ 20 NONAME
-	_ZN14MpPlaybackData13albumArtReadyEv @ 21 NONAME
-	_ZN14MpPlaybackData14setAlbumArtUriERK7QString @ 22 NONAME
-	_ZN14MpPlaybackData14thumbnailReadyERK7QPixmapPvii @ 23 NONAME
-	_ZN14MpPlaybackData15durationChangedEv @ 24 NONAME
-	_ZN14MpPlaybackData15positionChangedEv @ 25 NONAME
-	_ZN14MpPlaybackData16setPlaybackStateENS_15SimplifiedStateE @ 26 NONAME
-	_ZN14MpPlaybackData16staticMetaObjectE @ 27 NONAME DATA 16
-	_ZN14MpPlaybackData18commitPlaybackInfoEv @ 28 NONAME
-	_ZN14MpPlaybackData19getStaticMetaObjectEv @ 29 NONAME
-	_ZN14MpPlaybackData19playbackInfoChangedEv @ 30 NONAME
-	_ZN14MpPlaybackData20playbackStateChangedEv @ 31 NONAME
-	_ZN14MpPlaybackData2idEv @ 32 NONAME
-	_ZN14MpPlaybackData5setIdEi @ 33 NONAME
-	_ZN14MpPlaybackData6setUriERK7QString @ 34 NONAME
-	_ZN14MpPlaybackData7albumIdEv @ 35 NONAME
-	_ZN14MpPlaybackData8setAlbumERK7QString @ 36 NONAME
-	_ZN14MpPlaybackData8setTitleERK7QString @ 37 NONAME
-	_ZN14MpPlaybackData9realAudioEv @ 38 NONAME
-	_ZN14MpPlaybackData9resetDataEv @ 39 NONAME
-	_ZN14MpPlaybackData9setArtistERK7QString @ 40 NONAME
-	_ZN14MpPlaybackDataC1EP7QObject @ 41 NONAME
-	_ZN14MpPlaybackDataC2EP7QObject @ 42 NONAME
-	_ZN14MpPlaybackDataD0Ev @ 43 NONAME
-	_ZN14MpPlaybackDataD1Ev @ 44 NONAME
-	_ZN14MpPlaybackDataD2Ev @ 45 NONAME
-	_ZN19MpMpxCollectionData10removeItemEi @ 46 NONAME
-	_ZN19MpMpxCollectionData10setContextE18TCollectionContext @ 47 NONAME
-	_ZN19MpMpxCollectionData11albumSongIdEi @ 48 NONAME
-	_ZN19MpMpxCollectionData11containerIdEv @ 49 NONAME
-	_ZN19MpMpxCollectionData11dataChangedEv @ 50 NONAME
-	_ZN19MpMpxCollectionData11qt_metacallEN11QMetaObject4CallEiPPv @ 51 NONAME
-	_ZN19MpMpxCollectionData11qt_metacastEPKc @ 52 NONAME
-	_ZN19MpMpxCollectionData11setMpxMediaERK9CMPXMediab @ 53 NONAME
-	_ZN19MpMpxCollectionData14albumSongIndexEi @ 54 NONAME
-	_ZN19MpMpxCollectionData14containerMediaEv @ 55 NONAME
-	_ZN19MpMpxCollectionData14contextChangedE18TCollectionContext @ 56 NONAME
-	_ZN19MpMpxCollectionData14isAutoPlaylistEi @ 57 NONAME
-	_ZN19MpMpxCollectionData14isAutoPlaylistEv @ 58 NONAME
-	_ZN19MpMpxCollectionData14testCachedItemEi @ 59 NONAME
-	_ZN19MpMpxCollectionData15setAlbumContentERK9CMPXMedia @ 60 NONAME
-	_ZN19MpMpxCollectionData15setCurrentAlbumEi @ 61 NONAME
-	_ZN19MpMpxCollectionData16albumDataChangedEv @ 62 NONAME
-	_ZN19MpMpxCollectionData16insertCachedItemEi @ 63 NONAME
-	_ZN19MpMpxCollectionData16staticMetaObjectE @ 64 NONAME DATA 16
-	_ZN19MpMpxCollectionData17refreshAlbumSongsEv @ 65 NONAME
-	_ZN19MpMpxCollectionData19getStaticMetaObjectEv @ 66 NONAME
-	_ZN19MpMpxCollectionData6itemIdEi @ 67 NONAME
-	_ZN19MpMpxCollectionData9itemCountEi @ 68 NONAME
-	_ZN19MpMpxCollectionData9itemIndexEi @ 69 NONAME
-	_ZN19MpMpxCollectionDataC1EP7QObject @ 70 NONAME
-	_ZN19MpMpxCollectionDataC2EP7QObject @ 71 NONAME
-	_ZN19MpMpxCollectionDataD0Ev @ 72 NONAME
-	_ZN19MpMpxCollectionDataD1Ev @ 73 NONAME
-	_ZN19MpMpxCollectionDataD2Ev @ 74 NONAME
-	_ZN21MpCollectionDataModel10reloadDataEv @ 75 NONAME
-	_ZN21MpCollectionDataModel10removeRowsEiiRK11QModelIndex @ 76 NONAME
-	_ZN21MpCollectionDataModel10setContextE18TCollectionContext @ 77 NONAME
-	_ZN21MpCollectionDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 78 NONAME
-	_ZN21MpCollectionDataModel11qt_metacastEPKc @ 79 NONAME
-	_ZN21MpCollectionDataModel12dataReloadedEv @ 80 NONAME
-	_ZN21MpCollectionDataModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex @ 81 NONAME
-	_ZN21MpCollectionDataModel12orderChangedEiiii @ 82 NONAME
-	_ZN21MpCollectionDataModel12refreshModelEv @ 83 NONAME
-	_ZN21MpCollectionDataModel14collectionDataEv @ 84 NONAME
-	_ZN21MpCollectionDataModel14updateAlbumArtEi @ 85 NONAME
-	_ZN21MpCollectionDataModel16staticMetaObjectE @ 86 NONAME DATA 16
-	_ZN21MpCollectionDataModel17setItemVisibilityERK11QModelIndexb @ 87 NONAME
-	_ZN21MpCollectionDataModel19getStaticMetaObjectEv @ 88 NONAME
-	_ZN21MpCollectionDataModelC1EP19MpMpxCollectionDataP7QObject @ 89 NONAME
-	_ZN21MpCollectionDataModelC2EP19MpMpxCollectionDataP7QObject @ 90 NONAME
-	_ZN21MpCollectionDataModelD0Ev @ 91 NONAME
-	_ZN21MpCollectionDataModelD1Ev @ 92 NONAME
-	_ZN21MpCollectionDataModelD2Ev @ 93 NONAME
-	_ZN30MpCollectionTBoneListDataModel10updateSongEv @ 94 NONAME
-	_ZN30MpCollectionTBoneListDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 95 NONAME
-	_ZN30MpCollectionTBoneListDataModel11qt_metacastEPKc @ 96 NONAME
-	_ZN30MpCollectionTBoneListDataModel12refreshModelEv @ 97 NONAME
-	_ZN30MpCollectionTBoneListDataModel16albumDataChangedEv @ 98 NONAME
-	_ZN30MpCollectionTBoneListDataModel16staticMetaObjectE @ 99 NONAME DATA 16
-	_ZN30MpCollectionTBoneListDataModel18albumDataAvailableEv @ 100 NONAME
-	_ZN30MpCollectionTBoneListDataModel19getStaticMetaObjectEv @ 101 NONAME
-	_ZN30MpCollectionTBoneListDataModel19updatePlaybackStateEv @ 102 NONAME
-	_ZN30MpCollectionTBoneListDataModelC1EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 103 NONAME
-	_ZN30MpCollectionTBoneListDataModelC2EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 104 NONAME
-	_ZN30MpCollectionTBoneListDataModelD0Ev @ 105 NONAME
-	_ZN30MpCollectionTBoneListDataModelD1Ev @ 106 NONAME
-	_ZN30MpCollectionTBoneListDataModelD2Ev @ 107 NONAME
-	_ZNK10MpSongData10albumTrackEv @ 108 NONAME
-	_ZNK10MpSongData10metaObjectEv @ 109 NONAME
-	_ZNK10MpSongData10sampleRateEv @ 110 NONAME
-	_ZNK10MpSongData14albumArtBase64Ev @ 111 NONAME
-	_ZNK10MpSongData14isDrmProtectedEv @ 112 NONAME
-	_ZNK10MpSongData14reservedLengthEv @ 113 NONAME
-	_ZNK10MpSongData18removeAlbumArtFileEv @ 114 NONAME
-	_ZNK10MpSongData4linkEv @ 115 NONAME
-	_ZNK10MpSongData4sizeEv @ 116 NONAME
-	_ZNK10MpSongData4yearEv @ 117 NONAME
-	_ZNK10MpSongData5albumEv @ 118 NONAME
-	_ZNK10MpSongData5genreEv @ 119 NONAME
-	_ZNK10MpSongData5titleEv @ 120 NONAME
-	_ZNK10MpSongData6artistEv @ 121 NONAME
-	_ZNK10MpSongData7bitRateEv @ 122 NONAME
-	_ZNK10MpSongData7commentEv @ 123 NONAME
-	_ZNK10MpSongData8albumArtER6HbIcon @ 124 NONAME
-	_ZNK10MpSongData8composerEv @ 125 NONAME
-	_ZNK10MpSongData8durationEv @ 126 NONAME
-	_ZNK10MpSongData8fileNameEv @ 127 NONAME
-	_ZNK10MpSongData8mimeTypeEv @ 128 NONAME
-	_ZNK10MpSongData8modifiedEv @ 129 NONAME
-	_ZNK10MpSongData8musicURLEv @ 130 NONAME
-	_ZNK10MpSongData9copyrightEv @ 131 NONAME
-	_ZNK14MpPlaybackData10metaObjectEv @ 132 NONAME
-	_ZNK14MpPlaybackData13playbackStateEv @ 133 NONAME
-	_ZNK14MpPlaybackData3uriEv @ 134 NONAME
-	_ZNK14MpPlaybackData5albumEv @ 135 NONAME
-	_ZNK14MpPlaybackData5titleEv @ 136 NONAME
-	_ZNK14MpPlaybackData6artistEv @ 137 NONAME
-	_ZNK14MpPlaybackData8albumArtER6HbIcon @ 138 NONAME
-	_ZNK14MpPlaybackData8durationEv @ 139 NONAME
-	_ZNK14MpPlaybackData8positionEv @ 140 NONAME
-	_ZNK19MpMpxCollectionData10metaObjectEv @ 141 NONAME
-	_ZNK19MpMpxCollectionData13albumSongDataEiNS_8DataTypeE @ 142 NONAME
-	_ZNK19MpMpxCollectionData15albumSongsCountEv @ 143 NONAME
-	_ZNK19MpMpxCollectionData15collectionTitleEv @ 144 NONAME
-	_ZNK19MpMpxCollectionData17currentAlbumIndexEv @ 145 NONAME
-	_ZNK19MpMpxCollectionData5countEv @ 146 NONAME
-	_ZNK19MpMpxCollectionData7contextEv @ 147 NONAME
-	_ZNK19MpMpxCollectionData8itemDataEiNS_8DataTypeE @ 148 NONAME
-	_ZNK21MpCollectionDataModel10metaObjectEv @ 149 NONAME
-	_ZNK21MpCollectionDataModel20supportedDropActionsEv @ 150 NONAME
-	_ZNK21MpCollectionDataModel4dataERK11QModelIndexi @ 151 NONAME
-	_ZNK21MpCollectionDataModel8mimeDataERK5QListI11QModelIndexE @ 152 NONAME
-	_ZNK21MpCollectionDataModel8rowCountERK11QModelIndex @ 153 NONAME
-	_ZNK21MpCollectionDataModel9mimeTypesEv @ 154 NONAME
-	_ZNK30MpCollectionTBoneListDataModel10metaObjectEv @ 155 NONAME
-	_ZNK30MpCollectionTBoneListDataModel4dataERK11QModelIndexi @ 156 NONAME
-	_ZNK30MpCollectionTBoneListDataModel8rowCountERK11QModelIndex @ 157 NONAME
-	_ZTI10MpSongData @ 158 NONAME
-	_ZTI14MpPlaybackData @ 159 NONAME
-	_ZTI19MpMpxCollectionData @ 160 NONAME
-	_ZTI21MpCollectionDataModel @ 161 NONAME
-	_ZTI30MpCollectionTBoneListDataModel @ 162 NONAME
-	_ZTV10MpSongData @ 163 NONAME
-	_ZTV14MpPlaybackData @ 164 NONAME
-	_ZTV19MpMpxCollectionData @ 165 NONAME
-	_ZTV21MpCollectionDataModel @ 166 NONAME
-	_ZTV30MpCollectionTBoneListDataModel @ 167 NONAME
-	_ZN10MpSongData7setLinkERK7QString @ 168 NONAME
+	_ZN10MpSongData7setLinkERK7QString @ 10 NONAME
+	_ZN10MpSongDataC1EP7QObject @ 11 NONAME
+	_ZN10MpSongDataC2EP7QObject @ 12 NONAME
+	_ZN10MpSongDataD0Ev @ 13 NONAME
+	_ZN10MpSongDataD1Ev @ 14 NONAME
+	_ZN10MpSongDataD2Ev @ 15 NONAME
+	_ZN14MpPlaybackData10setAlbumIdEi @ 16 NONAME
+	_ZN14MpPlaybackData11qt_metacallEN11QMetaObject4CallEiPPv @ 17 NONAME
+	_ZN14MpPlaybackData11qt_metacastEPKc @ 18 NONAME
+	_ZN14MpPlaybackData11setDurationEi @ 19 NONAME
+	_ZN14MpPlaybackData11setPositionEi @ 20 NONAME
+	_ZN14MpPlaybackData12setCorruptedEi @ 21 NONAME
+	_ZN14MpPlaybackData12setRealAudioEb @ 22 NONAME
+	_ZN14MpPlaybackData13albumArtReadyEv @ 23 NONAME
+	_ZN14MpPlaybackData13fileCorruptedEi @ 24 NONAME
+	_ZN14MpPlaybackData14setAlbumArtUriERK7QString @ 25 NONAME
+	_ZN14MpPlaybackData14thumbnailReadyERK7QPixmapPvii @ 26 NONAME
+	_ZN14MpPlaybackData15durationChangedEv @ 27 NONAME
+	_ZN14MpPlaybackData15positionChangedEv @ 28 NONAME
+	_ZN14MpPlaybackData16setPlaybackStateENS_15SimplifiedStateE @ 29 NONAME
+	_ZN14MpPlaybackData16staticMetaObjectE @ 30 NONAME DATA 16
+	_ZN14MpPlaybackData18commitPlaybackInfoEv @ 31 NONAME
+	_ZN14MpPlaybackData19getStaticMetaObjectEv @ 32 NONAME
+	_ZN14MpPlaybackData19playbackInfoChangedEv @ 33 NONAME
+	_ZN14MpPlaybackData20playbackStateChangedEv @ 34 NONAME
+	_ZN14MpPlaybackData2idEv @ 35 NONAME
+	_ZN14MpPlaybackData5setIdEi @ 36 NONAME
+	_ZN14MpPlaybackData6setUriERK7QString @ 37 NONAME
+	_ZN14MpPlaybackData7albumIdEv @ 38 NONAME
+	_ZN14MpPlaybackData8setAlbumERK7QString @ 39 NONAME
+	_ZN14MpPlaybackData8setTitleERK7QString @ 40 NONAME
+	_ZN14MpPlaybackData9realAudioEv @ 41 NONAME
+	_ZN14MpPlaybackData9resetDataEv @ 42 NONAME
+	_ZN14MpPlaybackData9setArtistERK7QString @ 43 NONAME
+	_ZN14MpPlaybackDataC1EP7QObject @ 44 NONAME
+	_ZN14MpPlaybackDataC2EP7QObject @ 45 NONAME
+	_ZN14MpPlaybackDataD0Ev @ 46 NONAME
+	_ZN14MpPlaybackDataD1Ev @ 47 NONAME
+	_ZN14MpPlaybackDataD2Ev @ 48 NONAME
+	_ZN19MpMpxCollectionData10removeItemEi @ 49 NONAME
+	_ZN19MpMpxCollectionData10setContextE18TCollectionContext @ 50 NONAME
+	_ZN19MpMpxCollectionData11albumSongIdEi @ 51 NONAME
+	_ZN19MpMpxCollectionData11containerIdEv @ 52 NONAME
+	_ZN19MpMpxCollectionData11dataChangedEv @ 53 NONAME
+	_ZN19MpMpxCollectionData11qt_metacallEN11QMetaObject4CallEiPPv @ 54 NONAME
+	_ZN19MpMpxCollectionData11qt_metacastEPKc @ 55 NONAME
+	_ZN19MpMpxCollectionData11setMpxMediaERK9CMPXMediab @ 56 NONAME
+	_ZN19MpMpxCollectionData14albumSongIndexEi @ 57 NONAME
+	_ZN19MpMpxCollectionData14containerMediaEv @ 58 NONAME
+	_ZN19MpMpxCollectionData14contextChangedE18TCollectionContext @ 59 NONAME
+	_ZN19MpMpxCollectionData14isAutoPlaylistEi @ 60 NONAME
+	_ZN19MpMpxCollectionData14isAutoPlaylistEv @ 61 NONAME
+	_ZN19MpMpxCollectionData14testCachedItemEi @ 62 NONAME
+	_ZN19MpMpxCollectionData15setAlbumContentERK9CMPXMedia @ 63 NONAME
+	_ZN19MpMpxCollectionData15setCorruptValueE11QModelIndexb @ 64 NONAME
+	_ZN19MpMpxCollectionData15setCurrentAlbumEi @ 65 NONAME
+	_ZN19MpMpxCollectionData16albumDataChangedEv @ 66 NONAME
+	_ZN19MpMpxCollectionData16insertCachedItemEi @ 67 NONAME
+	_ZN19MpMpxCollectionData16staticMetaObjectE @ 68 NONAME DATA 16
+	_ZN19MpMpxCollectionData17refreshAlbumSongsEv @ 69 NONAME
+	_ZN19MpMpxCollectionData19getStaticMetaObjectEv @ 70 NONAME
+	_ZN19MpMpxCollectionData21setReloadAlbumContentEb @ 71 NONAME
+	_ZN19MpMpxCollectionData6itemIdEi @ 72 NONAME
+	_ZN19MpMpxCollectionData9itemCountEi @ 73 NONAME
+	_ZN19MpMpxCollectionData9itemIndexEi @ 74 NONAME
+	_ZN19MpMpxCollectionData9songIndexEi @ 75 NONAME
+	_ZN19MpMpxCollectionDataC1EP7QObject @ 76 NONAME
+	_ZN19MpMpxCollectionDataC2EP7QObject @ 77 NONAME
+	_ZN19MpMpxCollectionDataD0Ev @ 78 NONAME
+	_ZN19MpMpxCollectionDataD1Ev @ 79 NONAME
+	_ZN19MpMpxCollectionDataD2Ev @ 80 NONAME
+	_ZN21MpCollectionDataModel10reloadDataEv @ 81 NONAME
+	_ZN21MpCollectionDataModel10removeRowsEiiRK11QModelIndex @ 82 NONAME
+	_ZN21MpCollectionDataModel10setContextE18TCollectionContext @ 83 NONAME
+	_ZN21MpCollectionDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 84 NONAME
+	_ZN21MpCollectionDataModel11qt_metacastEPKc @ 85 NONAME
+	_ZN21MpCollectionDataModel12dataReloadedEv @ 86 NONAME
+	_ZN21MpCollectionDataModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex @ 87 NONAME
+	_ZN21MpCollectionDataModel12orderChangedEiiii @ 88 NONAME
+	_ZN21MpCollectionDataModel12refreshModelEv @ 89 NONAME
+	_ZN21MpCollectionDataModel13fileCorruptedEi @ 90 NONAME
+	_ZN21MpCollectionDataModel14collectionDataEv @ 91 NONAME
+	_ZN21MpCollectionDataModel14updateAlbumArtEi @ 92 NONAME
+	_ZN21MpCollectionDataModel16staticMetaObjectE @ 93 NONAME DATA 16
+	_ZN21MpCollectionDataModel17setItemVisibilityERK11QModelIndexb @ 94 NONAME
+	_ZN21MpCollectionDataModel19getStaticMetaObjectEv @ 95 NONAME
+	_ZN21MpCollectionDataModelC1EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 96 NONAME
+	_ZN21MpCollectionDataModelC2EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 97 NONAME
+	_ZN21MpCollectionDataModelD0Ev @ 98 NONAME
+	_ZN21MpCollectionDataModelD1Ev @ 99 NONAME
+	_ZN21MpCollectionDataModelD2Ev @ 100 NONAME
+	_ZN30MpCollectionTBoneListDataModel10updateSongEv @ 101 NONAME
+	_ZN30MpCollectionTBoneListDataModel11qt_metacallEN11QMetaObject4CallEiPPv @ 102 NONAME
+	_ZN30MpCollectionTBoneListDataModel11qt_metacastEPKc @ 103 NONAME
+	_ZN30MpCollectionTBoneListDataModel12refreshModelEv @ 104 NONAME
+	_ZN30MpCollectionTBoneListDataModel13fileCorruptedEi @ 105 NONAME
+	_ZN30MpCollectionTBoneListDataModel16albumDataChangedEv @ 106 NONAME
+	_ZN30MpCollectionTBoneListDataModel16staticMetaObjectE @ 107 NONAME DATA 16
+	_ZN30MpCollectionTBoneListDataModel18albumDataAvailableEv @ 108 NONAME
+	_ZN30MpCollectionTBoneListDataModel19getStaticMetaObjectEv @ 109 NONAME
+	_ZN30MpCollectionTBoneListDataModel19updatePlaybackStateEv @ 110 NONAME
+	_ZN30MpCollectionTBoneListDataModel29enablePlaybackIndicatorEnableEb @ 111 NONAME
+	_ZN30MpCollectionTBoneListDataModelC1EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 112 NONAME
+	_ZN30MpCollectionTBoneListDataModelC2EP19MpMpxCollectionDataP14MpPlaybackDataP7QObject @ 113 NONAME
+	_ZN30MpCollectionTBoneListDataModelD0Ev @ 114 NONAME
+	_ZN30MpCollectionTBoneListDataModelD1Ev @ 115 NONAME
+	_ZN30MpCollectionTBoneListDataModelD2Ev @ 116 NONAME
+	_ZNK10MpSongData10albumTrackEv @ 117 NONAME
+	_ZNK10MpSongData10metaObjectEv @ 118 NONAME
+	_ZNK10MpSongData10sampleRateEv @ 119 NONAME
+	_ZNK10MpSongData14albumArtBase64Ev @ 120 NONAME
+	_ZNK10MpSongData14isDrmProtectedEv @ 121 NONAME
+	_ZNK10MpSongData14reservedLengthEv @ 122 NONAME
+	_ZNK10MpSongData18removeAlbumArtFileEv @ 123 NONAME
+	_ZNK10MpSongData4linkEv @ 124 NONAME
+	_ZNK10MpSongData4sizeEv @ 125 NONAME
+	_ZNK10MpSongData4yearEv @ 126 NONAME
+	_ZNK10MpSongData5albumEv @ 127 NONAME
+	_ZNK10MpSongData5genreEv @ 128 NONAME
+	_ZNK10MpSongData5titleEv @ 129 NONAME
+	_ZNK10MpSongData6artistEv @ 130 NONAME
+	_ZNK10MpSongData7bitRateEv @ 131 NONAME
+	_ZNK10MpSongData7commentEv @ 132 NONAME
+	_ZNK10MpSongData8albumArtER6HbIcon @ 133 NONAME
+	_ZNK10MpSongData8composerEv @ 134 NONAME
+	_ZNK10MpSongData8durationEv @ 135 NONAME
+	_ZNK10MpSongData8fileNameEv @ 136 NONAME
+	_ZNK10MpSongData8mimeTypeEv @ 137 NONAME
+	_ZNK10MpSongData8modifiedEv @ 138 NONAME
+	_ZNK10MpSongData8musicURLEv @ 139 NONAME
+	_ZNK10MpSongData9copyrightEv @ 140 NONAME
+	_ZNK14MpPlaybackData10metaObjectEv @ 141 NONAME
+	_ZNK14MpPlaybackData13playbackStateEv @ 142 NONAME
+	_ZNK14MpPlaybackData3uriEv @ 143 NONAME
+	_ZNK14MpPlaybackData5albumEv @ 144 NONAME
+	_ZNK14MpPlaybackData5titleEv @ 145 NONAME
+	_ZNK14MpPlaybackData6artistEv @ 146 NONAME
+	_ZNK14MpPlaybackData8albumArtER6HbIcon @ 147 NONAME
+	_ZNK14MpPlaybackData8durationEv @ 148 NONAME
+	_ZNK14MpPlaybackData8positionEv @ 149 NONAME
+	_ZNK19MpMpxCollectionData10metaObjectEv @ 150 NONAME
+	_ZNK19MpMpxCollectionData13albumSongDataEiNS_8DataTypeE @ 151 NONAME
+	_ZNK19MpMpxCollectionData15albumSongsCountEv @ 152 NONAME
+	_ZNK19MpMpxCollectionData15collectionTitleEv @ 153 NONAME
+	_ZNK19MpMpxCollectionData15hasItemPropertyEiNS_12DataPropertyE @ 154 NONAME
+	_ZNK19MpMpxCollectionData17currentAlbumIndexEv @ 155 NONAME
+	_ZNK19MpMpxCollectionData20hasAlbumSongPropertyEiNS_12DataPropertyE @ 156 NONAME
+	_ZNK19MpMpxCollectionData5countEv @ 157 NONAME
+	_ZNK19MpMpxCollectionData7contextEv @ 158 NONAME
+	_ZNK19MpMpxCollectionData8itemDataEiNS_8DataTypeE @ 159 NONAME
+	_ZNK21MpCollectionDataModel10metaObjectEv @ 160 NONAME
+	_ZNK21MpCollectionDataModel20supportedDropActionsEv @ 161 NONAME
+	_ZNK21MpCollectionDataModel4dataERK11QModelIndexi @ 162 NONAME
+	_ZNK21MpCollectionDataModel8mimeDataERK5QListI11QModelIndexE @ 163 NONAME
+	_ZNK21MpCollectionDataModel8rowCountERK11QModelIndex @ 164 NONAME
+	_ZNK21MpCollectionDataModel9mimeTypesEv @ 165 NONAME
+	_ZNK30MpCollectionTBoneListDataModel10metaObjectEv @ 166 NONAME
+	_ZNK30MpCollectionTBoneListDataModel4dataERK11QModelIndexi @ 167 NONAME
+	_ZNK30MpCollectionTBoneListDataModel8rowCountERK11QModelIndex @ 168 NONAME
+	_ZTI10MpSongData @ 169 NONAME
+	_ZTI14MpPlaybackData @ 170 NONAME
+	_ZTI19MpMpxCollectionData @ 171 NONAME
+	_ZTI21MpCollectionDataModel @ 172 NONAME
+	_ZTI30MpCollectionTBoneListDataModel @ 173 NONAME
+	_ZTV10MpSongData @ 174 NONAME
+	_ZTV14MpPlaybackData @ 175 NONAME
+	_ZTV19MpMpxCollectionData @ 176 NONAME
+	_ZTV21MpCollectionDataModel @ 177 NONAME
+	_ZTV30MpCollectionTBoneListDataModel @ 178 NONAME
+	_ZN21MpCollectionDataModel9setLayoutE17TCollectionLayout @ 179 NONAME
+	_ZN19MpMpxCollectionData11dataChangedEii @ 180 NONAME
+	_ZN19MpMpxCollectionData21incrementalOpenUpdateEv @ 181 NONAME
+	_ZN21MpCollectionDataModel10reloadDataEii @ 182 NONAME
 
--- a/mpdata/inc/mpmpxcollectiondata_p.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/inc/mpmpxcollectiondata_p.h	Tue Aug 24 03:36:14 2010 -0500
@@ -21,6 +21,8 @@
 #include <e32base.h>
 
 #include <QHash>
+#include <QPair>
+#include <QAbstractListModel>
 
 #include "mpmpxcollectiondata.h"
 #include "mpmpxcollectionviewdefs.h"
@@ -40,7 +42,7 @@
 
     int count() const;
     QString collectionTitle() const;
-    QString itemData( int index, MpMpxCollectionData::DataType type ) const;
+    QString itemData( int index, MpMpxCollectionData::DataType type );
 
     bool isAutoPlaylist();
     bool isAutoPlaylist( int index );
@@ -56,33 +58,46 @@
     int currentAlbumIndex() const;
     int albumSongsCount() const;
     QString albumSongData( int index, MpMpxCollectionData::DataType type ) const;
+    bool hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
+    bool hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
 
     void setMpxMedia( const CMPXMedia& entries, bool reopen );
+    void incrementalOpenUpdate();
     const CMPXMedia& containerMedia();
     void setContext( TCollectionContext context );
     void setAlbumContent( const CMPXMedia& albumContent );
     int itemIndex( int itemUniqueId );
     int albumSongIndex( int songUniqueId );
+    QList<int> songIndex( int songUniqueId );
+    void setCorruptValue( QModelIndex index, bool tBone );
+    void setReloadAlbumContent( bool reloadAlbum );
 
 private:
+
     void loadAlbumsLookup();
     void loadAlbumSongsLookup();
-    void DoGetDataL( int index, MpMpxCollectionData::DataType type, QString& data ) const;
+    void setReloadRange( int index );
+    int itemId2( int index);
+    void DoGetDataL( int index, MpMpxCollectionData::DataType type, QString& data );
     bool DoIsAutoPlaylistL();
     bool DoIsAutoPlaylistL( int index );
     int DoGetItemCountL( int index );
     int DoGetContainerIdL();
     int DoGetItemIdL( int index );
+    int DoGetItemId2L( int index );
     int DoGetAlbumSongIdL( int index );
     void DoRemoveItemL( int index );
     bool DoTestCachedItemL( int itemId );
 
     bool DoSetCurrentAlbumL( int index );
     void DoGetAlbumSongDataL( int index, MpMpxCollectionData::DataType type, QString& data ) const;
+    bool DoHasItemPropertyL( int index, MpMpxCollectionData:: DataProperty type ) const;
+    bool DoHasAlbumSongPropertyL( int index, MpMpxCollectionData:: DataProperty type ) const;
 
     void SetCollectionContextL();
     void DoSetMpxMediaL( const CMPXMedia& entries );
     void DoSetAlbumContentL( const CMPXMedia& albumContent );
+    void DoSetCorruptValueL( QModelIndex index, bool tBone );
 
 private:
 
@@ -96,9 +111,14 @@
 
     int                     iCurrentAlbumIndex;
     int                     iAlbumSongCount;
-    QHash<int, int>         albumIdIndexMapping;
-    QHash<int, int>         albumSongIdIndexMapping;
+    QHash<int, int>         iAlbumIdIndexMapping;
+    QHash<int, int>         iAlbumSongIdIndexMapping;
+    QHash<int, int>         iSongIdIndexMapping;
+    bool                    iReloadAlbumContent;
 
+    bool                    iNeedReload;
+    QPair<int, int>         iReloadRange;
+	
 };
 
 #endif // MPMPXCOLLECTIONDATA_P_H
--- a/mpdata/src/mpcollectiondatamodel.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/src/mpcollectiondatamodel.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -26,6 +26,7 @@
 
 #include "mpcollectiondatamodel.h"
 #include "mpcollectionalbumartmanager.h"
+#include "mpplaybackdata.h"
 #include "mpmpxcollectiondata.h"
 #include "mptrace.h"
 
@@ -67,18 +68,26 @@
 /*!
  Constructs the collection data model.
  */
-MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent )
-    : QAbstractListModel( parent ),
-      mCollectionData( data ),
-      mRowCount( 0 ),
-      mAlbumIndexOffset( 0 ),
-      mHiddenItemIndex( -1 )
+MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData, QObject *parent )
+    : QAbstractListModel(parent),
+      mCollectionData(data),
+      mPlaybackData(playbackData),
+      mRowCount(0),
+      mAlbumIndexOffset(0),
+      mHiddenItemIndex(-1),
+      mCollectionLayout(ECollectionListView)
 {
     TX_ENTRY
     connect( mCollectionData, SIGNAL(contextChanged(TCollectionContext)), this, SLOT(setContext(TCollectionContext)) );
     connect( mCollectionData, SIGNAL(dataChanged()), this, SLOT(reloadData()) );
+    connect( mCollectionData, SIGNAL(dataChanged(int, int)), this, SLOT(reloadData(int, int)) );
     mAlbumArtManager = new MpCollectionAlbumArtManager(mCollectionData);
     connect( mAlbumArtManager, SIGNAL(albumArtReady(int)), this, SLOT(updateAlbumArt(int)) );
+    
+    if ( mPlaybackData ) {         
+        connect( mPlaybackData, SIGNAL(fileCorrupted(int)), 
+                 this, SLOT(fileCorrupted(int)) );
+    }
     TX_EXIT
 }
 
@@ -143,7 +152,24 @@
                     display << primaryText;
                 }
                 else {
-                    display << hbTrId("txt_mus_other_unknown4");
+                    switch ( context ) {
+                        case ECollectionContextArtists:
+                            display << hbTrId("txt_mus_list_unknown");
+                            break;
+                        case ECollectionContextArtistAlbums:
+                        case ECollectionContextAlbums:
+                            display << hbTrId("txt_mus_dblist_unknown");
+                            break;
+                        case ECollectionContextAlbumsTBone:
+                        case ECollectionContextArtistAlbumsTBone:
+                            display << hbTrId("txt_mus_other_unknown8");
+                            break;
+                        default:
+                            // Otherwise the primary text should be the Song Title or File Name
+                            // but can not be empty, if so there is an error.
+                            TX_LOG_ARGS("Error: Song title empty.");
+                            break;
+                    }
                 }
                 break;
             case ECollectionContextAlbumsMediaWall:
@@ -152,7 +178,7 @@
                     display << primaryText;
                 }
                 else {
-                    display << hbTrId("txt_mus_other_unknown4");
+                    display << hbTrId("txt_mus_other_unknown2");
                 }    
                 break;
             default:
@@ -171,7 +197,26 @@
                     display << secondaryText;
                 }
                 else {
-                    display << hbTrId("txt_mus_other_unknown3");
+                    switch ( context ) {
+                        case ECollectionContextAllSongs:
+                        case ECollectionContextPlaylistSongs:
+                            if ( mCollectionLayout == ECollectionSelectionDialog ) {
+                                display << hbTrId("txt_mus_dblist_val_unknown4");
+                            }
+                            else if ( mCollectionLayout == ECollectionArrangeSongsDialog ) {
+                                display << hbTrId("txt_mus_other_unknown9");
+                            }
+                            else {
+                                display << hbTrId("txt_mus_dblist_val_unknown");
+                            }
+                            break;
+                        case ECollectionContextAlbums:
+                            display << hbTrId("txt_mus_dblist_val_unknown2");
+                            break;
+                        case ECollectionContextAlbumsTBone:
+                            display << hbTrId("txt_mus_other_unknown5");
+                            break;
+                    }
                 }
                 break;
             case ECollectionContextArtistAlbumsTBone:
@@ -180,7 +225,7 @@
                     display << secondaryText;
                 }
                 else {
-                    display << hbTrId("txt_mus_other_unknown3");
+                    display << hbTrId("txt_mus_other_unknown5");
                 }
                 break;
             case ECollectionContextArtistAllSongs:
@@ -189,7 +234,7 @@
                     display << secondaryText;
                 }
                 else {
-                    display << hbTrId("txt_mus_other_unknown4");
+                    display << hbTrId("txt_mus_dblist_val_unknown3");
                 }
                 break;
             case ECollectionContextAlbumsMediaWall:
@@ -198,7 +243,7 @@
                     display << secondaryText;
                 }
                 else {
-                    display << hbTrId("txt_mus_other_unknown3");
+                    display << hbTrId("txt_mus_other_unknown1");
                 }
                 break;
             default:
@@ -222,6 +267,24 @@
                     returnValue = mAlbumArtManager->albumArt( row );
                 }
                 break;
+            case ECollectionContextAllSongs:
+            case ECollectionContextArtistAllSongs:
+            case ECollectionContextPlaylistSongs:
+                if( mCollectionData->hasItemProperty(row, MpMpxCollectionData::Corrupted) ){
+					QList<QVariant> iconList;
+                    iconList << QVariant();
+                    iconList << HbIcon("qtg_mono_corrupted");
+                    returnValue = iconList;
+                }
+                else if ( mCollectionData->hasItemProperty(row, MpMpxCollectionData::DrmExpired) ) {
+                    QList<QVariant> iconList;
+                    iconList << QVariant();
+                    iconList << HbIcon("qtg_small_drm_rights_expired");
+                    returnValue = iconList;
+                } 
+                break;
+            default:
+                break;
         }
     }
     else if ( role == Hb::IndexFeedbackRole ) {
@@ -375,6 +438,14 @@
 }
 
 /*!
+ Sets the layout where the collection is being displayed.
+ */
+void MpCollectionDataModel::setLayout(TCollectionLayout layout)
+{
+    mCollectionLayout = layout;
+}
+
+/*!
  Slot to be called when collection context is changed.
  */
 void MpCollectionDataModel::setContext( TCollectionContext context )
@@ -419,8 +490,7 @@
 
     index -= mAlbumIndexOffset;
     if ( index >= 0 && index < mRowCount ) {
-        QModelIndex modelIndex = QAbstractItemModel::createIndex(index, 0);
-        emit dataChanged(modelIndex, modelIndex);
+        emit dataChanged(this->index(index, 0), this->index(index, 0));
     }
     TX_EXIT
 }
@@ -462,3 +532,35 @@
     TX_EXIT
 }
 
+/*!
+ Slot to be called when data has changed (same context) and model needs to reload
+ the data in the specified range.
+ */
+void MpCollectionDataModel::reloadData( int fromIndex, int toIndex )
+{
+    TX_ENTRY_ARGS("fromIndex=" << fromIndex << ", toIndex=" << toIndex);
+    emit dataChanged(this->index(fromIndex,0), this->index(toIndex,0));
+    TX_EXIT
+}
+
+/*!
+ Slot to be called when a song is marked as corrupted
+ */
+void MpCollectionDataModel::fileCorrupted(int songId)
+{
+    TX_ENTRY
+    QModelIndex corruptedSongIndex;
+    QList<int> indexList = mCollectionData->songIndex( songId );
+    for (int i = 0; i < indexList.count(); i++){
+        corruptedSongIndex = index( indexList.at(i) );
+        if ( corruptedSongIndex.isValid() && (!(mCollectionData->hasItemProperty(corruptedSongIndex.row(),
+                MpMpxCollectionData::Corrupted)))) {
+        
+            mCollectionData->setCorruptValue(corruptedSongIndex, false);
+            emit dataChanged( corruptedSongIndex, corruptedSongIndex );
+        }
+    }
+    TX_EXIT   
+}
+
+
--- a/mpdata/src/mpcollectiontbonelistdatamodel.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/src/mpcollectiontbonelistdatamodel.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -75,7 +75,8 @@
       mPlaybackData( playbackData ),
       mRowCount( 0 ),
       mCurrentSongId( 0 ),
-      mPlaybackActive( false )
+      mPlaybackActive( false ),
+      mPlaybackIndicatorEnabled( false )
 {
     TX_ENTRY
     connect( mCollectionData, SIGNAL(refreshAlbumSongs()),
@@ -84,12 +85,8 @@
              this, SIGNAL(albumDataChanged()) );
     
     if ( mPlaybackData ) {
-        connect( mPlaybackData, SIGNAL(playbackInfoChanged()),
-                this, SLOT(updateSong()));
-        
-        connect( mPlaybackData, SIGNAL(playbackStateChanged()), 
-                this, SLOT(updatePlaybackState()));
-        mPlaybackActive = mPlaybackData->playbackState() != MpPlaybackData::NotPlaying;
+		connect( mPlaybackData, SIGNAL(fileCorrupted( int )), 
+        		this, SLOT(fileCorrupted( int )));
     }
     
     TX_EXIT
@@ -141,7 +138,19 @@
         }
     }
     else if ( role == Qt::DecorationRole ) {
-        if ( mPlaybackActive
+        if ( mCollectionData->hasAlbumSongProperty(row, MpMpxCollectionData::Corrupted) ) {
+                QList<QVariant> iconList;
+                iconList << QVariant();
+                iconList << HbIcon("qtg_mono_corrupted");
+                returnValue = iconList;
+        }
+        else if ( mCollectionData->hasAlbumSongProperty(row, MpMpxCollectionData::DrmExpired) ) {
+            QList<QVariant> iconList;
+            iconList << QVariant();
+            iconList << HbIcon("qtg_small_drm_rights_expired");
+            returnValue = iconList;
+        }
+        else if ( mPlaybackActive && mPlaybackIndicatorEnabled
                 && mPlaybackData->id() == mCollectionData->albumSongId( row ) ) {
             QList<QVariant> iconList;
             iconList << QVariant(); //primary icon is not used.
@@ -155,6 +164,36 @@
 }
 
 /*!
+ Set Playback Indicator in TBone List Model 
+ */
+void MpCollectionTBoneListDataModel::enablePlaybackIndicatorEnable(bool enable)
+{   
+    TX_ENTRY
+    if ( !mPlaybackData ) {
+        return;
+    }
+    if ( enable ){
+        connect( mPlaybackData, SIGNAL(playbackInfoChanged()),
+                        this, SLOT(updateSong()));
+                
+        connect( mPlaybackData, SIGNAL(playbackStateChanged()), 
+                this, SLOT(updatePlaybackState()));
+        mPlaybackActive = mPlaybackData->playbackState() != MpPlaybackData::NotPlaying;
+        mPlaybackIndicatorEnabled = true;
+    }
+    else{
+        disconnect( mPlaybackData, SIGNAL(playbackInfoChanged()),
+                        this, SLOT(updateSong()));
+                
+        disconnect( mPlaybackData, SIGNAL(playbackStateChanged()), 
+                this, SLOT(updatePlaybackState()));
+        mPlaybackActive = false;
+        mPlaybackIndicatorEnabled = false;
+    }
+    TX_EXIT
+}
+
+/*!
  Slot to be called when data has changed and model needs to be refreshed
  to reflect the new data.
  */
@@ -209,6 +248,25 @@
         updateSong();
     }
 }    
+
+/*!
+ Slot to be called when a song is marked as corrupted
+ */
+void MpCollectionTBoneListDataModel::fileCorrupted(int songId)
+{
+    TX_ENTRY
+    QModelIndex corruptedSongIndex;
+    corruptedSongIndex = index( mCollectionData->albumSongIndex( songId ) );
+    if ( !(corruptedSongIndex.isValid()) ){
+        mCollectionData->setReloadAlbumContent( true );
+    }
+    else if (!(mCollectionData->hasAlbumSongProperty(corruptedSongIndex.row(),
+            MpMpxCollectionData::Corrupted))) {   
+        mCollectionData->setCorruptValue(corruptedSongIndex, true);
+        emit dataChanged( corruptedSongIndex, corruptedSongIndex );
+    }
+    TX_EXIT
+}
     
 
 //EOF
--- a/mpdata/src/mpmpxcollectiondata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/src/mpmpxcollectiondata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -52,6 +52,17 @@
     \sa setMpxMedia()
  */
 
+/*!
+    \fn void dataChanged( int fromIndex, int toIndex )
+
+    This signal is emitted when a new data set is available within the
+    same context. This can happen during an incremental open operation,
+    if the view accesses a range of data that doesn't have final data
+    (i.e. Unknown). This signal is emitted upon completion of incremental
+    open operation, if such unavailable range was accessed.
+
+    \sa setMpxMedia()
+ */
 
 /*!
     \fn void albumDataChanged()
@@ -241,6 +252,27 @@
 }
 
 /*!
+ Returns item property for the specified \a index and \a type in the current item.
+ Currently supported data types are: Corrupted and DrmExpired. All others will return
+ false bool.
+ */
+
+bool MpMpxCollectionData::hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+    return d_ptr->hasItemProperty( index, type );
+}
+
+/*!
+ Returns item property for the specified \a index and \a type in the current album.
+ Currently supported data types are: Corrupted and DrmExpired. All others will return
+ false bool.
+ */
+bool MpMpxCollectionData::hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+    return d_ptr->hasAlbumSongProperty( index, type);
+}
+
+/*!
  Sets the media \a entries from the MPX framework. The \a reopen flag indicates
  whether the new media is a result of reopenCollection() operation in the MpEngine.
  Internal usage only from MpEngine.
@@ -251,6 +283,15 @@
 }
 
 /*!
+ Called when collection was opened with incremental open. This indicates that the
+ media received in setMpxMedia() has an update.
+ */
+void MpMpxCollectionData::incrementalOpenUpdate()
+{
+    d_ptr->incrementalOpenUpdate();
+}
+
+/*!
  Returns the container media from the MPX framework.
  Internal usage only from MpEngine.
 
@@ -304,6 +345,32 @@
     return d_ptr->albumSongIndex( songUniqueId );
 }
 
-//EOF
+/*!
+ Returns the list of index for the song with \a songUniqueId. 
+ A list is returned due to playlist can contain the same song 
+ multiple times.
+
+ */
+QList<int>  MpMpxCollectionData::songIndex( int songUniqueId )
+{
+    return d_ptr->songIndex( songUniqueId );
+}
+
+/*!
+ Set model index \a index as corrupted.  
 
+ */
+void MpMpxCollectionData::setCorruptValue( QModelIndex index, bool tBone )
+{
+    d_ptr->setCorruptValue( index, tBone );
+}
 
+/*!
+ Set the reloadAlbumContent variable to \a reloadAlbum
+
+ */
+void MpMpxCollectionData::setReloadAlbumContent( bool reloadAlbum )
+{
+    d_ptr->setReloadAlbumContent( reloadAlbum );
+}
+
--- a/mpdata/src/mpmpxcollectiondata_p.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/src/mpmpxcollectiondata_p.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -38,13 +38,15 @@
  \internal
  */
 MpMpxCollectionDataPrivate::MpMpxCollectionDataPrivate( MpMpxCollectionData *wrapper )
-    : q_ptr( wrapper ),
-      iContext( ECollectionContextUnknown ),
+    : q_ptr(wrapper),
+      iContext(ECollectionContextUnknown),
       iContainerMedia(0),
       iMediaArray(0),
       iCachedRemovedItem(0),
       iCurrentAlbumIndex(-1),
-      iAlbumSongCount(0)
+      iAlbumSongCount(0),
+      iReloadAlbumContent(false),
+	  iNeedReload(false)
 {
     TX_LOG
 }
@@ -99,7 +101,7 @@
 /*!
  \internal
  */
-QString MpMpxCollectionDataPrivate::itemData( int index, MpMpxCollectionData::DataType type ) const
+QString MpMpxCollectionDataPrivate::itemData( int index, MpMpxCollectionData::DataType type )
 {
     TX_ENTRY_ARGS("index=" << index << ", type=" << type);
     QString data;
@@ -318,6 +320,36 @@
 
 /*!
  \internal
+ */
+bool MpMpxCollectionDataPrivate::hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+    TX_ENTRY_ARGS("index=" << index << ", type=" << type);
+    bool available = false;
+    TRAPD(err, available = DoHasItemPropertyL(index, type));
+    if ( err != KErrNone ) {
+        TX_LOG_ARGS("Error: " << err << "; should never get here.");
+    }
+    TX_EXIT
+    return available;
+}
+
+/*!
+ \internal
+ */
+bool MpMpxCollectionDataPrivate::hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+    TX_ENTRY_ARGS("index=" << index << ", type=" << type);
+    bool available = false;
+    TRAPD(err, available = DoHasAlbumSongPropertyL(index, type));
+    if ( err != KErrNone ) {
+        TX_LOG_ARGS("Error: " << err << "; should never get here.");
+    }
+    TX_EXIT
+    return available;
+}
+
+/*!
+ \internal
  New data from MPX collection. This could be due to Open operation, in which case
  context would have changed. This could also be due to Re-open after operations
  such as delete, playlist renaming, playlist rearraging, etc., in which case the
@@ -413,6 +445,23 @@
 
 /*!
  \internal
+ This indicates data update during incremental open operation. This indicates
+ that media received in setMpxMedia() has updates.
+ */
+void MpMpxCollectionDataPrivate::incrementalOpenUpdate()
+{
+    TX_ENTRY_ARGS( "iNeedReload=" << iNeedReload);
+    if ( iNeedReload ) {
+        if ( itemId(iReloadRange.second) != -1 ) {
+            iNeedReload = false;
+            emit q_ptr->dataChanged(iReloadRange.first, iReloadRange.second);
+        }
+    }
+    TX_EXIT
+}
+
+/*!
+ \internal
  */
 const CMPXMedia& MpMpxCollectionDataPrivate::containerMedia()
 {
@@ -455,7 +504,7 @@
  */
 int MpMpxCollectionDataPrivate::itemIndex( int itemUniqueId )
 {
-    return albumIdIndexMapping.value( itemUniqueId, -1 );
+    return iAlbumIdIndexMapping.value( itemUniqueId, -1 );
 }
 
 /*!
@@ -465,9 +514,47 @@
  */
 int MpMpxCollectionDataPrivate::albumSongIndex( int songUniqueId )
 {
-    return albumSongIdIndexMapping.value( songUniqueId, -1 );
+    return iAlbumSongIdIndexMapping.value( songUniqueId, -1 );
+}
+
+/*!
+ \internal
+   Use to lookup playing song id to index of song in collection and playlist
+   view 
+ */
+QList<int>  MpMpxCollectionDataPrivate::songIndex( int songUniqueId )
+{
+    TX_ENTRY
+    if(iSongIdIndexMapping.empty()){
+        for ( int i = count() - 1 ; i >= 0 ; i-- ) {
+            iSongIdIndexMapping.insertMulti( itemId2( i ) , i );
+        }
+    }
+    TX_EXIT
+    return iSongIdIndexMapping.values( songUniqueId );
 }
 
+/*!
+ \internal
+   Set item at index to corrupted depends on if viewing TBone
+ */
+void MpMpxCollectionDataPrivate::setCorruptValue( QModelIndex index, bool tBone)
+{
+    TX_ENTRY
+    TRAPD(err, DoSetCorruptValueL(index, tBone));
+    if ( err != KErrNone ) {
+        TX_LOG_ARGS("Error: " << err << "; should never get here.");
+    }
+    TX_EXIT
+}
+
+/*!
+ \internal
+ */
+void MpMpxCollectionDataPrivate::setReloadAlbumContent( bool reloadAlbum )
+{
+    iReloadAlbumContent = reloadAlbum;
+}
 
 /*!
  \internal
@@ -475,12 +562,12 @@
 void MpMpxCollectionDataPrivate::loadAlbumsLookup()
 {
     //Clearing all the album ids.
-    albumIdIndexMapping.clear();
+    iAlbumIdIndexMapping.clear();
     if ( iContext == ECollectionContextAlbumsMediaWall) {
         //Adding album ids and indixes to the hash, for itemIndex lookup.
         //This is disabled for other containers to save resources.
         for ( int i = count() - 1 ; i >= 0 ; i-- ) {
-            albumIdIndexMapping.insert( itemId( i ) , i );
+            iAlbumIdIndexMapping.insert( itemId( i ) , i );
         }
     }
 }
@@ -491,24 +578,66 @@
 void MpMpxCollectionDataPrivate::loadAlbumSongsLookup()
 {
     //Clearing all the song ids.
-    albumSongIdIndexMapping.clear();
-    if ( iContext == ECollectionContextAlbumsMediaWall) {
-        //Adding album song ids and indixes to the hash, for albumSongIndex lookup.
-        //This is disabled for other containers to save resources.
-        for ( int i = albumSongsCount() - 1 ; i >= 0 ; i-- ) {
-            albumSongIdIndexMapping.insert( albumSongId( i ) , i );
-        }
+    iAlbumSongIdIndexMapping.clear();
+    //Adding album song ids and indixes to the hash, for albumSongIndex lookup.
+    //This is disabled for other containers to save resources.
+    for ( int i = albumSongsCount() - 1 ; i >= 0 ; i-- ) {
+        iAlbumSongIdIndexMapping.insert( albumSongId( i ) , i );
     }
 }
 
 /*!
  \internal
  */
-void MpMpxCollectionDataPrivate::DoGetDataL( int index, MpMpxCollectionData::DataType type, QString& data ) const
+void MpMpxCollectionDataPrivate::setReloadRange( int index )
+{
+    TX_ENTRY_ARGS( "index=" << index);
+    if ( !iNeedReload ) {
+        iNeedReload = true;
+        iReloadRange.first = index;
+        iReloadRange.second = index;
+    }
+    else if ( index < iReloadRange.first ) {
+        iReloadRange.first = index;
+    }
+    else if ( index > iReloadRange.second ) {
+        iReloadRange.second = index;
+    }
+    TX_EXIT
+}
+
+/*!
+ \internal
+ */
+int MpMpxCollectionDataPrivate::itemId2( int index )
+{
+    TX_ENTRY_ARGS( "index=" << index );
+    int id = -1;
+    TRAPD( err, id = DoGetItemId2L( index ) );
+    if ( err == KErrNone ) {
+        TX_LOG_ARGS( "id=" << id );
+    }
+    else {
+        TX_LOG_ARGS( "Error: " << err << "; should never get here." );
+    }
+    TX_EXIT
+    return id;
+}
+
+/*!
+ \internal
+ */
+void MpMpxCollectionDataPrivate::DoGetDataL( int index, MpMpxCollectionData::DataType type, QString& data )
 {
     TX_ENTRY
     CMPXMedia* currentMedia( iMediaArray->AtL( index ) );
 
+    if ( currentMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId) == KMPXInvalidItemId ) {
+        // Accessing a data that hasn't been fully fetched from the collection.
+        // This can happen during incremental open. Set the index as reload candidate.
+        setReloadRange(index);
+    }
+
     TBuf<10> countBuf;
     TInt count = 0;
     switch ( type ) {
@@ -631,10 +760,29 @@
 int MpMpxCollectionDataPrivate::DoGetItemIdL( int index )
 {
     CMPXMedia* currentMedia( iMediaArray->AtL( index ) );
-    if ( !currentMedia->IsSupported( KMPXMediaGeneralId ) ) {
-        User::Leave(KErrNotFound);
+    if ( currentMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId) == KMPXInvalidItemId ) {
+        return -1;
+    }
+    else {
+        int id1 = (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId )).iId1;
+        int id2 = (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId )).iId2;
+        TX_LOG_ARGS( "id1=" << id1 << ", id2=" << id2 );
+        return (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId )).iId1;
     }
-    return currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+}
+
+/*!
+ \internal
+ */
+int MpMpxCollectionDataPrivate::DoGetItemId2L( int index )
+{
+    CMPXMedia* currentMedia( iMediaArray->AtL( index ) );
+    if ( currentMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId) == KMPXInvalidItemId ) {
+        return -1;
+    }
+    else {
+        return (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId )).iId2;
+    }
 }
 
 /*!
@@ -646,10 +794,12 @@
     const CMPXMediaArray* songs = album->Value<CMPXMediaArray>(KMPXMediaArrayContents);
     User::LeaveIfNull(const_cast<CMPXMediaArray*>(songs));
     CMPXMedia* song = songs->AtL(index);
-    if ( !song->IsSupported( KMPXMediaGeneralId ) ) {
-        User::Leave(KErrNotFound);
+    if ( song->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId) == KMPXInvalidItemId ) {
+        return -1;
     }
-    return song->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+    else {
+        return song->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
+    }
 }
 
 /*!
@@ -683,16 +833,18 @@
     iCurrentAlbumIndex = index;
 
     bool songsAvailable = false;
-    CMPXMedia* album( iMediaArray->AtL( index ) );
-    if ( album->IsSupported(KMPXMediaArrayContents) ) {
-        // We've previously fetched the songs for this album so
-        // all we do now is populate the list with the song titles.
-        const CMPXMediaArray* songs = album->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-        iAlbumSongCount = songs->Count();
-        songsAvailable = true;
-        TX_LOG_ARGS("Songs available.");
-        loadAlbumSongsLookup();
-        emit q_ptr->refreshAlbumSongs();
+    if (!iReloadAlbumContent){    
+        CMPXMedia* album( iMediaArray->AtL( index ) );
+        if ( album->IsSupported(KMPXMediaArrayContents) ) {
+            // We've previously fetched the songs for this album so
+            // all we do now is populate the list with the song titles.
+            const CMPXMediaArray* songs = album->Value<CMPXMediaArray>(KMPXMediaArrayContents);
+            iAlbumSongCount = songs->Count();
+            songsAvailable = true;
+            TX_LOG_ARGS("Songs available.");
+            loadAlbumSongsLookup();
+            emit q_ptr->refreshAlbumSongs();
+        }
     }
     TX_EXIT
     return songsAvailable;
@@ -737,9 +889,75 @@
 /*!
  \internal
  */
+bool MpMpxCollectionDataPrivate::DoHasItemPropertyL( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+    TX_ENTRY
+    CMPXMedia* currentMedia( iMediaArray->AtL( index ) );
+
+    TInt flags(0);
+    if ( currentMedia->IsSupported( KMPXMediaGeneralFlags ) ) {
+        flags = currentMedia->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
+    }
+    switch ( type ) {
+        case MpMpxCollectionData::Corrupted:
+            if ( ( flags ) & ( KMPXMediaGeneralFlagsIsCorrupted ) ){
+                return true;
+            }
+            break;
+        case MpMpxCollectionData::DrmExpired:
+            if ( ( flags ) & ( KMPXMediaGeneralFlagsIsDrmLicenceInvalid ) ){
+                return true;
+            }
+            break;
+        default:
+            break;
+    }
+    TX_EXIT
+    return false;    
+}
+
+/*!
+ \internal
+ */
+bool MpMpxCollectionDataPrivate::DoHasAlbumSongPropertyL( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+    TX_ENTRY
+    CMPXMedia* album( iMediaArray->AtL( iCurrentAlbumIndex ) );
+    if ( album->IsSupported(KMPXMediaArrayContents) ) {
+        const CMPXMediaArray* songs = album->Value<CMPXMediaArray>(KMPXMediaArrayContents);
+        User::LeaveIfNull(const_cast<CMPXMediaArray*>(songs));
+        CMPXMedia* song = songs->AtL(index);
+        TInt flags(0);
+        if ( song->IsSupported( KMPXMediaGeneralFlags ) ) {
+            flags = song->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
+        }
+        switch ( type ) {
+            case MpMpxCollectionData::Corrupted:
+                if ( ( flags ) & ( KMPXMediaGeneralFlagsIsCorrupted ) ){
+                    return true;
+                }
+                break;
+            case MpMpxCollectionData::DrmExpired:
+                if ( ( flags ) & ( KMPXMediaGeneralFlagsIsDrmLicenceInvalid ) ){
+                    return true;
+                }
+                break;
+            default:
+                break;
+        }
+        
+    }
+    TX_EXIT
+    return false;    
+}
+/*!
+ \internal
+ */
 void MpMpxCollectionDataPrivate::SetCollectionContextL()
 {
     TX_ENTRY
+	// Clear Song Index Hash when context switched
+    iSongIdIndexMapping.clear();
     TMPXGeneralType containerType( EMPXNoType );
     if ( iContainerMedia->IsSupported( KMPXMediaGeneralType ) ) {
         containerType = iContainerMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType );
@@ -802,7 +1020,7 @@
     iContainerMedia = CMPXMedia::NewL(entries);
     iMediaArray = const_cast<CMPXMediaArray*>(iContainerMedia->Value<CMPXMediaArray>( KMPXMediaArrayContents ) );
     TX_LOG_ARGS("media count=" << iMediaArray->Count() );
-
+    iReloadAlbumContent = false;
     SetCollectionContextL();
     TX_EXIT
 }
@@ -829,4 +1047,25 @@
     TX_EXIT
 }
 
+/*!
+ \internal
+ */
+void MpMpxCollectionDataPrivate::DoSetCorruptValueL(QModelIndex index, bool tBone)
+{
+    TX_ENTRY
+    if (tBone){
+        CMPXMedia* album( iMediaArray->AtL( iCurrentAlbumIndex ) );
+        if ( album->IsSupported(KMPXMediaArrayContents) ) {
+            const CMPXMediaArray* songs = album->Value<CMPXMediaArray>(KMPXMediaArrayContents);
+            User::LeaveIfNull(const_cast<CMPXMediaArray*>(songs));
+            CMPXMedia* song = songs->AtL( index.row() );
+            song->SetTObjectValueL<TUint>( KMPXMediaGeneralFlags,KMPXMediaGeneralFlagsIsCorrupted );
+        }
+    }
+    else {
+        CMPXMedia* song( iMediaArray->AtL( index.row() ) );
+        song->SetTObjectValueL<TUint>( KMPXMediaGeneralFlags,KMPXMediaGeneralFlagsIsCorrupted );        
+    }
+    TX_EXIT  
+}
 
--- a/mpdata/src/mpplaybackdata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/src/mpplaybackdata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -68,6 +68,13 @@
     title, artist and album name.
  */
 
+/*!
+    \fn void fileCorrupted()
+
+    This signal is emitted when a file is found corrupted.  Call by 
+    PlayBackWrapper.  
+ */
+
 
 
 /*!
@@ -174,16 +181,10 @@
 {
     TX_ENTRY_ARGS( "artist = " << artist )
     bool change = false;
-    // data is different or mArtist was not set befor or it was reset.
-    // When artist is empty and mArtist is empty mArtist should be unknown text.
+    // data is different or mArtist was not set before or it was reset.
     if ( artist != mArtist || mArtist.isNull()) {
         change = true;
-        if ( artist.isEmpty() ){
-            mArtist = hbTrId( "txt_mus_other_unknown3" );      
-        }
-        else {
-            mArtist = artist;
-        }
+        mArtist = artist;
     }
     TX_EXIT
     return change;
@@ -205,16 +206,10 @@
 {
     TX_ENTRY_ARGS( "album = " << album )
     bool change = false;
-    // data is different or mAlbum was not set befor or it was reset.
-    // when album is empty and mAlbum is empty mAlbum should be unknown text.
+    // data is different or mAlbum was not set before or it was reset.
     if ( album != mAlbum || mAlbum.isNull() ) {
         change = true;
-        if ( album.isEmpty() ){
-            mAlbum = hbTrId( "txt_mus_other_unknown4" );
-        }
-        else{
-            mAlbum = album;            
-        }
+        mAlbum = album;
     }
     TX_EXIT
     return change;
@@ -411,6 +406,14 @@
 }
 
 /*!
+ Emit fileCorrupted(id) signal when a file with id is corrupted
+*/
+void MpPlaybackData::setCorrupted( int id )
+{
+   emit fileCorrupted( id );
+}
+
+/*!
  Slot to handle the album art thumb.
 */
 void MpPlaybackData::thumbnailReady(
--- a/mpdata/src/mpsongdata_p.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/src/mpsongdata_p.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -146,79 +146,7 @@
 QString MpSongDataPrivate::genre() const
 {
     TX_LOG
-	QString localizedString(mGenre);
-
-	if ( mGenre == "Acoustic" ) {
-		localizedString = hbTrId( "txt_mus_dblist_genre_val_acoustic" );
-	}
-    else if ( mGenre == "Alternative" ) {
-		localizedString = hbTrId( "txt_mus_dblist_genre_val_alternative" );
-    }
-    else if ( mGenre == "Blues" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_blues" );
-    }
-    else if ( mGenre == "Classical" ) {
-		localizedString = hbTrId( "txt_mus_dblist_genre_val_classical" );
-    }
-    else if ( mGenre == "Country" ) {
-		localizedString = hbTrId( "txt_mus_dblist_genre_val_country" );
-    }
-    else if ( mGenre == "Dance" ) {
-    	localizedString = hbTrId( "txt_mus_dblist_genre_val_dance" );
-    }
-    else if ( mGenre == "Easy Listening" ) {
-		localizedString = hbTrId( "txt_mus_dblist_genre_val_easy_listening" );
-    }
-    else if ( mGenre == "Electronic" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_electronic" );
-    }
-    else if ( mGenre == "Folk" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_folk" );
-    }
-	else if ( mGenre == "Hip-Hop" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_hiphop" );
-    }
-    else if ( mGenre == "Jazz" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_jazz" );
-    }
-    else if ( mGenre == "Latin" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_latin" );
-    }
-    else if ( mGenre == "Metal" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_metal" );
-    }
-    else if ( mGenre == "New Age" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_new_age" );
-    }
-    else if ( mGenre == "Other" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_other" );
-    }
-    else if ( mGenre == "Pop" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_pop" );
-    }
-    else if ( mGenre == "R&B" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_rb" );
-    }
-    else if ( mGenre == "Rap" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_rap" );
-    }
-    else if ( mGenre == "Reggae" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_reggae" );
-    }
-    else if ( mGenre == "Rock" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_rock" );
-    }
-    else if ( mGenre == "Soundtrack" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_soundtrack" );
-    }
-    else if ( mGenre == "Spoken" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_spoken" );
-    }
-    else if ( mGenre == "World" ) {
-        localizedString = hbTrId( "txt_mus_dblist_genre_val_world" );
-    }
-    TX_EXIT_ARGS( "Logical String = " << localizedString );
-    return localizedString;
+    return mGenre;
 }
 
 /*!
--- a/mpdata/tsrc/unittest_mpcollectiondatamodel/inc/unittest_mpcollectiondatamodel.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/inc/unittest_mpcollectiondatamodel.h	Tue Aug 24 03:36:14 2010 -0500
@@ -23,6 +23,7 @@
 class QTranslator;
 class MpCollectionDataModel;
 class MpMpxCollectionData;
+class MpPlaybackData;
 class TestHelper;
 
 class TestMpCollectionDataModel : public QObject
@@ -76,12 +77,14 @@
     void testMimeData();
     void testDropMimeData();
     void testSetContext();
+    void testFileCorrupted();
 
 private:
 
     MpCollectionDataModel   *mTest;
     TestHelper              *mHelper;
     MpMpxCollectionData     *mStubData;
+    MpPlaybackData          *mStubPlaybackData;
     QTranslator             *mMpTranslator; // Own
 
 };
--- a/mpdata/tsrc/unittest_mpcollectiondatamodel/src/unittest_mpcollectiondatamodel.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/src/unittest_mpcollectiondatamodel.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -30,6 +30,7 @@
 #include "unittest_helper.h"
 #include "stub/inc/mpcollectionalbumartmanager.h"
 #include "stub/inc/mpmpxcollectiondata.h"
+#include "stub/inc/mpplaybackdata.h"
 
 // Do this so we can access all member variables.
 #define private public
@@ -58,6 +59,7 @@
     : mTest(0),
       mHelper(0),
       mStubData(0),
+      mStubPlaybackData(0),
       mMpTranslator(0)
 {
 }
@@ -67,6 +69,7 @@
     delete mTest;
     delete mHelper;
     delete mStubData;
+    delete mStubPlaybackData;
     delete mMpTranslator;
 }
 
@@ -86,6 +89,7 @@
     }
 
     mStubData = new MpMpxCollectionData();
+    mStubPlaybackData = new MpPlaybackData(this);
     mHelper = new TestHelper();
 }
 
@@ -96,6 +100,8 @@
 {
     delete mStubData;
     mStubData = 0;
+    delete mStubPlaybackData;
+    mStubPlaybackData = 0;
     delete mHelper;
     mHelper = 0;
 }
@@ -105,7 +111,7 @@
  */
 void TestMpCollectionDataModel::init()
 {
-    mTest = new MpCollectionDataModel(mStubData);
+    mTest = new MpCollectionDataModel(mStubData, mStubPlaybackData);
     MpMpxCollectionData::resetItemDataCounter();
     mTest->mCollectionData->mItemDataReturn = true;
     mTest->mCollectionData->mCollectionTitleReturn = true;
@@ -966,4 +972,13 @@
     QCOMPARE(mTest->mAlbumIndexOffset, 0);
 }
 
+/*!
+ Tests fileCorrupted()
+ */
+void TestMpCollectionDataModel::testFileCorrupted()
+{
+    
+    
+}
+
 // End of file
--- a/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -19,6 +19,7 @@
 #define MPMPXCOLLECTIONDATA_H
 
 #include <QObject>
+#include <QAbstractListModel>
 
 #include "mpmpxcollectionviewdefs.h"
 
@@ -36,6 +37,11 @@
         Count,
         AlbumArtUri
     };
+    
+    enum DataProperty {
+           Corrupted,
+           DrmExpired
+    };
 
     // Test utility functions
     static int getInitCounter();
@@ -57,6 +63,8 @@
     int count() const;
     QString collectionTitle() const;
     QString itemData( int index, MpMpxCollectionData::DataType type ) const;
+    bool hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
+    bool hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
 
     int containerId();
     int itemId(int index);
@@ -65,6 +73,9 @@
     void insertCachedItem(int index);
 
     void setContext( TCollectionContext context );
+    QList<int> songIndex( int songUniqueId );
+    void setCorruptValue(QModelIndex index, bool tBone );
+    void setReloadAlbumContent( bool reloadAlbum );
 
 signals:
 
--- a/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpmpxcollectiondata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/tsrc/unittest_mpcollectiondatamodel/stub/src/mpmpxcollectiondata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -195,6 +195,14 @@
 /*!
  Stub function.
  */
+bool MpMpxCollectionData::hasItemProperty( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+
+}
+
+/*!
+ Stub function.
+ */
 int MpMpxCollectionData::containerId()
 {
     return 65535;
@@ -246,3 +254,27 @@
     return ;
 }
 
+/*!
+ Stub function.
+ */
+QList<int> MpMpxCollectionData::songIndex( int songUniqueId )
+    {
+    
+    }
+
+/*!
+ Stub function.
+ */
+void MpMpxCollectionData::setCorruptValue(QModelIndex index, bool tBone )
+    {
+    
+    }
+
+/*!
+ Stub function.
+ */
+void MpMpxCollectionData::setReloadAlbumContent( bool reloadAlbum )
+    {
+    
+    }
+
--- a/mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_mpmpxcollectiondata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_mpmpxcollectiondata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -62,6 +62,9 @@
     void testSetAlbumContent();
     void testSetCurrentAlbum();
     void testAlbumSongData();
+    void testHasItemProperty();
+    void testHasAlbumSongProperty();
+
 
 private:
 
--- a/mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_mpmpxcollectiondata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpdata/tsrc/unittest_mpmpxcollectiondata/src/unittest_mpmpxcollectiondata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -21,6 +21,7 @@
 #include <apacmdln.h>
 #include <mpxmediamusicdefs.h>
 #include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
 #include <mpxmedia.h>
 #include <mpxmediaarray.h>
 #include <mpxcollectionpath.h>
@@ -656,7 +657,7 @@
     TCollectionContext context = qvariant_cast<TCollectionContext>(spy.at(0).at(0));
     QCOMPARE(context, ECollectionContextPlaylistSongs);
     QCOMPARE(mTestPrivate->iContext, ECollectionContextPlaylistSongs);
-    QVERIFY(mTestPrivate->albumIdIndexMapping.isEmpty());
+    QVERIFY(mTestPrivate->iAlbumIdIndexMapping.isEmpty());
 }
 
 /*!
@@ -692,12 +693,12 @@
     TCollectionContext context = qvariant_cast<TCollectionContext>(spy.at(0).at(0));
     QCOMPARE(context, ECollectionContextAlbumsMediaWall);
     QCOMPARE(mTestPrivate->iContext, ECollectionContextAlbumsMediaWall);
-    QVERIFY(!mTestPrivate->albumIdIndexMapping.isEmpty());
+    QVERIFY(!mTestPrivate->iAlbumIdIndexMapping.isEmpty());
     for (TInt i =0; i < count; i++) {
         QCOMPARE(mTest->itemIndex(KAllSongsTestData[i].GeneralId),i);
     }
     mTest->setContext(ECollectionContextPlaylistSongs);
-    QVERIFY(mTestPrivate->albumIdIndexMapping.isEmpty());
+    QVERIFY(mTestPrivate->iAlbumIdIndexMapping.isEmpty());
     CleanupStack::PopAndDestroy(array);
 }
 
@@ -860,3 +861,115 @@
     mTestPrivate->iMediaArray = NULL;
     CleanupStack::PopAndDestroy(array);
 }
+
+/*!
+ Tests hasAlbumSongProperty().
+ */
+void TestMpMpxCollectionData::testHasItemProperty()
+{
+    CMPXMediaArray* array = CMPXMediaArray::NewL();
+    CleanupStack::PushL(array);
+    mTestPrivate->iMediaArray = array;
+
+    TInt count = sizeof(KAllSongsTestData)/sizeof(TTestAttrs);
+    for (TInt i =0; i < count; i++) {
+
+        CMPXMedia* media = CMPXMedia::NewL();
+        CleanupStack::PushL(media);
+        media->SetTextValueL(KMPXMediaGeneralTitle, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].GeneralTitle)));
+        media->SetTextValueL(KMPXMediaMusicArtist, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].MusicArtist)));
+        media->SetTObjectValueL<TInt>(KMPXMediaGeneralCount, KAllSongsTestData[i].GeneralCount);
+        media->SetTextValueL(KMPXMediaMusicAlbumArtFileName, TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].MusicAlbumArtFileName)));
+        array->AppendL(*media);
+        CleanupStack::PopAndDestroy(media);
+        mTestPrivate->iMediaArray = array;
+
+        const TDesC& title = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].GeneralTitle));
+        QCOMPARE(mTest->itemData( i, MpMpxCollectionData::Title), QString::fromUtf16( title.Ptr(), title.Length()));
+
+        const TDesC& artist = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].MusicArtist));
+        QCOMPARE(mTest->itemData( i, MpMpxCollectionData::Artist), QString::fromUtf16( artist.Ptr(), artist.Length()));
+
+        QCOMPARE(mTest->itemData( i, MpMpxCollectionData::Count), QString().setNum(1));
+
+        const TDesC& albumArtUri = TPtrC(reinterpret_cast<const TUint16*>(KAllSongsTestData[i].MusicAlbumArtFileName));
+        QCOMPARE(mTest->itemData( i, MpMpxCollectionData::AlbumArtUri), QString::fromUtf16( albumArtUri.Ptr(), albumArtUri.Length()));
+
+    }
+    mTestPrivate->iMediaArray = array;
+
+    CMPXMedia* media = CMPXMedia::NewL();
+    CleanupStack::PushL(media);
+    array->AppendL(*media);
+    mTestPrivate->iMediaArray = array;
+    media->SetTextValueL(KMPXMediaGeneralTitle,KNullDesC );
+    media->SetTextValueL(KMPXMediaMusicArtist, KNullDesC);
+    media->SetTObjectValueL<TInt>(KMPXMediaGeneralCount, 0);
+    media->SetTextValueL(KMPXMediaMusicAlbumArtFileName, KNullDesC);
+    array->AppendL(*media);
+    CleanupStack::PopAndDestroy(media);
+    mTestPrivate->iMediaArray = array;
+
+    //Media without attributes.
+    QVERIFY(mTest->itemData( count, MpMpxCollectionData::Title).isNull());
+    QVERIFY(mTest->itemData( count, MpMpxCollectionData::Artist).isNull());
+    QCOMPARE(mTest->itemData( count, MpMpxCollectionData::Count), QString().setNum(0));
+    QVERIFY(mTest->itemData( count, MpMpxCollectionData::AlbumArtUri).isNull());
+
+    //Media with empty attributes.
+    QVERIFY(mTest->itemData( count + 1, MpMpxCollectionData::Title).isNull());
+    QVERIFY(mTest->itemData( count + 1, MpMpxCollectionData::Artist).isNull());
+    QCOMPARE(mTest->itemData( count + 1, MpMpxCollectionData::Count), QString().setNum(0));
+    QVERIFY(mTest->itemData( count + 1, MpMpxCollectionData::AlbumArtUri).isNull());
+
+    // Test Attributes that are not implemented yet:
+    //     Uri, Duration, Album, Genre, Rating
+    QVERIFY(mTest->itemData( 0, MpMpxCollectionData::Uri).isNull());
+    QVERIFY(mTest->itemData( 0, MpMpxCollectionData::Duration).isNull());
+    QVERIFY(mTest->itemData( 0, MpMpxCollectionData::Album).isNull());
+    QVERIFY(mTest->itemData( 0, MpMpxCollectionData::Genre).isNull());
+    QVERIFY(mTest->itemData( 0, MpMpxCollectionData::Rating).isNull());
+
+    CleanupStack::PopAndDestroy(array);
+    mTestPrivate->iMediaArray = NULL;
+
+}
+
+/*!
+ Tests hasAlbumSongProperty().
+ */
+void TestMpMpxCollectionData::testHasAlbumSongProperty()
+{
+    // Populate the media (album) with songs. This is basically
+    // simulating setAlbumContent().
+    CMPXMediaArray* array = CMPXMediaArray::NewL();
+    CleanupStack::PushL(array);
+    CMPXMedia* media = CMPXMedia::NewL();
+    CleanupStack::PushL(media);
+    CMPXMediaArray* songArray = CMPXMediaArray::NewL();
+    CleanupStack::PushL(songArray);
+    CMPXMedia* song = CMPXMedia::NewL();
+    CleanupStack::PushL(song);
+    song->SetTObjectValueL<TUint>( KMPXMediaGeneralFlags,KMPXMediaGeneralFlagsIsCorrupted );
+    songArray->AppendL(*song);
+    CleanupStack::PopAndDestroy(song);
+    CMPXMedia* song1 = CMPXMedia::NewL();
+    CleanupStack::PushL(song1);
+    song1->SetTObjectValueL<TUint>( KMPXMediaGeneralFlags,KMPXMediaGeneralFlagsIsDrmLicenceInvalid );
+    songArray->AppendL(*song1);
+    CleanupStack::PopAndDestroy(song1);
+    
+    media->SetCObjectValueL(KMPXMediaArrayContents, songArray);
+    array->AppendL(*media);
+
+    mTestPrivate->iMediaArray = array;
+    mTestPrivate->iCurrentAlbumIndex = 0;
+
+    QCOMPARE(mTest->hasAlbumSongProperty( 0, MpMpxCollectionData::Corrupted), true);
+    QCOMPARE(mTest->hasAlbumSongProperty( 1, MpMpxCollectionData::DrmExpired), true);
+
+    CleanupStack::PopAndDestroy(songArray);
+    CleanupStack::PopAndDestroy(media);
+    mTestPrivate->iMediaArray = NULL;
+    CleanupStack::PopAndDestroy(array);
+}
--- a/mpengine/bwins/mpengineu.def	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/bwins/mpengineu.def	Tue Aug 24 03:36:14 2010 -0500
@@ -138,4 +138,5 @@
 	?reorderPlaylist@MpEngine@@QAEXHHHH@Z @ 137 NONAME ; void MpEngine::reorderPlaylist(int, int, int, int)
 	?scanFinished@MpSongScanner@@IAEXHH@Z @ 138 NONAME ; void MpSongScanner::scanFinished(int, int)
 	?setLoudness@MpEngine@@QAEX_N@Z @ 139 NONAME ; void MpEngine::setLoudness(bool)
+	?corruptedStop@MpEngine@@IAEXXZ @ 140 NONAME ; void MpEngine::corruptedStop(void)
 
--- a/mpengine/eabi/mpengineu.def	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/eabi/mpengineu.def	Tue Aug 24 03:36:14 2010 -0500
@@ -138,4 +138,5 @@
 	_ZTV13MpSongScanner @ 137 NONAME
 	_ZTV15MpEngineFactory @ 138 NONAME
 	_ZTV8MpEngine @ 139 NONAME
+	_ZN8MpEngine13corruptedStopEv @ 140 NONAME
 
--- a/mpengine/inc/mpmpxplaybackframeworkwrapper.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/inc/mpmpxplaybackframeworkwrapper.h	Tue Aug 24 03:36:14 2010 -0500
@@ -50,7 +50,9 @@
 
 signals:
 
-    void volumePropertyChanged( MpCommon::MpVolumeProperty property, int value );
+	void volumePropertyChanged( MpCommon::MpVolumeProperty property, int value );
+    void corruptedStop();
+    void fileCorrupted(int fileId);
 
 public slots:
     
--- a/mpengine/inc/mpmpxplaybackframeworkwrapper_p.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/inc/mpmpxplaybackframeworkwrapper_p.h	Tue Aug 24 03:36:14 2010 -0500
@@ -87,6 +87,7 @@
     void DoPlayL( QString aFilename );
     void DoPlayL( const XQSharableFile& file );
     void DoHandlePlaybackMessageL( const CMPXMessage& aMessage );
+    void DoHandlePlaybackErrorL( const TInt aError );
     void ForceStopL();
     void UpdateStateL();
     void DoRetrieveSongDetailsL( bool detailsRequest );
--- a/mpengine/src/mpengine.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/src/mpengine.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -188,6 +188,12 @@
     such as EPbPropertyVolume, EPbPropertyMaxVolume, EPbPropertyMute.
  */
 
+/*!
+    \fn void corruptedStop();
+    
+    This signal is emitted when framework determines the corrupted song is the last 
+    song of the playlist.
+*/
 
 /*!
  Constructs music player engine.
@@ -199,7 +205,7 @@
       mMpxPlaybackWrapper(0),
       mAudioEffectsWrapper(0),
       mEqualizerWrapper(0),
-      mCurrentPresetIndex(KEqualizerPresetNone),
+      mCurrentPresetIndex(0),
       mSongData(0),
       mUsbBlockingState(USB_NotConnected),
       mPreviousUsbState(USB_NotConnected),
@@ -289,7 +295,9 @@
         mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, mSongData );
         connect( this, SIGNAL( libraryUpdated() ),
                  mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) );
-        connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ),
+        connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop() ),
+                 this, SIGNAL( corruptedStop() ));
+		connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ),
                  this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) );
 
         // AudioEffects wrapper
@@ -326,7 +334,9 @@
         mMpxPlaybackWrapper = new MpMpxPlaybackFrameworkWrapper( mHostUid, 0 );
         connect( this, SIGNAL( libraryUpdated() ),
                  mMpxPlaybackWrapper, SLOT( closeCurrentPlayback() ) );
-        connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ),
+	    connect( mMpxPlaybackWrapper, SIGNAL ( corruptedStop() ),
+				 this, SIGNAL( corruptedStop() ));
+	    connect( mMpxPlaybackWrapper, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ),
                  this, SIGNAL( volumePropertyChanged( MpCommon::MpVolumeProperty, int ) ) );
 
     }
@@ -1122,9 +1132,9 @@
 {
     TX_ENTRY
 
-    mCurrentPresetIndex = KEqualizerPresetNone;
+    mCurrentPresetIndex = 0;
     // Store in CenRep file
-    MpSettingsManager::setPreset( mCurrentPresetIndex );
+    MpSettingsManager::setPreset( KEqualizerPresetNone );
     // Notify playback framework of the change.
     mMpxPlaybackWrapper->applyEqualizer();
 
@@ -1175,9 +1185,7 @@
     // Get preset id from cenrep
     TInt presetKey( MpSettingsManager::preset() );
     
-    //Set the current preset index. 1 is added to index because index 0 represent "Off" at UI level.
     mCurrentPresetIndex = mEqualizerWrapper->getPresetIndex( presetKey );
-    mCurrentPresetIndex++;
     emit equalizerReady();
     
     TX_EXIT
--- a/mpengine/src/mpequalizerframeworkwrapper_p.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/src/mpequalizerframeworkwrapper_p.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -120,14 +120,15 @@
 {
     TX_ENTRY_ARGS( "Preset Name Key = " << presetNameKey);
 
-    int presetIndex = KEqualizerPresetNone;
+    int presetIndex = 0;
     if ( mEqualizerUtility && presetNameKey != KEqualizerPresetNone ) {
         TArray<TEfAudioEqualizerUtilityPreset> presetArray = mEqualizerUtility->Presets();
         for ( TInt i = 0; i < presetArray.Count(); i++ ) {
             TX_LOG_ARGS("presetArray[" << i << "].iPresetNameKey (" 
                 << presetArray[i].iPresetNameKey << ") vs presetId (" <<presetNameKey << ")");
             if ( presetArray[i].iPresetNameKey == static_cast<TUint32>( presetNameKey ) ) {
-                presetIndex = i;
+				//Set the current preset index. 1 is added to index because index 0 represent "Off" at UI level.
+                presetIndex = i+1;
                 break;
             }
         }
--- a/mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/src/mpmpxcollectionframeworkwrapper_p.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -59,9 +59,8 @@
 #include "mpsettingsmanager.h"
 #include "mpsongdata.h"
 
-const TInt KIncrementalDelayNone = 0;
-const TInt KIncrementalDelayHalfSecond = 500000;
-const TInt KIncrementalFetchBlockSize = 400;
+const TInt KIncrementalDelay = 0;
+const TInt KIncrementalFetchBlockSize = 1000;
 
 const TInt KMPXChunkSize = 100;  // number of songs added in each chunk, IncAddL
 _LIT( KPlaylistPath, "C:\\Data\\Playlists\\" ); // Todo
@@ -452,13 +451,15 @@
             iFirstIncrementalOpen = EFalse;
             if( iShuffleAll ) {
                 iShuffleAll = EFalse;
-                TX_ENTRY_ARGS( "Path is ready" );
+                TX_LOG_ARGS( "Path is ready" );
                 DoPlayAllSongsPlaylistL();
-                
             }
             iCollectionData->setMpxMedia( aEntries, iReopen );
             iReopen = EFalse;
         }
+        else {
+            iCollectionData->incrementalOpenUpdate();
+        }
     }
     else {
         TX_LOG_ARGS( "Error: " << aError << "; should never get here." );
@@ -749,10 +750,9 @@
     RArray<TMPXAttribute> attrs;
     CleanupClosePushL( attrs );
     TArray<TMPXAttribute> ary = attrs.Array();
-    iIncrementalOpenUtil->SetDelay( KIncrementalDelayNone );
+    iIncrementalOpenUtil->SetDelay( KIncrementalDelay );
     iIncrementalOpenUtil->StartL( ary, KIncrementalFetchBlockSize,
-                                  KErrNotFound, CMPXCollectionOpenUtility::EFetchDown );
-    iIncrementalOpenUtil->SetDelay( KIncrementalDelayHalfSecond );
+            0, CMPXCollectionOpenUtility::EFetchDown );
     CleanupStack::PopAndDestroy( &attrs );
     TX_EXIT
 }
--- a/mpengine/src/mpmpxisolatedcollectionhelper.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/src/mpmpxisolatedcollectionhelper.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -21,14 +21,10 @@
 #include <mpxcollectionopenutility.h>
 
 #include "mpmpxisolatedcollectionhelper.h"
-#include "mpxlog.h"
-
-
+#include "mptrace.h"
 
-const TInt KIncrementalDelayNone = 0;
-const TInt KIncrementalDelayHalfSecond = 1000000;
-const TInt KIncrementalFetchBlockSize = 20;
-
+const TInt KIncrementalDelay = 0;
+const TInt KIncrementalFetchBlockSize = 1000;
 
 
 /*!
@@ -42,44 +38,45 @@
  \internal
  Two-phased constructor.
  */
-CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewL( 
+CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewL(
         MMpMpxIsolatedCollectionHelperObserver* aObserver )
-    {
+{
     CMpMpxIsolatedCollectionHelper* self = NewLC( aObserver );
     CleanupStack::Pop( self );
     return self;
-    }
+}
 
 /*!
  \internal
  Two-phased constructor.
  */
-CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewLC( 
+CMpMpxIsolatedCollectionHelper* CMpMpxIsolatedCollectionHelper::NewLC(
         MMpMpxIsolatedCollectionHelperObserver* aObserver )
-    {
+{
     CMpMpxIsolatedCollectionHelper* self =
             new ( ELeave ) CMpMpxIsolatedCollectionHelper( aObserver );
     CleanupStack::PushL( self );
     self->ConstructL();
     return self;
-    }
+}
 
 /*!
  \internal
  Destructor
  */
 CMpMpxIsolatedCollectionHelper::~CMpMpxIsolatedCollectionHelper()
-    {
+{
     delete iIncrementalOpenUtil;
-    }
-    
+}
+
 
 /*!
  \internal
  Opens an isolated collection with the /a path.
  */
 void CMpMpxIsolatedCollectionHelper::OpenCollectionL( CMPXCollectionPath& aPath, TInt aIndex, MpOpenMode aMode )
-    {
+{
+    TX_ENTRY
     //Using incremental open to open the collection.
     iOpenMode = aMode;
     // Cancel any reads
@@ -90,12 +87,12 @@
     RArray<TMPXAttribute> attrs;
     CleanupClosePushL( attrs );
     TArray<TMPXAttribute> ary = attrs.Array();
-    iIncrementalOpenUtil->SetDelay( KIncrementalDelayNone );
+    iIncrementalOpenUtil->SetDelay( KIncrementalDelay );
     iIncrementalOpenUtil->StartL( aPath, ary, KIncrementalFetchBlockSize,
-                                  aIndex, CMPXCollectionOpenUtility::EFetchNormal );
-    iIncrementalOpenUtil->SetDelay( KIncrementalDelayHalfSecond );
+                                  aIndex, CMPXCollectionOpenUtility::EFetchDown );
     CleanupStack::PopAndDestroy( &attrs );
-    }
+    TX_EXIT
+}
 
 /*!
  \internal
@@ -105,79 +102,84 @@
     : iObserver( aObserver ),
       iIncrementalOpenUtil( 0 ),
       iFirstIncrementalOpen( EFalse )
-    {
-    }
+{
+}
 
 /*!
  \internal
  Leaving constructor
  */
 void CMpMpxIsolatedCollectionHelper::ConstructL()
-    {
+{
     iIncrementalOpenUtil = CMPXCollectionOpenUtility::NewL( this, KMcModeIsolated );
-
-    }
+}
 
 
 /*!
  \internal
  reimp
  */
-void CMpMpxIsolatedCollectionHelper::HandleOpenL( 
+void CMpMpxIsolatedCollectionHelper::HandleOpenL(
     const CMPXMedia& aEntries,
-    TInt /*aIndex*/,
-    TBool /*aComplete*/,
+    TInt aIndex,
+    TBool aComplete,
     TInt aError )
-    {
-    if ( iFirstIncrementalOpen )
-        {
+{
+    Q_UNUSED( aIndex );
+    Q_UNUSED( aComplete );
+    TX_ENTRY_ARGS( "aError=" << aError << "aComplete=" << aComplete );
+    if ( iFirstIncrementalOpen ) {
         CMPXCollectionPath* cPath = NULL;
         iFirstIncrementalOpen = EFalse;
         switch( iOpenMode ) {
-        case RestorePathMode:
-            cPath = iIncrementalOpenUtil->PathL();
-            CleanupStack::PushL( cPath );
-            iObserver->HandleIsolatedOpenRestorePathL( *cPath, aError );
-            CleanupStack::PopAndDestroy( cPath );
-
-            break;
-        case DefaultMode:
-        default:
-            iObserver->HandleIsolatedOpenL( aEntries, aError );
-            break;
-        }
-        
-        }
+            case RestorePathMode:
+                cPath = iIncrementalOpenUtil->PathL();
+                CleanupStack::PushL( cPath );
+                iObserver->HandleIsolatedOpenRestorePathL( *cPath, aError );
+                CleanupStack::PopAndDestroy( cPath );
+                break;
+            case DefaultMode:
+            default:
+                iObserver->HandleIsolatedOpenL( aEntries, aError );
+                break;
+            }
     }
+    TX_EXIT
+}
 
 /*!
  \internal
   reimp
  */
-void CMpMpxIsolatedCollectionHelper::HandleOpenL( 
-    const CMPXCollectionPlaylist& /*aPlaylist*/,
-    TInt /*aError*/ )
-    {
-    }
+void CMpMpxIsolatedCollectionHelper::HandleOpenL(
+    const CMPXCollectionPlaylist& aPlaylist,
+    TInt aError )
+{
+    Q_UNUSED( aPlaylist );
+    Q_UNUSED( aError );
+}
 
 /*!
  \internal
   reimp
  */
-void CMpMpxIsolatedCollectionHelper::HandleCollectionMessage( 
-    CMPXMessage* /*aMsg*/,
-    TInt /*aErr*/ )
-    {
-    }
+void CMpMpxIsolatedCollectionHelper::HandleCollectionMessage(
+    CMPXMessage* aMsg,
+    TInt aErr )
+{
+    Q_UNUSED( aMsg );
+    Q_UNUSED( aErr );
+}
 
 /*!
  \internal
   reimp
  */
-void CMpMpxIsolatedCollectionHelper::HandleCollectionMediaL( 
-    const CMPXMedia& /*aMedia*/,
-    TInt /*aError*/ )
-    {
-    }
-    
-//EOF
+void CMpMpxIsolatedCollectionHelper::HandleCollectionMediaL(
+    const CMPXMedia& aMedia,
+    TInt aError )
+{
+    Q_UNUSED( aMedia );
+    Q_UNUSED( aError );
+}
+
--- a/mpengine/src/mpmpxplaybackframeworkwrapper.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/src/mpmpxplaybackframeworkwrapper.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -36,6 +36,19 @@
  */
 
 /*!
+    \fn void corruptedStop();
+
+    This signal is emitted when a courrpted song is discovered and is the last song of 
+    the playlist
+ */
+
+/*!
+    \fn void fileCorrupted(int fileId);
+
+    This signal is emitted when a courrpted song is discovered with fileId.
+ */
+
+/*!
  Constructs the utility wrapper.
  */
 MpMpxPlaybackFrameworkWrapper::MpMpxPlaybackFrameworkWrapper( TUid hostUid, MpSongData *songData, QObject *parent )
--- a/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/src/mpmpxplaybackframeworkwrapper_p.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -28,6 +28,7 @@
 #include <mpxplaybackframeworkdefs.h>
 #include <hbglobal.h>
 #include <xqsharablefile.h>
+#include <mpxcollectionplaylist.h>
 
 #include "mpmpxplaybackframeworkwrapper_p.h"
 #include "mpmpxplaybackframeworkwrapper.h"
@@ -36,6 +37,7 @@
 #include "mptrace.h"
 #include "mpxaudioeffectengine.h"
 #include "mpsongdata.h"
+#include "mpxcollectionpath.h"
 
 _LIT(KMPXPnRealAudioMimeType, "audio/x-pn-realaudio");
 _LIT(KMPXRealAudioMimeType, "audio/x-realaudio");
@@ -456,6 +458,9 @@
     if ( aError == KErrNone && aMessage ) {
         TRAP_IGNORE( DoHandlePlaybackMessageL(*aMessage) );
     }
+    else{
+        TRAP_IGNORE( DoHandlePlaybackErrorL(aError) );
+	}
     TX_EXIT
 }
 
@@ -726,6 +731,39 @@
 /*!
  \internal
  */
+void MpMpxPlaybackFrameworkWrapperPrivate::DoHandlePlaybackErrorL( const TInt aError )
+{
+    TX_ENTRY
+    switch ( aError ) {
+                case KErrCorrupt:{
+                    MMPXSource* source( iPlaybackUtility->Source() );
+                    if ( source ){
+                        CMPXCollectionPlaylist* playlist( source->PlaylistL() );
+                        if ( playlist ){
+                            MpPlaybackData* pData = playbackData();
+                            pData->setCorrupted( playlist->Path().IdOfIndex( playlist->Index() ).iId2 );
+                            
+                            if ( playlist->Index() == ( playlist->Count()-1 ) ){
+                                //reach the end of list, pop up corrupt notification
+                                emit q_ptr->corruptedStop();
+                            }
+                            else{
+                                //corrupted song, skip to next song
+                                skipForward();
+                            }
+                        }
+                    }
+                    break;
+                }
+                default:
+                    break;
+            }
+    TX_EXIT
+}
+
+/*!
+ \internal
+ */
 void MpMpxPlaybackFrameworkWrapperPrivate::ForceStopL()
 {
     TX_ENTRY
--- a/mpengine/tsrc/unittest_mpengine/src/unittest_mpengine.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpengine/src/unittest_mpengine.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -525,7 +525,7 @@
     mTest = MpEngineFactory::createIsolatedEngine( MpEngine::StandAlone );
     mTest->disableEqualizer();
     
-    QCOMPARE( mTest->mCurrentPresetIndex, KEqualizerPresetNone );
+    QCOMPARE( mTest->mCurrentPresetIndex, 0 );
 }
 
 /*!
@@ -557,7 +557,7 @@
     QSignalSpy spy( mTest, SIGNAL( equalizerReady() ) );
     
     mTest->handleEqualizerReady();
-    QCOMPARE( mTest->mCurrentPresetIndex, 1 );
+    QCOMPARE( mTest->mCurrentPresetIndex, 0 );
     QVERIFY( spy.count() == 1 );
 }
 
--- a/mpengine/tsrc/unittest_mpequalizerframeworkwrapper/src/unittest_mpequalizerframeworkwrapper.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpequalizerframeworkwrapper/src/unittest_mpequalizerframeworkwrapper.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -133,21 +133,21 @@
     
     // When EqualizerUtility is not ready
     presetIndex = mTestPrivate->getPresetIndex(0x0B);    
-    QVERIFY(presetIndex == KEqualizerPresetNone);
+    QVERIFY(presetIndex == 0);
     
     mTestPrivate->MapcInitComplete(KErrNone, 0);
     
     //When a valid preset is currently set
     presetIndex = mTestPrivate->getPresetIndex(0x0B);    
-    QVERIFY(presetIndex == 1);
+    QVERIFY(presetIndex == 2);
     
     //When there is no any preset set
     presetIndex = mTestPrivate->getPresetIndex(KEqualizerPresetNone);    
-    QVERIFY(presetIndex == KEqualizerPresetNone);
+    QVERIFY(presetIndex == 0);
 
     //When an invalid preset is currently set
     presetIndex = mTestPrivate->getPresetIndex(0xFF);    
-    QVERIFY(presetIndex == KEqualizerPresetNone);
+    QVERIFY(presetIndex == 0);
 }
 
 /*!
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/src/unittest_mpmpxcollectionframeworkwrapper.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -400,11 +400,11 @@
 void TestMpMpxCollectionFrameworkWrapper::testDoIncrementalOpen()
 {
     mTestPrivate->DoIncrementalOpenL();
-    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDelay, KIncrementalDelayHalfSecond);
+    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDelay, KIncrementalDelay);
     QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iStop,TBool(ETrue));
     QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iStart,TBool(ETrue));
     QCOMPARE(mTestPrivate->iFirstIncrementalOpen,TBool(ETrue));
-    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchNormal);
+    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchDown);
     QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iChunkSize, KIncrementalFetchBlockSize);
 }
 
@@ -770,13 +770,13 @@
     testMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralData,EMcContainerOpened);
     mTestPrivate->DoHandleCollectionMessageL(*testMessage);
     //mTestPrivate->HandleCollectionMessage(*testMessage, KErrNone);
-    QCOMPARE(mTestPrivate->iCollectionUtility->iOpen,TBool(EFalse)); 
-    
-    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDelay, KIncrementalDelayHalfSecond);
+    QCOMPARE(mTestPrivate->iCollectionUtility->iOpen,TBool(EFalse));
+
+    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDelay, KIncrementalDelay);
     QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iStop,TBool(ETrue));
     QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iStart,TBool(ETrue));
     QCOMPARE(mTestPrivate->iFirstIncrementalOpen,TBool(ETrue));
-    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchNormal);
+    QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iDirection,CMPXCollectionOpenUtility::EFetchDown);
     QCOMPARE(mTestPrivate->iIncrementalOpenUtil->iChunkSize, KIncrementalFetchBlockSize);
 
     //Opened a song
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpmpxcollectiondata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/inc/mpmpxcollectiondata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -54,6 +54,7 @@
     int currentAlbumIndex() const;
 
     void setMpxMedia( const CMPXMedia& entries, bool reopen=false );
+    void incrementalOpenUpdate();
     const CMPXMedia& containerMedia();
 
     void setAlbumContent( const CMPXMedia& albumContent );
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpmpxcollectiondata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpmpxcollectiondata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -120,6 +120,13 @@
 
 /*!
  Stub function.
+ */
+void MpMpxCollectionData::incrementalOpenUpdate()
+{
+}
+
+/*!
+ Stub function.
 */
 const CMPXMedia& MpMpxCollectionData::containerMedia()
 {
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionopenutility.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionopenutility.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -27,9 +27,9 @@
  Stub function.
 */
 CMPXCollectionOpenUtility::CMPXCollectionOpenUtility():iDelay(0),
-                                                       iStart(EFalse),
+                                                       iChunkSize(0),
                                                        iStop(EFalse),
-                                                       iChunkSize(0),
+                                                       iStart(EFalse),
                                                        iDirection(EFetchDown)
 {
     
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionuihelper.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionuihelper.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -23,7 +23,6 @@
 #include <e32debug.h>
 
 #include "stub/inc/mpxcollectionuihelper.h"
-const TInt KMPXAllSongsViewIndex = 0;
 const TInt KMPXPlaylistViewIndex = 1;
 
 
@@ -33,10 +32,10 @@
 MMPXCollectionUiHelper::MMPXCollectionUiHelper():iIncAdd(EFalse),
                                                  iDelete(EFalse),
                                                  iCancel(EFalse),
+                                                 iMedia(0),
                                                  iValidRename(EFalse),
-                                                 iValidReorder(EFalse),
-                                                 iMedia(0)
-{   
+                                                 iValidReorder(EFalse)
+{
 }
 
 /*!
--- a/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionutility.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxcollectionframeworkwrapper/stub/src/mpxcollectionutility.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -30,7 +30,6 @@
 #include <e32debug.h>
 
 #include "stub/inc/mpxcollectionutility.h"
-const TInt KMPXAllSongsViewIndex = 0;
 const TInt KMPXPlaylistViewIndex = 1;
 
 /*!
@@ -39,14 +38,13 @@
 MMPXCollectionUtility::MMPXCollectionUtility():iBack(EFalse),
                                                iOpen(EFalse),
                                                iMedia(EFalse),
-                                               iIndex(0),
                                                iOpenCount(0),
                                                iCountPath(0),
+                                               iIndex(0),
                                                iPlaylists(0),
                                                iAlbumSongs(0),
                                                iAsynchFindResult(0)
 {
-    
 }
 
 /*!
@@ -114,7 +112,8 @@
        aCriteria.IsSupported(KMPXMediaGeneralCategory) && EMPXSong == aCriteria.ValueTObjectL<TMPXGeneralCategory>(KMPXMediaGeneralCategory) &&
        aCriteria.IsSupported(KMPXMediaGeneralId) && iAlbumSongs &&
        //it is assumed that album ID matches index on the media array, just to make test logic more simple.
-       TUint32(aCriteria.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)) >= 0 && TUint32(aCriteria.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)) < iAlbumSongs->Count())
+       aCriteria.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId).iId2 &&
+       (aCriteria.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId).iId2 < iAlbumSongs->Count()) )
         {
         return CMPXMedia::NewL(*iAlbumSongs->AtL(aCriteria.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)));
         }
--- a/mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/src/unittest_mpmpxisolatedcollectionhelper.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/src/unittest_mpmpxisolatedcollectionhelper.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -108,7 +108,7 @@
 {
     CMPXCollectionPath* path = CMPXCollectionPath::NewL();
     mTest->OpenCollectionL(*path);
-    QCOMPARE(mTest->iIncrementalOpenUtil->iDelay, KIncrementalDelayHalfSecond);
+    QCOMPARE(mTest->iIncrementalOpenUtil->iDelay, KIncrementalDelay);
     QCOMPARE(mTest->iIncrementalOpenUtil->iStop,TBool(ETrue));
     QCOMPARE(mTest->iIncrementalOpenUtil->iStart,TBool(ETrue));
     QCOMPARE(mTest->iFirstIncrementalOpen,TBool(ETrue));
@@ -118,7 +118,7 @@
     QCOMPARE(mTest->iOpenMode, CMpMpxIsolatedCollectionHelper::DefaultMode );
     
     mTest->OpenCollectionL(*path,0,CMpMpxIsolatedCollectionHelper::RestorePathMode);
-    QCOMPARE(mTest->iIncrementalOpenUtil->iDelay, KIncrementalDelayHalfSecond);
+    QCOMPARE(mTest->iIncrementalOpenUtil->iDelay, KIncrementalDelay);
     QCOMPARE(mTest->iIncrementalOpenUtil->iStop,TBool(ETrue));
     QCOMPARE(mTest->iIncrementalOpenUtil->iStart,TBool(ETrue));
     QCOMPARE(mTest->iFirstIncrementalOpen,TBool(ETrue));
--- a/mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/stub/src/mpxcollectionopenutility.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxisolatedcollectionhelper/stub/src/mpxcollectionopenutility.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -28,9 +28,9 @@
  Stub function.
 */
 CMPXCollectionOpenUtility::CMPXCollectionOpenUtility():iDelay(0),
-                                                       iStart(EFalse),
+                                                       iChunkSize(0),
                                                        iStop(EFalse),
-                                                       iChunkSize(0),
+                                                       iStart(EFalse),
                                                        iDirection(EFetchDown),
                                                        iMode(TUid::Null())
 {
--- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/inc/mpplaybackdata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -58,6 +58,7 @@
     bool setAlbumId( int id );
     bool setId( int id );
     void resetData();
+    void setCorrupted( int id );
 
 
 public:
--- a/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpengine/tsrc/unittest_mpmpxplaybackframeworkwrapper/stub/src/mpplaybackdata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -279,4 +279,13 @@
     mId = 0;
     mRealAudio = false;
 }
+
+/*!
+ Stub function.
+*/
+void MpPlaybackData::setCorrupted( int id )
+{
+
+}
+
 //end of file
--- a/mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -329,7 +329,8 @@
         extractPos = KMCPathStartPos;     // c:\..., include first '\' of the path
         }
 
-    TBuf<KMaxFileName+KMCIntegerLen> fileName;
+    HBufC* fileNameBuf = HBufC::NewLC(aName.Length()+KMCIntegerLen);
+    TPtr fileName(fileNameBuf->Des());
     if( extractPos )
         {
         // append volume's unique Id to path to maintain uniqueness
@@ -357,7 +358,7 @@
     TInt narrowFileLen(0);
     TPtrC8 narrowFileName;
     #if defined(_UNICODE)
-        narrowFileLen = fileName.Length() * 2;
+        narrowFileLen = fileNameBuf->Des().Length() * 2;
         narrowFileName.Set((TUint8*)fileName.Ptr(), narrowFileLen);
     #else
         narrowFileLen = fileName.Length();
@@ -375,6 +376,9 @@
     TUint32 uniqueId(0);
     uniqueId = aTableId << 28;
     uniqueId |= (ptr[3]&0x0F)<<24 | (ptr[2]<<16) | (ptr[1]<<8) | ptr[0];
+    
+    CleanupStack::PopAndDestroy(fileNameBuf);
+    
     return uniqueId;
     }
 
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxcollectiondbdef.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxcollectiondbdef.h	Tue Aug 24 03:36:14 2010 -0500
@@ -28,12 +28,13 @@
 
 // Db filename
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
-_LIT(KMCDbFile, "mpxv3_1.db");
-_LIT(KMCDbFileEMMC, "mpxv3_1i.db");
-#else
-_LIT(KMCDbFile, "mpxv3_1n.db");
-_LIT(KMCDbFileEMMC, "mpxv3_1in.db");
+_LIT(KMCDbFile, "mpxv3_2.db");
+_LIT(KMCDbFileEMMC, "mpxv3_2i.db");
+#else 
+_LIT(KMCDbFile, "mpxv3_2n.db");
+_LIT(KMCDbFileEMMC, "mpxv3_2in.db");
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
+
 // Collection Db resource file
 _LIT(KMPXCollectionDbResourceFile,  "mpxcollectiondbhgres.rsc");
 
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbalbum.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbalbum.h	Tue Aug 24 03:36:14 2010 -0500
@@ -29,8 +29,6 @@
 class MMPXDbAlbumObserver
     {
     public:
-        virtual TInt HandleIsUnknownArtistL(TUint32 aId) = 0;
-        virtual HBufC* HandleArtistForAlbumL( const TUint32 aId ) = 0;
         /**
         * HandleAlbumartForAlbumL.
         * @param aId, The album ID.
@@ -38,6 +36,24 @@
         * @returns alternative albumart retrieved in the specified Album.
         */
         virtual HBufC* HandleAlbumartForAlbumL( const TUint32 aId, TPtrC aArt ) = 0;
+               
+        /**
+        * Called when album artist is removed from an album
+        * @param aCategoryId category item ID
+        * @param aDrive drive the category item is on
+        * @param aItemChangedMessages changed mesages array to be updated or NULL
+        */
+        virtual void DeleteAlbumForArtistL(TUint32 aCategoryId,
+            TInt aDrive, CMPXMessageArray* aItemChangedMessages) = 0;
+
+        /**
+        * Called when album artist is added to an album
+        * @param aName name string
+        * @param aArt Album art path
+        * @param aDriveId drive to add the category to
+        * @return the ID of the category item (new or existing)
+        */
+        virtual TUint32 AddAlbumArtistL(const TDesC& aName, const TDesC& aArt, TInt aDriveId) = 0;
     };
 /**
 * Responsible for managing all music databases
@@ -74,11 +90,11 @@
         virtual ~CMPXDbAlbum();
 
     public:
-
         /**
-        * Add a category item. If the record already exists, its counter will
+        * Add an album item. If the record already exists, its counter will
         * be incremented.
-        * @param aName: This is the name to be entered into the row
+        * @param aCategory category type
+        * @param aMedia: The media object
         * @param aDriveId: The Drive Id the name (category) belongs
         * @param aNewRecord: indicates to the caller if a new record is created.
         *        ETrue if a new row is created in the table; otherwise EFalse.
@@ -86,7 +102,7 @@
         *        into consideration when generating the unique row id
         * @return The unique id of the row added.
         */
-        TUint32 AddItemL(const TDesC& aName, const TDesC& aArtistName, const TDesC& aArt, TInt aDriveId, TBool& aNewRecord,
+        virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord,
             TBool aCaseSensitive = ETrue);
 
         /**
@@ -102,11 +118,10 @@
         *                  category was deleted
         * @param aItemExist Out parameter, ETrue if the category is not deleted after the delete,
         *        EFalse otherwise
-        * @param aArtist: The ID of the artist
         * @param aArt: The albumart uri
         */
-        void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
-            CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TUint32 aArtist, const TDesC& aArt );
+        void DecrementSongsForAlbumL(TUint32 aId, TInt aDriveId,
+            CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TDesC& aArt );
 
         /**
         * Gets the details for all category items.
@@ -125,6 +140,18 @@
             CMPXMediaArray& aMediaArray);
 
         /**
+        * Gets details for the category items under a parent category item.
+        * This applies to albums for a given artist. The method panics if the
+        * category or parent category are invalid.
+        * @param aParentCategory identifies the parent category
+        * @param aParentId identifies the parent item
+        * @param aAttrs attributes to be returned
+        * @param aMediaArray returns the requested attributes for all items
+        */
+        virtual void GetSubCategoryItemsL(TMPXGeneralCategory aParentCategory, TUint32 aParentId,
+            const TArray<TMPXAttribute>& aAttrs, CMPXMediaArray& aMediaArray);
+        
+        /**
         * Update a category item.
         * @param aId: The ID of the category to update
         * @param aMedia: The media data
@@ -134,19 +161,29 @@
         */
         void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
 
-    public:
-        /**
-        * Get albums count for a specified artist
-        * @param aId: The ID of the artist
-        */
-        TInt GetAlbumsCountForArtistL(TUint32 aArtistId);
-
+    public:        
         /**
         * Get songs count for a specified album and a specified artist
         * @param aArtistId: The ID of the artist
         * @param aAlbumId: The ID of the album
         */
         TInt GetSongsCountInAlbumMatchingArtistL(TUint32 aArtistId, TUint32 aAlbumId);
+       /**
+        * Check if the specified album ID is an unknown album.
+        * An “Unknown album” is one where the album name and album artist are unknown.
+        * @param aId: The ID of the album
+        * @return ETrue if it's an unknown album
+        */
+        TBool IsUnknownAlbumL(const TUint32 aId);
+        
+        /**
+        * Generate Unique ID for Album
+        * @param aMedia media object
+        * @param aCaseSensitive indicates whether case sensitivity should be taken
+        *        into consideration when generating the unique row id
+        * @return the ID of album
+        */
+        TUint32 GenerateUniqueIdL(const CMPXMedia& aMedia);
 
     private:
         /**
@@ -167,16 +204,7 @@
         */
         void GenerateAlbumFieldsValuesL(const CMPXMedia& aMedia,
             CDesCArray& aFields, CDesCArray& aValues);
-
-
-        TBool IsUnknownArtistL(TUint32 aId);
-
-        /**
-        * Get the ArtistName of song which belongs to the specified Album.
-        * @param aId The ID of the album
-        * @returns alternative artistname retrieved in the specified Album.
-        */
-        HBufC* ArtistForAlbumL(const TUint32 aId);
+        
         /**
         * Get the Albumart of song which belongs to the specified Album.
         * @param aId The ID of the album
@@ -184,7 +212,51 @@
         * @returns alternative albumart retrieved in the specified Album.
         */
         HBufC* AlbumartForAlbumL(const TUint32 aId, TPtrC aArt);
+        
+        /**
+        * Processes a recordset by constructing media instances and adding them
+        * to the specified array.
+        * @param aAttrs attributes to be returned
+        * @param aRecordset recordset to be processed
+        * @param aMediaArray returns the media instances
+        */
+        void ProcessAlbumRecordSetL(const TArray<TMPXAttribute>& aAttrs,
+            RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray);
+        
+        /**
+        * Processes a recordset by constructing media instances and adding them
+        * to the specified array.
+        * @param aAttrs attributes to be returned
+        * @param aRecordset recordset to be processed
+        * @param aMediaArray returns the media instances
+        */
+        void ProcessMediaWallAlbumRecordSetL(const TArray<TMPXAttribute>& aAttrs,
+            RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray);
+        
+        /**
+        * Retrieve AlbumArtist name from media object
+        * @param aMedia media object
+        * @param aName returned name
+        * @return ETrue if name is available
+        */   
+        TBool RetrieveAlbumArtistL(const CMPXMedia& aMedia, TPtrC& aName);
 
+        /**
+        * Retrieve Artist name from media object
+        * @param aMedia media object
+        * @param aName returned name
+        */   
+        void RetrieveArtist(const CMPXMedia& aMedia, TPtrC& aName);
+
+        /**
+        * Check if Art needs to be updated
+        * @param aDeletedSongArt deleted song's art
+        * @param aCurrentAlbumArt Album's current art
+        * @return ETrue if aDeletedSongArt is not non-embedded album art and 
+        *         aDeleteSongArt and aCurrentAlbumArt are the same and known
+        */   
+        TBool NeedToUpdateArt(const TDesC& aDeletedSongArt, const TDesC& aCurrentAlbumArt);
+        
     private:    // from MMPXTable
 
         /**
@@ -219,16 +291,20 @@
         enum TAlbumColumns
             {
             EAlbumUniqueId = KMPXTableDefaultIndex,
-            EAlbumArtistName,
             EAlbumName,
             EAlbumSongCount,      
+            EAlbumArtist,
+            EAlbumArtistName,
             EAlbumArt,
             EAlbumFieldCount
             };
 
     private:    // Data
         MMPXDbAlbumObserver& iObserver;
+        RPointerArray<CMPXMedia> iUnknownArtists;
+        RPointerArray<CMPXMedia> iUnknownAlbums;
     };
+    
 #endif // MPXDBALBUM_H
 
 // End of File
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbartist.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbartist.h	Tue Aug 24 03:36:14 2010 -0500
@@ -24,11 +24,6 @@
 #include "mpxdbcategory.h"
 
 // CLASS DECLARATION
-class MMPXDbArtistObserver
-    {
-    public:
-		virtual TInt HandleGetAlbumsCountForArtistL(TUint32 aId) = 0;
-	};
 
 /**
 * Responsible for managing all music databases
@@ -47,7 +42,7 @@
         * @return New CMPXDbArtist instance.
         */
         static CMPXDbArtist* NewL(CMPXDbManager& aDbManager,
-            TMPXGeneralCategory aCategory, MMPXDbArtistObserver& aObserver);
+            TMPXGeneralCategory aCategory);
 
         /**
         * Two-phased constructor.
@@ -56,8 +51,8 @@
         * @return New CMPXDbArtist instance on the cleanup stack.
         */
         static CMPXDbArtist* NewLC(CMPXDbManager& aDbManager,
-            TMPXGeneralCategory aCategory, MMPXDbArtistObserver& aObserver);
-
+            TMPXGeneralCategory aCategory);
+        
         /**
         * Destructor
         */
@@ -65,17 +60,16 @@
 
     public:
         /**
-        * Add a category item. If the record already exists, its counter will
+        * Add a artist item. If the record already exists, its counter will
         * be incremented.
-        * @param aName: This is the name to be entered into the row
+        * @param aCategory category type
+        * @param aMedia: This is the media object
         * @param aDriveId: The Drive Id the name (category) belongs
         * @param aNewRecord: indicates to the caller if a new record is created.
         *        ETrue if a new row is created in the table; otherwise EFalse.
-        * @param aCaseSensitive indicates whether case sensitivity should be taken
-        *        into consideration when generating the unique row id
         * @return The unique id of the row added.
         */
-        TUint32 AddItemL(const TDesC& aName, const TDesC& aArt, TInt aDriveId, TBool& aNewRecord,
+        virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord,
             TBool aCaseSensitive = ETrue);
 
         /**
@@ -94,14 +88,54 @@
         * @param aItemChangedMessages: if valid on return contains a updated message if the
         *        category was updated
         */
-        void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
+        virtual void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
+        
+        /**
+        * Decrement the number of songs for the item. If the song and album count gets to 0, 
+        * remove the item.
+        * @param aId: The ID of the category to delete.
+        * @param aDriveId: The drive Id the name (category) belongs to. Songs on different
+        *                  drives may belong to the same album or artist; consequently, one
+        *                  row for each artist/album id and drive ID pair will exist in the
+        *                  lookup table with a count existing for each row that tracks the
+        *                  number number of songs on that drive with that album/artist.
+        * @param aItemChangedMessages if valid on return contains a deleted message if the
+        *                  category was deleted
+        * @param aItemExist Out parameter, ETrue if the category is not deleted after the delete,
+        *        EFalse otherwise
+        */
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+        virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
+            CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse); 
+#else
+        virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
+            CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
+#endif //ABSTRACTAUDIOALBUM_INCLUDED            
 
-        /*
-        * Checks if the specified artist item is unknown
-        * @param aId identifies the artist item
-        * @return ETrue if it is unknown, EFalse otherwise
+        /**
+        * Add a AlbumArtist. If the record already exists, its counter will
+        * be incremented.
+        * @param aName: This is the name to be entered into the row
+        * @param aArt: Album art
+        * @param aDriveId: The Drive Id the name (category) belongs
+        * @return The unique id of the row added.
         */
-        TBool IsUnknownArtistL(TUint32 aId);
+        TUint32 AddAlbumArtistL(const TDesC& aName, const TDesC& aArt, TInt aDriveId);
+        
+        /**
+        * Decrement the number of albums for the item. If the song and album count gets to 0, 
+        * remove the item.
+        * @param aId: The ID of the category to delete.
+        * @param aDriveId: The drive Id the name (category) belongs to. Songs on different
+        *                  drives may belong to the same album or artist; consequently, one
+        *                  row for each artist/album id and drive ID pair will exist in the
+        *                  lookup table with a count existing for each row that tracks the
+        *                  number number of songs on that drive with that album/artist.
+        * @param aItemChangedMessages if valid on return contains a deleted message if the
+        *                  category was deleted
+        */
+        void DecrementAlbumsForArtistL(TUint32 aId, TInt aDriveId,
+            CMPXMessageArray* aItemChangedMessages);       
 
     private:
 
@@ -123,14 +157,16 @@
         */
         void GenerateArtistFieldsValuesL(const CMPXMedia& aMedia,
             CDesCArray& aFields, CDesCArray& aValues);
-
+       
         /**
-        * Gets the Album counts for a Artist item
+        * Gets the Songs count and Albums count for a Artist item
+        * @param aDrivceId The Drive Id the name (category) belongs
         * @param aId identifies the Artist item
-        * @return value of the Album counts
+        * @param aSongsCount songs count
+        * @param aAlbumsCount albums count
         */
-        TInt GetAlbumsCountL(TUint32 aId);
-
+        void GetSongsAndAlbumsCountL(TInt aDriveId, TUint32 aId, TInt& aSongsCount, TInt& aAlbumsCount);
+        
     private:    // from MMPXTable
 
         /**
@@ -150,7 +186,7 @@
         * @param aDbManager database manager to use for database interactions
         * @param aCategory identifies the category
         */
-        CMPXDbArtist(CMPXDbManager& aDbManager, TMPXGeneralCategory aCategory, MMPXDbArtistObserver& aObserver);
+        CMPXDbArtist(CMPXDbManager& aDbManager, TMPXGeneralCategory aCategory);
 
         /**
         * Second phase constructor.
@@ -167,13 +203,12 @@
             EArtistUniqueId = KMPXTableDefaultIndex,
             EArtistName,
             EArtistSongCount,
+            EArtistAlbumCount,
             EArtistArt,
             EArtistFieldCount
             };
-
-    private:    // Data
-        MMPXDbArtistObserver& iObserver;
     };
+    
 #endif // MPXDBARTIST_H
 
 // End of File
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h	Tue Aug 24 03:36:14 2010 -0500
@@ -53,7 +53,8 @@
         /**
         * Add a category item. If the record already exists, its counter will
         * be incremented.
-        * @param aName: This is the name to be entered into the row
+        * @param aCategory category type
+        * @param aMedia: This is the media object to be entered into the row
         * @param aDriveId: The Drive Id the name (category) belongs
         * @param aNewRecord: indicates to the caller if a new record is created.
         *        ETrue if a new row is created in the table; otherwise EFalse.
@@ -61,13 +62,8 @@
         *        into consideration when generating the unique row id
         * @return The unique id of the row added.
         */
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED
-        virtual TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord,
+        virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord,
             TBool aCaseSensitive = ETrue);
-#else 
-        TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord,
-            TBool aCaseSensitive = ETrue);
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
 
         /**
         * Get the name field for a given ID.
@@ -109,7 +105,7 @@
         virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse);
 #else
-        void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
+        virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
         /**
@@ -157,7 +153,7 @@
         * @param aAttrs attributes to be returned
         * @param aMediaArray returns the requested attributes for all items
         */
-        void GetSubCategoryItemsL(TMPXGeneralCategory aParentCategory, TUint32 aParentId,
+        virtual void GetSubCategoryItemsL(TMPXGeneralCategory aParentCategory, TUint32 aParentId,
             const TArray<TMPXAttribute>& aAttrs, CMPXMediaArray& aMediaArray);
 
         /**
@@ -183,8 +179,8 @@
         * @param aDriveId: The Drive Id the name (category) belongs
         * @param aItemChangedMessages: if valid on return contains a updated message if the
         * category was updated
-        */
-        void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
+        */       
+        virtual void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
 
     protected:
 
@@ -222,6 +218,15 @@
         void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs,
             RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray);
 
+    private:
+        /**
+        * Retrieve name from media object based on category
+        * @param aCategory the category to retrieve name
+        * @param aMedia media object
+        * @return name
+        */
+        TPtrC ItemNameL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia);
+        
     private:    // from MMPXTable
 
         /**
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h	Tue Aug 24 03:36:14 2010 -0500
@@ -65,7 +65,6 @@
 class CMPXDbHandler :
     public CBase,
     public MMPXDbMusicObserver,
-    public MMPXDbArtistObserver,
     public MMPXDbAlbumObserver,
 	public MMPXDbPlaylistObserver
     {
@@ -1017,39 +1016,30 @@
 
     private:    // From MMPXDbMusicObserver
 
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED
         /**
         * @see MMPXDbMusicObserver
         */
-        virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory,
-            const TDesC& aName,
-            TInt aDriveId,
-            CMPXMessageArray* aItemChangedMessages, TBool& aItemExist,
-            const TDesC& aUri,
-            const TDesC& aAlbumArtist=KNullDesC);
-#else
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+       virtual TUint32 AddAbstractAlbumItemL(const TDesC& aName, 
+            TInt aDriveId, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist,
+            const TDesC& aUri, const TDesC& aAlbumArtist=KNullDesC);
+#endif // ABSTRACTAUDIOALBUM_INCLUDED
+
+       virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia,       
+            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
+       
+       virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId,
+            const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages);
+
+       virtual TUint32 GenerateUniqueIdForAlbumL(const CMPXMedia& aMedia);
+       
+       virtual TBool IsUnknownAlbumL(const TUint32 aId);
 
         /**
         * @see MMPXDbMusicObserver
         */
-        virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory,
-            const TDesC& aName, TInt aDriveId,
-            CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
-
-       virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
-           const TDesC& aArtistName, const TDesC& aArt,
-            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
-
-       virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId,
-            const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages);
-
-        /**
-        * @see MMPXDbMusicObserver
-        */
-        virtual void DeleteSongForCategoryL(TMPXGeneralCategory aCategory,
-            TUint32 aCategoryId, TInt aDriveId, CMPXMessageArray* aItemChangedMessages,
-            TBool& aItemExist);
+        virtual void DeleteSongForCategoryL(TMPXGeneralCategory aCategory, TUint32 aCategoryId,
+            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TDesC& aArt = KNullDesC);
 
         /**
         * @see MMPXDbMusicObserver
@@ -1066,37 +1056,32 @@
         */
         virtual HBufC* HandleGetAlbumNameFromIdL(TUint32 aId);
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
-    private:    // From MMPXDbArtistObserver
-    /**
-    * @see MMPXDbArtistObser
-    */
-        virtual TInt HandleGetAlbumsCountForArtistL(TUint32 aArtistId);
+        
+    private:    // From MMPXDbAlbumObserver   
+        /**
+        * Get the Albumart of song which belongs to the specified Album.     
+        * @param aId, The Album ID.
+        * @param aArt, the AlbumArt uri.
+	    * @returns alternative albumart retrieved in the specified Album.
+        */
+        virtual HBufC* HandleAlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt);
+       
+        /**
+        * @see MMPXDbAlbumObserver
+        */
+        virtual void DeleteAlbumForArtistL(TUint32 aCategoryId,
+            TInt aDrive, CMPXMessageArray* aItemChangedMessages);
 
-    private:    // From MMPXDbAlbumObserver
-    /**
-    * @see MMPXDbAlbumObserver
-    */
-    virtual TBool HandleIsUnknownArtistL(TUint32 aArtistId);
-    /**
-    * Get the Artistname of song which belongs to the specified Album.     
-    * @param aId, The Album ID.
-	* @returns alternative artistname retrieved in the specified Album.
-    */
-    virtual HBufC* HandleArtistForAlbumL(const TUint32 aAlbumId);
-        
-    /**
-    * Get the Albumart of song which belongs to the specified Album.     
-    * @param aId, The Album ID.
-    * @param aArt, the AlbumArt uri.
-	* @returns alternative albumart retrieved in the specified Album.
-    */
-    virtual HBufC* HandleAlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt);
+        /**
+        * @see MMPXDbAlbumObserver
+        */
+        virtual TUint32 AddAlbumArtistL(const TDesC& aName, const TDesC& aArt, TInt aDriveId);       
 
     private:	// From MMPXDbPlaylistObserver
-	/**
-	* @see MMPXDbPlaylistObserver
-	*/
-		virtual TInt HandlePlaylistDurationL(TUint32 aPlaylistId);
+        /**
+        * @see MMPXDbPlaylistObserver
+        */
+        virtual TInt HandlePlaylistDurationL(TUint32 aPlaylistId);
         virtual void HandlePlaylistInfoL(TUint32 aPlaylistId, TInt& aCount, TInt& aDuration);
 
     private:
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h	Tue Aug 24 03:36:14 2010 -0500
@@ -51,37 +51,33 @@
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
         /**
         * Called when a new category item has to be added to a category table.
-        * @param aCategory category type
-        * @param aName name string
+        * @param aName Abstract Album art name
         * @param aDrive drive to add the category to
         * @param aItemChangedMessages changed mesages array to be updated or NULL
         * @param aItemExist Out parameter, ETrue if the item already exist before the add,
         *        EFalse otherwise
+        * @param aUri Abstract Album art Uri
         * @param aAlbumArtist AlbumArtist string
-        * @param aGenre Genre string
         * @return the ID of the category item (new or existing)
         */
-        virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
-            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TDesC& aAlbumArtist=KNullDesC,
-            const TDesC& aGenre=KNullDesC) = 0;
-#else
+        virtual TUint32 AddAbstractAlbumItemL(const TDesC& aName, 
+            TInt aDriveId, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist,
+            const TDesC& aUri, const TDesC& aAlbumArtist=KNullDesC) = 0;
+#endif // ABSTRACTAUDIOALBUM_INCLUDED
+
         /**
         * Called when a new category item has to be added to a category table.
         * @param aCategory category type
-        * @param aName name string
+        * @param aMedia media object
         * @param aDrive drive to add the category to
         * @param aItemChangedMessages changed mesages array to be updated or NULL
         * @param aItemExist Out parameter, ETrue if the item already exist before the add,
         *        EFalse otherwise
         * @return the ID of the category item (new or existing)
         */
-        virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
+        virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia,       
             TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
-       // for Album and Artist table
-        virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
-            const TDesC& aArtistName, const TDesC& aArt,
-            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
+
         /**
         * Called when the ID of a category item changed for a Music record, for example when
         * the artist name changed for a song. The implementation is supposed to update the
@@ -92,9 +88,13 @@
         * @param aItemChangedMessages changed mesages array to be updated or NULL
         * @param aItemExist Out parameter, ETrue if the category is not deleted after the delete,
         *        EFalse otherwise
+        * @param aArt Art of the music record. 
+        *             Art needs to be given so that the cateogry can switch over to different art 
+        *             if necessary
+        * 
         */
         virtual void DeleteSongForCategoryL(TMPXGeneralCategory aCategory, TUint32 aCategoryId,
-            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
+            TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TDesC& aArt = KNullDesC) = 0;
 
         /**
         * Called when the play count attribute of a song is changed. Should add an item changed
@@ -121,6 +121,7 @@
          */
         virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId,
              const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages) = 0;
+
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
         /**
         * Get title from the Id
@@ -128,8 +129,24 @@
         * @return name matching the ID
         */
         virtual HBufC* HandleGetAlbumNameFromIdL( TUint32 aId ) = 0;
-#endif // ABSTRACTAUDIOALBUM_INCLUDED    
-	};
+#endif // ABSTRACTAUDIOALBUM_INCLUDED
+        
+        /**
+        * Generate Unique ID for Album
+        * @param aMedia media object
+        * @param aCaseSensitive indicates whether case sensitivity should be taken
+        *        into consideration when generating the unique row id
+        * @return the ID of album
+        */
+        virtual TUint32 GenerateUniqueIdForAlbumL(const CMPXMedia& aMedia) = 0;
+
+        /**
+        * Check if the specified album ID is Unknown album
+        * @param aId: The ID of the album
+        * @return ETrue if it's Unknown album
+        */
+        virtual TBool IsUnknownAlbumL(const TUint32 aId) = 0;
+    };
 
 /**
 * Responsible for managing the Music table
@@ -501,11 +518,13 @@
         * @param aAttrs the attributes to include for the artist(s) matching the
         *        selection criteria
         * @param aMediaArray returns the songs
-        */
+        * @param aSortByTrackOrder if TRUE sorts tracks according to their track numbers, 
+		*        if FALSE using track titles or filename
+        */       
         void FindSongsL(TUint32 aGeneralId, TUint32 aContainerId, TMPXGeneralType aType,
             const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs,
-            CMPXMediaArray& aMediaArray);
-
+            CMPXMediaArray& aMediaArray, TBool aSortByTrackOrder = EFalse);
+        
         /**
         * Returns the track count for a given drive
         * @param aDrive drive
@@ -523,12 +542,6 @@
         */
         void GetMusicUriArrayL(TInt aDrive, TInt aFromID, TInt aRecords,
                                CDesCArray& aUriArr, TInt& aLastID);
-
-        /**
-         * Get the ID of Artist which belongs to the specified Album
-         * @param aId, the ID of Album
-         */
-        TUint32 ArtistForAlbumL(const TUint32 aId);
             
         /**
         * Get the Albumart of song which belongs to the specified Album
@@ -672,13 +685,12 @@
         HBufC* ConstructUriL(RSqlStatement& aMusicTable, TUint32 aMediaId);
 
         /**
-        * Checks if the specified category field (artist/album/genre/composer)
+        * Checks if the specified category field (artist/genre/composer/abstractalbum)
         * will change and notifies the observer if so.
         * @param aCategory identifies the category
         * @param aMedia contains the new record attributes
         * @param aAttribute corresponding attribute in the media parameter
-        * @param aColumnIndex column index in the recordset
-        * @param aMusicTable current record in the music table or NULL if this is an insert
+        * @param aOldId the current category item ID
         * @param aDriveId drive ID the update is for
         * @param aItemChangedMessages item changed messages to append to
         * @param aItemId returns the category item ID
@@ -686,9 +698,25 @@
         */
         TBool UpdateCategoryFieldL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia,
             const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId,
-            CMPXMessageArray* aItemChangedMessages, TUint32& aItemId);
+            CMPXMessageArray* aItemChangedMessages, TUint32& aItemId, const TDesC& aArt = KNullDesC);
 
         /**
+        * Checks if album will change and notifies the observer if so.
+        * @param aMedia contains the new record attributes
+        * @param aAttribute corresponding attribute in the media parameter
+        * @param aOldId the current category item ID
+        * @param aDriveId drive ID the update is for
+        * @param aItemChangedMessages item changed messages to append to
+        * @param aItemId returns the album item ID
+		* @param aArt old art of the music record
+		* @param aCaseSensitive indicates whether case sensitivity should be taken
+        * @return ETrue if the field was modified
+        */
+        TBool UpdateCategoryFieldForAlbumL(const CMPXMedia& aMedia, 
+		    const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId, 
+			CMPXMessageArray* aItemChangedMessages, TUint32& aItemId, const TDesC& aArt = KNullDesC);       
+        
+        /**
         * Checks if extra attributes are required. The "standard attribute set includes:
         * EMPXMediaGeneralId, EMPXMediaGeneralType, EMPXMediaGeneralCategory,
         * EMPXMediaGeneralTitle, EMPXMediaGeneralUri, and EMPXMediaGeneralFlags
--- a/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbpluginqueries.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbpluginqueries.h	Tue Aug 24 03:36:14 2010 -0500
@@ -147,8 +147,10 @@
 
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
 _LIT(KQueryMusicGetAllSongsMinimum, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,0,Music.Art,Music.Deleted,Music.Location,0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,'',0,0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY MUSIC.Title");
+_LIT(KQueryMusicGetAllSongsMinimumLimited, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,0,Music.Art,Music.Deleted,Music.Location,0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,'',0,0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY MUSIC.Title LIMIT %u");
 #else
 _LIT(KQueryMusicGetAllSongsMinimum, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,0,Music.Art,Music.Deleted,Music.Location,0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY MUSIC.Title");
+_LIT(KQueryMusicGetAllSongsMinimumLimited, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,0,Music.Art,Music.Deleted,Music.Location,0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY MUSIC.Title LIMIT %u");
 #endif
 
 _LIT(KQueryMusicGetAllSongs, "SELECT Music.*,Artist.Name,Album.Name,Genre.Name,Composer.Name FROM :dbname.Music,:dbname.Artist,:dbname.Album,:dbname.Genre,:dbname.Composer WHERE Music.Deleted=0 AND Music.Album=Album.UniqueId AND Music.Artist=Artist.UniqueId AND Music.Genre=Genre.UniqueId AND Music.Composer=Composer.UniqueId ORDER BY 4");
@@ -207,11 +209,11 @@
 _LIT(KQueryMusicGetMusicUrisFrom, "SELECT UniqueId,Location FROM :dbname.Music WHERE Deleted=0 AND UniqueId > %u ORDER BY UniqueId ASC LIMIT %u");
 
 _LIT(KQueryMusicCount, "SELECT count(*) FROM :dbname.Music WHERE Deleted=0");
-_LIT(KQueryMusicAlbum, "SELECT DISTINCT Album FROM :dbname.Music WHERE Deleted=0 AND Artist=%u ORDER BY Album");
+_LIT(KQueryMusicAlbum, "SELECT DISTINCT Album FROM :dbname.Music WHERE Deleted=0 AND Artist=%u ORDER BY Album");  // deprecated, not maintained
 _LIT(KQueryMusicVolume, "SELECT VolumeId FROM :dbname.Music WHERE Deleted=0 AND UniqueId=%u");
 _LIT(KQueryMusicVolumeAll, "SELECT VolumeId FROM :dbname.Music WHERE UniqueId=%u");
 _LIT(KQueryMusicInfo, "SELECT * FROM :dbname.Music WHERE Deleted=0 AND UniqueId=%u");
-_LIT(KQueryOtherSongsInArtistAlbum, "SELECT count(*) FROM :dbname.Music WHERE Deleted=0 AND UniqueId<>%u AND Artist=%u AND Album=%u");
+_LIT(KQueryOtherSongsInArtistAlbum, "SELECT count(*) FROM :dbname.Music WHERE Deleted=0 AND UniqueId<>%u AND Artist=%u AND Album=%u");  // deprecated, not maintained
 
 _LIT(KQueryMusicDurationAll, "SELECT sum(Duration) FROM :dbname.Music WHERE Deleted=0");
 _LIT(KQueryMusicDurationArtist, "SELECT sum(Duration) FROM :dbname.Music WHERE Deleted=0 AND Artist=%u");
@@ -228,7 +230,7 @@
 _LIT(KQueryMusicGetDurationRecentlyAdded, "SELECT Duration FROM :dbname.Music WHERE Deleted=0 AND (julianday(TimeAdded) > julianday('now','-7 days'))");
 
 // Select songs information from music, playlistsongs and playlistsonginfo via playlistid order by playlistsongs's ordinal
-_LIT(KQueryMusicGetAllSongsbyPl,"select mu.UniqueId,mu.DbFlag,mu.VolumeId,mu.Title,mu.Artist,mu.Art,0,mu.Location,pl.UniqueId as PlUId, pl.ordinal from :dbname.music as mu,:pldbname.playlistsongs as pl where mu.Deleted=0 AND mu.uniqueid = pl.songid and pl.playlistid =%u ORDER BY 10");
+_LIT(KQueryMusicGetAllSongsbyPl,"select mu.UniqueId,mu.DbFlag,mu.VolumeId,mu.Title,mu.Artist,mu.Art,0,mu.Location,pl.UniqueId as PlUId, pl.ordinal from :dbname.music as mu,:pldbname.playlistsongs as pl where mu.Deleted=0 AND mu.uniqueid = pl.songid and pl.playlistid =%u ORDER BY 10");  // deprecated, not maintained
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
 _LIT(KQueryMusicGetAllSongsInfobyPl,"SELECT Music.*,Artist.Name,Album.Name,Genre.Name,Composer.Name,pl.UniqueId as PlUId,pl.ordinal FROM :dbname.Music,:dbname.Artist,:dbname.Album,:dbname.Genre,:dbname.Composer,:pldbname.playlistsongs as pl WHERE Music.Deleted=0 AND Music.Album=Album.UniqueId AND Music.Artist=Artist.UniqueId AND Music.Genre=Genre.UniqueId AND Music.Composer=Composer.UniqueId AND Music.UniqueId=pl .songid and pl .PlaylistId=%u ORDER BY 40");
 #else
@@ -236,6 +238,7 @@
 #endif
 _LIT(KQuerySongsInArtistAlbum, "SELECT count(*) FROM :dbname.Music WHERE Deleted=0 AND Artist=%u AND Album=%u");
 _LIT(KQueryMusicGetArtistForAlbum, "SELECT Artist FROM :dbname.Music,:dbname.Artist WHERE Music.Deleted=0 AND Music.Artist=Artist.UniqueId AND Music.Album=%u");
+_LIT(KQueryMusicGetAlbumsforArtist, "SELECT Album.* FROM :dbname.Album,:dbname.Music WHERE Music.Deleted=0 AND Music.Artist=%u AND Album.UniqueId=Music.Album ORDER BY Name, UniqueId");
 _LIT(KQueryMusicGetAlbumartForAlbum, "SELECT Art FROM :dbname.Music WHERE Music.Deleted=0 AND Music.Album=%u");
 // == Category table queries ==================================================
 //
@@ -259,7 +262,6 @@
 _LIT(KQueryCategoryAll, "SELECT * FROM :dbname.##table## ORDER BY Name");
 _LIT(KQueryCategoryItems, "SELECT * FROM :dbname.##table## WHERE %S ORDER BY Name ASC");
 _LIT(KQueryCategorySongCount, "SELECT SongCount FROM :dbname.##table## WHERE UniqueId=%u");
-_LIT(KQueryCategorySubcategoryItems, "SELECT Album.* FROM :dbname.Album,:dbname.Music WHERE Music.Deleted=0 AND Music.Artist=%u AND Album.UniqueId=Music.Album ORDER BY Name");
 
 _LIT(KQueryCategoryIncrementSongCount, "UPDATE :dbname.##table## SET SongCount=SongCount+1 WHERE UniqueId=%u");
 _LIT(KQueryCategoryDecrementSongCount, "UPDATE :dbname.##table## SET SongCount=SongCount-1 WHERE UniqueId=%u");
@@ -277,9 +279,9 @@
 _LIT(KAuxiliaryDropTable,"DROP TABLE Auxiliary");
 _LIT(KAuxiliaryCheckTable, "SELECT Id,Version,TimeRefreshed,TimeSynced,Corrupt,SaveDeletedRecordCount FROM AUXILIARY");
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
-_LIT(KQueryAuxiliaryInsert, "INSERT INTO Auxiliary(Id,Version,Corrupt) VALUES(0,'6.7.0',%u)");
+_LIT(KQueryAuxiliaryInsert, "INSERT INTO Auxiliary(Id,Version,Corrupt) VALUES(0,'6.8.0',%u)");
 #else
-_LIT(KQueryAuxiliaryInsert, "INSERT INTO Auxiliary(Id,Version,Corrupt) VALUES(0,'6.7.1',%u)");
+_LIT(KQueryAuxiliaryInsert, "INSERT INTO Auxiliary(Id,Version,Corrupt) VALUES(0,'6.8.1',%u)");
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
 _LIT(KQueryAuxiliarySetTime, "UPDATE :dbname.Auxiliary SET TimeRefreshed='%S', Corrupt=0");
 _LIT(KQueryAuxiliaryGetTime, "SELECT TimeRefreshed FROM :dbname.Auxiliary");
@@ -434,19 +436,19 @@
 //
 _LIT(KAlbumCreateTable,"CREATE TABLE Album("
     L"UniqueId INTEGER PRIMARY KEY,"
-    L"ArtistName TEXT COLLATE NOCASE,"
     L"Name TEXT COLLATE NOCASE,"
     L"SongCount INTEGER,"
-	L"Art TEXT)");
+    L"Artist INTEGER,"
+    L"ArtistName TEXT COLLATE NOCASE,"
+    L"Art TEXT)");
 
-_LIT(KAlbumCheckTable,"SELECT UniqueId,ArtistName,Name,SongCount,Art FROM Album");
+_LIT(KAlbumCheckTable,"SELECT UniqueId,Name,SongCount,Artist,ArtistName,Art FROM Album");
 
-_LIT(KQueryAlbumInsert, "INSERT INTO :dbname.Album(UniqueId,ArtistName,Name,SongCount,Art) VALUES(%u,'%S','%S',%u,'%S')");
+_LIT(KQueryAlbumInsert, "INSERT INTO :dbname.Album(UniqueId,Name,SongCount,Artist,ArtistName,Art) VALUES(%u,'%S',%u,%u,'%S','%S')");
 _LIT(KQueryAlbumUpdate, "UPDATE :dbname.Album SET %S WHERE UniqueId=%u");
 
-_LIT(KQueryAlbumItem, "SELECT Album.*,Artist.Name FROM :dbname.Album,:dbname.Artist WHERE Album.Artist=Artist.UniqueId AND UniqueId=%u");
-_LIT(KQueryAlbumAll, "SELECT Album.* FROM :dbname.Album ORDER BY Name");
-_LIT(KQueryAlbumAllMediaWall, "SELECT Album.* FROM :dbname.Album ORDER BY ArtistName");
+_LIT(KQueryAlbumAll, "SELECT Album.* FROM :dbname.Album ORDER BY Name, ArtistName");
+_LIT(KQueryAlbumAllMediaWall, "SELECT Album.* FROM :dbname.Album ORDER BY ArtistName, Name");
 _LIT(KCriterionArtistName, "ArtistName='%S'");
 _LIT(KCriterionArt, "Art='%S'");
 
@@ -456,16 +458,22 @@
     L"UniqueId INTEGER PRIMARY KEY,"
     L"Name TEXT COLLATE NOCASE,"
     L"SongCount INTEGER,"
+    L"AlbumCount INTEGER,"
     L"Art TEXT)");
 
-_LIT(KArtistCheckTable,"SELECT UniqueId,Name,SongCount,Art FROM Artist");
+_LIT(KArtistCheckTable,"SELECT UniqueId,Name,SongCount,AlbumCount,Art FROM Artist");
 
-_LIT(KQueryArtistInsert, "INSERT INTO :dbname.Artist(UniqueId,Name,SongCount,Art) VALUES(%u,'%S',%u,'%S')");
+_LIT(KQueryArtistInsert, "INSERT INTO :dbname.Artist(UniqueId,Name,SongCount,AlbumCount,Art) VALUES(%u,'%S',%u,%u,'%S')");
 _LIT(KQueryArtistUpdate, "UPDATE :dbname.Artist SET %S WHERE UniqueId=%u");
 
-_LIT(KQueryArtistAll, "SELECT Artist.* FROM :dbname.Artist ORDER BY 2");
+_LIT(KQueryArtistAll, "SELECT Artist.* FROM :dbname.Artist WHERE SongCount > 0 ORDER BY 2");
 _LIT(KQueryArtistName, "SELECT Artist.Name FROM :dbname.Artist WHERE UniqueId=%u");
 
+_LIT(KQueryArtistIncrementAlbumCount, "UPDATE :dbname.Artist SET AlbumCount=AlbumCount+1 WHERE UniqueId=%u");
+_LIT(KQueryArtistDecrementAlbumCount, "UPDATE :dbname.Artist SET AlbumCount=AlbumCount-1 WHERE UniqueId=%u");
+_LIT(KQueryArtistGetSongCountAndAlbumCount, "SELECT SongCount,AlbumCount FROM :dbname.Artist WHERE UniqueId=%u");
+_LIT(KQueryArtistItems, "SELECT * FROM :dbname.Artist WHERE %S AND SongCount > 0 ORDER BY Name ASC");
+
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
 // == AbstractAlbum table queries ==========================================
 //
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -37,6 +37,11 @@
 _LIT( KAbstractAlbumExt, ".alb" );
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
 
+_LIT( KAlbumAlbumArtistSeperator, "\t1");
+_LIT( KAlbumArtistSeperator, "\t2");
+
+const TInt KUnknownAlbumsGranularity = 250;
+
 // ============================ MEMBER FUNCTIONS ==============================
 
 // ----------------------------------------------------------------------------
@@ -79,6 +84,9 @@
 CMPXDbAlbum::~CMPXDbAlbum()
     {
     MPX_FUNC("CMPXDbAlbum::~CMPXDbAlbum");
+    
+    iUnknownArtists.ResetAndDestroy();
+    iUnknownAlbums.ResetAndDestroy();
     }
 
 // ----------------------------------------------------------------------------
@@ -90,7 +98,9 @@
     TMPXGeneralCategory aCategory,
     MMPXDbAlbumObserver& aObserver) :
     CMPXDbCategory(aDbManager, aCategory),
-    iObserver(aObserver)
+    iObserver(aObserver),
+    iUnknownArtists(KUnknownAlbumsGranularity),
+    iUnknownAlbums(KUnknownAlbumsGranularity)
     {
     MPX_FUNC("CMPXDbAlbum::CMPXDbAlbum");
     }
@@ -111,77 +121,81 @@
 // ----------------------------------------------------------------------------
 //
 TUint32 CMPXDbAlbum::AddItemL(
-    const TDesC& aName,
-    const TDesC& aArtistName,
-    const TDesC& aArt,
+    TMPXGeneralCategory /*aCategory*/,        
+    const CMPXMedia& aMedia,
     TInt aDriveId,
     TBool& aNewRecord,
     TBool aCaseSensitive)
     {
     MPX_FUNC("CMPXDbAlbum::AddItemL");
 
+    TPtrC album(KNullDesC);
+    TPtrC albumArtist(KNullDesC);
+    TPtrC artist(KNullDesC);
+    TPtrC albumArt(KNullDesC);
+    
     // try to find the item first
-    TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), iCategory,
-        aName, aCaseSensitive));
-    aNewRecord = !CategoryItemExistsL(aDriveId, rowId);
-
-    if (aNewRecord)
-        {
-        // insert new
-        HBufC* query = PreProcessStringLC(KQueryAlbumInsert);
-        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(aName);
-        HBufC* artistname = MPXDbCommonUtil::ProcessSingleQuotesLC(aArtistName);
-		HBufC* art = MPXDbCommonUtil::ProcessSingleQuotesLC(aArt);
-
-        iDbManager.ExecuteQueryL(aDriveId, *query, rowId, artistname, name, 1, art); 
-
-		CleanupStack::PopAndDestroy(art);
-        CleanupStack::PopAndDestroy(artistname);
-        CleanupStack::PopAndDestroy(name);
-        CleanupStack::PopAndDestroy(query);
-        }
-    else
+    TUint32 rowId(GenerateUniqueIdL(aMedia));
+    
+    // retrieve the existing record
+    HBufC* query = PreProcessStringLC(KQueryCategoryItem);
+    RSqlStatement recordset(
+        iDbManager.ExecuteSelectQueryL(aDriveId, *query, rowId));
+    CleanupStack::PopAndDestroy(query);
+    CleanupClosePushL(recordset);
+    
+    TInt result = recordset.Next();   
+    if (result == KSqlAtEnd)
         {
-        // retrieve the existing record
-        HBufC* query = NULL;
-        query = PreProcessStringLC(KQueryCategoryItem);
-        RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, rowId));
-        CleanupStack::PopAndDestroy(query);
-
-        CleanupClosePushL(recordset);
-
-        if (recordset.Next() != KSqlAtRow)
+        aNewRecord = result;
+        
+        // check Album attribute
+        if (aMedia.IsSupported(KMPXMediaMusicAlbum))     
             {
-            User::Leave(KErrNotFound);
-	    }
-
-        // Artist
-        TPtrC artistname(KNullDesC);
-        artistname.Set(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArtistName));
-
-        // the current one is Unknown and the new one is Not Unknown.
-         if ( artistname == KNullDesC  && aArtistName!= KNullDesC )
+            album.Set(aMedia.ValueText(KMPXMediaMusicAlbum).Left(KMCMaxTextLen));
+            }
+        
+        // check AlbumArt attirbute
+        if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName))
             {
-            HBufC* artistnameReplaceSingleQuote = 
-                            MPXDbCommonUtil::ProcessSingleQuotesLC( aArtistName );
-            TPtrC criteria(KCriterionArtistName);
-            HBufC* setStr = HBufC::NewLC(criteria.Length() + artistnameReplaceSingleQuote->Length()); 
-            setStr->Des().Format( KCriterionArtistName, artistnameReplaceSingleQuote );
-           
-            iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, rowId);
-            CleanupStack::PopAndDestroy(setStr);
-            CleanupStack::PopAndDestroy(artistnameReplaceSingleQuote);
+            albumArt.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen));
             }
 
-        // Album Art
+        // insert new
+        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(album);
+        TUint32 artistId(0);
+        HBufC* artistName = NULL;        
+        if (RetrieveAlbumArtistL(aMedia, albumArtist))
+            {
+            artistId = iObserver.AddAlbumArtistL(albumArtist, albumArt, aDriveId);
+            artistName = MPXDbCommonUtil::ProcessSingleQuotesLC(albumArtist);
+            }
+        else
+            {
+            RetrieveArtist(aMedia, artist);
+            artistId = iObserver.AddAlbumArtistL(artist, albumArt, aDriveId);
+            artistName = MPXDbCommonUtil::ProcessSingleQuotesLC(artist);
+            }
+        
+        HBufC* art = MPXDbCommonUtil::ProcessSingleQuotesLC(albumArt);
+                
+        iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumInsert, rowId, name, 1, artistId, artistName,art); 
+
+        CleanupStack::PopAndDestroy(art);
+        CleanupStack::PopAndDestroy(artistName);
+        CleanupStack::PopAndDestroy(name);
+        }
+    else if (result == KSqlAtRow)
+        {       
+        // retrieve Art from Album table
         TPtrC art(KNullDesC);
         art.Set(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArt));
 
         // the current one is Unknown and the new one is Not Unknown
-        if ( art == KNullDesC && aArt != KNullDesC )
+        if ( art == KNullDesC && albumArt != KNullDesC )
             {
             HBufC* artReplaceSingleQuote = 
-                            MPXDbCommonUtil::ProcessSingleQuotesLC( aArt );
+                MPXDbCommonUtil::ProcessSingleQuotesLC( albumArt );
 
             TPtrC criteria(KCriterionArt);
             HBufC* setStr = HBufC::NewLC(criteria.Length() + artReplaceSingleQuote->Length()); 
@@ -192,35 +206,57 @@
             CleanupStack::PopAndDestroy(artReplaceSingleQuote);
             }
 
-        CleanupStack::PopAndDestroy(&recordset);
-
         // increment the number of songs for the category
         query = PreProcessStringLC(KQueryCategoryIncrementSongCount);
         iDbManager.ExecuteQueryL(aDriveId, *query, rowId);
         CleanupStack::PopAndDestroy(query);
+        } // existing record
+    else
+        {
+        MPX_DEBUG2("SQL error %d", result);
+        User::Leave(result);
         }
 
+    CleanupStack::PopAndDestroy(&recordset);
+    
     return rowId;
     }
 
 // ----------------------------------------------------------------------------
-// CMPXDbAlbum::DecrementSongsForCategoryL
+// CMPXDbAlbum::DecrementSongsForAlbumL
 // ----------------------------------------------------------------------------
 //
-void CMPXDbAlbum::DecrementSongsForCategoryL(
+void CMPXDbAlbum::DecrementSongsForAlbumL(
     const TUint32 aId,
     TInt aDriveId,
     CMPXMessageArray* aItemChangedMessages,
     TBool& aItemExist,
-    const TUint32 aArtist,
-    const TDesC& aArt)
+    const TDesC& aArt)       
     {
-    MPX_FUNC("CMPXDbAlbum::DecrementSongsForCategoryL");
+    MPX_FUNC("CMPXDbAlbum::DecrementSongsForAlbumL");
+
+    // retrieve the existing record
+    HBufC* query = PreProcessStringLC(KQueryCategoryItem);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, aId));
+    CleanupStack::PopAndDestroy(query);
+
+    CleanupClosePushL(recordset);
+
+    if (recordset.Next() != KSqlAtRow)
+        {
+        User::Leave(KErrNotFound);
+        }
 
     // if just one song uses this category. Use <= just in case
-    if (GetSongsCountL(aDriveId, aId) <= 1)
+    if (recordset.ColumnInt64(EAlbumSongCount) <= 1)
         {
         aItemExist = EFalse;
+
+        // Decrement albums count on artist       
+        TUint32 albumArtistId = recordset.ColumnInt64(EAlbumArtist);
+        iObserver.DeleteAlbumForArtistL(albumArtistId, aDriveId, aItemChangedMessages);
+        CleanupStack::PopAndDestroy(&recordset);
+                
         // delete the category
         DeleteCategoryL(aId, aDriveId);
 
@@ -235,63 +271,10 @@
         {
         aItemExist = ETrue;
 
-        // retrieve the existing record
-        HBufC* query = PreProcessStringLC(KQueryCategoryItem);
-        RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, aId));
-        CleanupStack::PopAndDestroy(query);
-
-        CleanupClosePushL(recordset);
-
-        if (recordset.Next() != KSqlAtRow)
-            {
-            User::Leave(KErrNotFound);
-        }
-
         TBool itemModified = EFalse;
-        TPtrC artistname(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArtistName));
-        TUint32 artistId = MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), EMPXArtist,
-	            artistname, ETrue);
-
-        // the current artist is equal to deleted song's artist
-        if ( artistId == aArtist )
-            {
-            HBufC* newArtistname = ArtistForAlbumL(aId);
-            
-            CleanupStack::PushL(newArtistname);
-            if (newArtistname && newArtistname->CompareF(artistname)!=0)
-                { 
-                HBufC* artistnameReplaceSingleQuote = MPXDbCommonUtil::ProcessSingleQuotesLC( *newArtistname );
-                TPtrC criteria(KCriterionArtistName);
-                HBufC* setStr = HBufC::NewLC(criteria.Length() + artistnameReplaceSingleQuote->Length()); 
-                setStr->Des().Format( KCriterionArtistName, artistnameReplaceSingleQuote );                    	
-
-                iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
-                CleanupStack::PopAndDestroy(setStr);
-                CleanupStack::PopAndDestroy(artistnameReplaceSingleQuote);
-                itemModified = ETrue;
-                }
-            CleanupStack::PopAndDestroy(newArtistname);             
-            }         
-        
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED      
-    TBool nonEmbeddedArt = EFalse;
-    if (aArt.Length()>0)
-        {
-        TParsePtrC parse(aArt);
-        TPtrC ext(parse.Ext());
-        //set flag to false, so .alb will not overwrite art field in album, artist table 
-        // when song with embedded art
-        if (ext.CompareF(KAbstractAlbumExt)== 0) 
-            {     
-            nonEmbeddedArt = ETrue;        
-            }
-        }
-  if (!nonEmbeddedArt)       
-       {
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
-       TPtrC art(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArt));
-        // the current art is equal to deleted song's art      
-        if(aArt.Length()>0 && art.Length()>0 && aArt.CompareF(art) ==0 )
+        		
+        TPtrC art(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArt));        
+        if (NeedToUpdateArt(aArt, art))
             {
             MPX_DEBUG2("AlbumArt of the Song to be deleted is [%S]", &aArt);
             
@@ -302,7 +285,7 @@
             //update Album table only if alternative albumart found
             if (newArt)
                 {
-                MPX_DEBUG1("CMPXDbAlbum::DecrementSongsForCategoryL, get newArt");
+                MPX_DEBUG1("CMPXDbAlbum::DecrementSongsForAlbumL, get newArt");
                 HBufC* artReplaceSingleQuote = MPXDbCommonUtil::ProcessSingleQuotesLC( *newArt );
                 TPtrC criteria(KCriterionArt);   
                 HBufC* setStr = HBufC::NewLC(criteria.Length() + artReplaceSingleQuote->Length()); 
@@ -313,17 +296,15 @@
                 CleanupStack::PopAndDestroy(artReplaceSingleQuote);
                 itemModified = ETrue;                     
                 }
-           CleanupStack::PopAndDestroy(newArt);             
-           }
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED            
-         }
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
+            CleanupStack::PopAndDestroy(newArt);             
+            }
+
         if (aItemChangedMessages && itemModified)
-           {
-           // add the item changed message
-           MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
-                      EMPXAlbum, KDBPluginUid, ETrue, 0 );
-           }
+            {
+            // add the item changed message
+            MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+                EMPXAlbum, KDBPluginUid, ETrue, 0 );
+            }
         CleanupStack::PopAndDestroy(&recordset);
         
         // decrement the number of songs for the category
@@ -343,12 +324,17 @@
     {
     MPX_FUNC("CMPXDbAlbum::GetAllCategoryItemsL");
 
-    HBufC* query = PreProcessStringLC(KQueryAlbumAll);
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query));
-    CleanupStack::PopAndDestroy(query);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryAlbumAll));
 
     CleanupClosePushL(recordset);
-    ProcessRecordsetL(aAttrs, recordset, aMediaArray);
+    TRAPD(err, ProcessAlbumRecordSetL(aAttrs, recordset, aMediaArray));
+    if (err != KErrNone)
+        {
+        iUnknownArtists.ResetAndDestroy();
+        iUnknownAlbums.ResetAndDestroy();
+
+        User::LeaveIfError(err);
+        }
     CleanupStack::PopAndDestroy(&recordset);
     }
 
@@ -362,14 +348,44 @@
     {
     MPX_FUNC("CMPXDbAlbum::GetAllCategoryItemsL");
 
-    HBufC* query = PreProcessStringLC(KQueryAlbumAllMediaWall);
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query));
-    CleanupStack::PopAndDestroy(query);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryAlbumAllMediaWall));
 
     CleanupClosePushL(recordset);
-    ProcessRecordsetL(aAttrs, recordset, aMediaArray);
+    TRAPD(err, ProcessMediaWallAlbumRecordSetL(aAttrs, recordset, aMediaArray));
+    if (err != KErrNone)
+        {
+        iUnknownArtists.ResetAndDestroy();
+        iUnknownAlbums.ResetAndDestroy();
+
+        User::LeaveIfError(err);
+        }
     CleanupStack::PopAndDestroy(&recordset);
     }
+
+// ----------------------------------------------------------------------------
+// CMPXDbCategory::GetSubCategoryItemsL
+// ----------------------------------------------------------------------------
+//
+void CMPXDbAlbum::GetSubCategoryItemsL(
+    TMPXGeneralCategory aParentCategory,
+    TUint32 aParentId,
+    const TArray<TMPXAttribute>& aAttrs,
+    CMPXMediaArray& aMediaArray)
+    {
+    MPX_FUNC("CMPXDbCategory::GetSubCategoryItemsL");
+
+    // this is only valid for albums belonging to an artist
+    ASSERT((iCategory == EMPXAlbum) && (aParentCategory == EMPXArtist));
+
+    // to handle the UREL warning
+    (void)aParentCategory;
+
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetAlbumsforArtist, aParentId));
+    CleanupClosePushL(recordset);
+    ProcessAlbumRecordSetL(aAttrs, recordset, aMediaArray);
+    CleanupStack::PopAndDestroy(&recordset);
+    }
+
 // ----------------------------------------------------------------------------
 // CMPXDbAlbum::UpdateItemL
 // ----------------------------------------------------------------------------
@@ -407,39 +423,6 @@
 	}
 
 // ----------------------------------------------------------------------------
-// CMPXDbAlbum::GetAlbumsCountForArtistL
-// ----------------------------------------------------------------------------
-//
-TInt CMPXDbAlbum::GetAlbumsCountForArtistL(TUint32 aArtistId)
-	{
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryCategorySubcategoryItems, aArtistId));
-
-    TInt prevId(0);
-    TInt count(0);
-	TInt err(KErrNone);
-
-    while ((err = recordset.Next()) == KSqlAtRow)
-		{
-		TUint32 rowId(recordset.ColumnInt64(EAlbumUniqueId));
-        if (prevId == rowId)
-            {
-            continue;
-            }
-
-		count++;
-		prevId = rowId;
-		}
-
-    if (err != KSqlAtEnd)
-        {
-        User::Leave(err);
-        }
-
-	return count;
-
-	}
-
-// ----------------------------------------------------------------------------
 // CMPXDbAlbum::GetSongsCountInAlbumMatchingArtistL
 // ----------------------------------------------------------------------------
 //
@@ -501,14 +484,7 @@
 				{
 				MPX_DEBUG1("	EMPXMediaMusicArtist");
 
-				TPtrC artistName(KNullDesC);
-
-				// if album is unknown, ignore arist name
-				if (MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumName) != KNullDesC)
-					{
-					artistName.Set(MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumArtistName));
-					}
-
+				TPtrC artistName(MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumArtistName));
 				aMedia.SetTextValueL(KMPXMediaMusicArtist, artistName);
 				MPX_DEBUG2("	Artist[%S]", &artistName);
 				}
@@ -534,14 +510,7 @@
 				{
 				MPX_DEBUG1("	EMPXMediaMusicAlbumArtFileName");
 
-				TPtrC art(KNullDesC);
-
-				// if album is unknown, ignore album art name
-				if (MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumName) != KNullDesC)
-					{
-					art.Set(MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumArt));
-					}
-
+				TPtrC art(MPXDbCommonUtil::GetColumnTextL(aRecord, EAlbumArt));
 				aMedia.SetTextValueL(KMPXMediaMusicAlbumArtFileName, art);
 				MPX_DEBUG2("	Art[%S]", &art);
 				}
@@ -562,34 +531,10 @@
 		{
 		const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen);
 		MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicArt, albumArtFilename);
-		}
-
-	if (aMedia.IsSupported(KMPXMediaMusicArtist))
-	    {
-	    const TDesC& artistName = aMedia.ValueText(KMPXMediaMusicArtist).Left(KMCMaxTextLen);
-	    MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCAlbumArtistName, artistName);
-	    }
+		}	
 	}
 
 // ----------------------------------------------------------------------------
-// CMPXDbAlbum::IsUnknownArtistL
-// ----------------------------------------------------------------------------
-//
-TBool CMPXDbAlbum::IsUnknownArtistL(TUint32 aId)
-	{
-	return iObserver.HandleIsUnknownArtistL(aId);
-	}
-
-// ----------------------------------------------------------------------------
-// CMPXDbAlbum::ArtistForAlbumL
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXDbAlbum::ArtistForAlbumL(const TUint32 aId)
-    {
-    return iObserver.HandleArtistForAlbumL(aId);
-    }
-
-// ----------------------------------------------------------------------------
 // CMPXDbAlbum::AlbumartForAlbumL
 // ----------------------------------------------------------------------------
 //
@@ -599,6 +544,559 @@
     }
 
 // ----------------------------------------------------------------------------
+// CMPXDbAlbum::ProcessAlbumRecordSetL
+// Unknown album or Unknown artist are stored in the database as NULL (Name field and ArtistName field). 
+// The available unknown artist is saved for later and will be appended to the array 
+// as the last item among items which have the same artist.
+// The available unknown albums are saved for later and will be appended to the array
+// as the last items after all known albums are appended.
+// The unknown album and unknown artist is saved for later and will be appended to the array
+// as the last item.
+//
+// NOTE: putting unknown album to the end of the array only takes place when title
+//       field is requested. normal sorting algorithm occurs if title isn't
+//       requested.
+//
+// Example:
+//     Album X of artist A
+//     Album X of artist B
+//     Album X of unknown artist
+//     Album Y of artist A
+//     Album Y of unknown artist
+//     Unknown album of artist A
+//     Unknown album of artist B
+//     Unknown album of unknown artist
+// ----------------------------------------------------------------------------
+//
+void CMPXDbAlbum::ProcessAlbumRecordSetL(
+    const TArray<TMPXAttribute>& aAttrs,
+    RSqlStatement& aRecordset,
+    CMPXMediaArray& aMediaArray)
+    {
+    // populate the array
+    TBool firstRecord(ETrue);
+    CMPXMedia* unknownAlbumUnknownArtistMedia(NULL);
+    CMPXMedia* unknownMedia(NULL);
+    TUint32 prevId(0);
+    TUint32 albumId(0);
+    TUint32 prevAlbumId(0);
+    TInt count(0);
+    TInt err(KErrNone);
+       
+    // Reset array for unknown artists
+    if (iUnknownArtists.Count() > 0)
+        {
+        iUnknownArtists.ResetAndDestroy();
+        }
+    
+    // Reset array for unknown albums
+    if (iUnknownAlbums.Count() > 0)
+        {
+        iUnknownAlbums.ResetAndDestroy();
+        }
+        
+    TInt pPath(0);
+    if (aMediaArray.Count())
+        {
+        CMPXMedia* pMedia = aMediaArray[0];
+        if (pMedia->IsSupported(KMPXMediaGeneralValue))
+            { // Query excuted by OpenL
+            pPath = pMedia->ValueTObjectL<TInt>(KMPXMediaGeneralValue);
+            MPX_ASSERT(pPath);
+            }
+        }
+    
+    RArray<TMPXItemId> ids;
+    CleanupClosePushL(ids);
+    
+    while ((err = aRecordset.Next()) == KSqlAtRow)
+        {
+        TUint32 rowId(aRecordset.ColumnInt64(EAlbumUniqueId));
+        if (prevId == rowId)
+            {
+            continue;
+            }
+
+        prevId = rowId;
+        CMPXMedia* media = CMPXMedia::NewL();
+        CleanupStack::PushL(media);
+
+        UpdateMediaL(aRecordset, aAttrs, *media);
+        
+        albumId = MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), EMPXAlbum,
+                MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumName), ETrue);
+        
+        // Append Known album and Unknown artists
+        count = iUnknownArtists.Count();
+        if ( prevAlbumId != albumId && count > 0)
+            {
+            unknownMedia = NULL;
+                
+            for (TInt i = 0; i < count; i++)
+                {
+                unknownMedia = iUnknownArtists[i];
+                if (unknownMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+                    {
+                    ids.Append(unknownMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                    }
+                aMediaArray.AppendL(*unknownMedia);                 
+                }
+                
+            iUnknownArtists.ResetAndDestroy();
+            }
+        
+        // for Unknown album and Unknown artist
+        if (firstRecord && (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumArtistName).Length() == 0) &&
+            (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumName).Length() == 0))
+            {
+            unknownAlbumUnknownArtistMedia = media;
+            }
+        // for Unknown albums and Known artists
+        else if (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumName).Length() == 0)
+            {
+            iUnknownAlbums.Append(media);
+            CleanupStack::Pop(media);
+            }
+        // for Known album and Unknown artist
+        else if (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumArtistName).Length() == 0)
+            {
+            iUnknownArtists.Append(media);
+            CleanupStack::Pop(media);
+            
+            prevAlbumId = albumId;
+            }
+        else
+            {
+            if (media->IsSupported(KMPXMediaGeneralId) && pPath)
+                {
+                ids.AppendL(media->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                }
+            aMediaArray.AppendL(*media);
+            CleanupStack::PopAndDestroy(media);       
+            }
+        
+        firstRecord = EFalse;               
+        } // end while
+
+    if (err != KSqlAtEnd)
+        {
+        User::LeaveIfError(err);
+        }
+
+    // Append Known artist and Unknown albums
+    count = iUnknownArtists.Count();
+    if ( count > 0)
+        {
+        unknownMedia = NULL;
+        
+        for (TInt i = 0; i < count; i++)
+            {
+            unknownMedia = iUnknownArtists[i];
+            if (unknownMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+                {
+                ids.Append(unknownMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                }
+            aMediaArray.AppendL(*unknownMedia);                 
+            }
+        
+        iUnknownArtists.ResetAndDestroy();
+        }
+
+    // Append Unknown artists to MediaArray
+    count = iUnknownAlbums.Count();
+    if ( count > 0)
+        {
+        CMPXMedia* unknownMedia = NULL;
+        
+        for (TInt i = 0; i < count; i++)
+            {
+            unknownMedia = iUnknownAlbums[i];
+            if (unknownMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+                {
+                ids.Append(unknownMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                }
+            aMediaArray.AppendL(*unknownMedia);                 
+            }
+        
+        iUnknownAlbums.ResetAndDestroy();
+        }
+    
+    // the last item in the list
+    if (unknownAlbumUnknownArtistMedia)
+        {
+        if (unknownAlbumUnknownArtistMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+            {
+            ids.AppendL(unknownAlbumUnknownArtistMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+            }
+        aMediaArray.AppendL(*unknownAlbumUnknownArtistMedia);
+        CleanupStack::PopAndDestroy(unknownAlbumUnknownArtistMedia);
+        }
+    
+    // Append ids to the returned path
+    if (pPath)
+        {
+        ((CMPXCollectionPath*)pPath)->AppendL(ids.Array());
+        }
+    CleanupStack::PopAndDestroy(&ids);
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbAlbum::ProcessMediaWallAlbumRecordSetL
+// Unknown album or Unknown artist are stored in the database as NULL (Name field and ArtistName field). 
+// The available unknown album is saved for later and will be appended to the array 
+// as the last item among items which have the same artist.
+// The available unknown artists are saved for later and will be appended to the array
+// as the last items after all known artists are appended.
+// The unknown album and unknown artist is saved for later and will be appended to the array
+// as the last item.
+//
+// NOTE: putting unknown album to the end of the array only takes place when title
+//       field is requested. normal sorting algorithm occurs if title isn't
+//       requested.
+//
+// Example:
+//     Album X of artist A
+//     Album Y of artist A
+//     Unknown album of artist A
+//     Album X of artist B
+//     Album Z of artist B
+//     Unknown album of artist B
+//     Album X of unknown artist
+//     Album Y of unknown artist
+//     Unknown album of unknown artist
+// ----------------------------------------------------------------------------
+//
+//
+void CMPXDbAlbum::ProcessMediaWallAlbumRecordSetL(
+    const TArray<TMPXAttribute>& aAttrs,
+    RSqlStatement& aRecordset,
+    CMPXMediaArray& aMediaArray)
+    {
+    // populate the array
+    TBool firstRecord(ETrue);
+    CMPXMedia* unknownAlbumUnknownArtistMedia(NULL);
+    CMPXMedia* unknownMedia(NULL);
+    TUint32 prevId(0);
+    TUint32 artistId(0);
+    TUint32 prevArtistId(0);
+    TInt count(0);
+    TInt err(KErrNone);
+       
+    // Reset array for unknown artists
+    if (iUnknownArtists.Count() > 0)
+        {
+        iUnknownArtists.ResetAndDestroy();
+        }
+    
+    // Reset array for unknown albums
+    if (iUnknownAlbums.Count() > 0)
+        {
+        iUnknownAlbums.ResetAndDestroy();
+        }
+        
+    TInt pPath(0);
+    if (aMediaArray.Count())
+        {
+        CMPXMedia* pMedia = aMediaArray[0];
+        if (pMedia->IsSupported(KMPXMediaGeneralValue))
+            { // Query excuted by OpenL
+            pPath = pMedia->ValueTObjectL<TInt>(KMPXMediaGeneralValue);
+            MPX_ASSERT(pPath);
+            }
+        }
+    
+    RArray<TMPXItemId> ids;
+    CleanupClosePushL(ids);
+
+    while ((err = aRecordset.Next()) == KSqlAtRow)
+        {
+        TUint32 rowId(aRecordset.ColumnInt64(EAlbumUniqueId));
+        if (prevId == rowId)
+            {
+            continue;
+            }
+
+        prevId = rowId;
+        CMPXMedia* media = CMPXMedia::NewL();
+        CleanupStack::PushL(media);
+
+        UpdateMediaL(aRecordset, aAttrs, *media);
+    
+        artistId = aRecordset.ColumnInt64(EAlbumArtist);
+
+        // Append Known artist and Unknown albums
+        count = iUnknownAlbums.Count();
+        if (prevArtistId != artistId && count > 0)
+            {
+            unknownMedia = NULL;
+                
+            for (TInt i = 0; i < count; i++)
+                {
+                unknownMedia = iUnknownAlbums[i];
+                if (unknownMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+                    {
+                    ids.Append(unknownMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                    }
+                aMediaArray.AppendL(*unknownMedia);                 
+                }
+                
+            iUnknownAlbums.ResetAndDestroy();
+            }
+        
+        // for Unknown artist and Unknown album
+        if (firstRecord && (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumName).Length() == 0) &&
+            (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumArtistName).Length() == 0))
+            {
+            unknownAlbumUnknownArtistMedia = media;
+            }
+        // for Unknown artists and Known albums
+        else if (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumArtistName).Length() == 0)
+            {
+            iUnknownArtists.Append(media);
+            CleanupStack::Pop(media);
+            }
+        // for Known artist and Unknown album
+        else if (MPXDbCommonUtil::GetColumnTextL(aRecordset, EAlbumName).Length() == 0)
+            {
+            iUnknownAlbums.Append(media);
+            CleanupStack::Pop(media);
+            prevArtistId = artistId;
+            }
+        else
+            {
+            if (media->IsSupported(KMPXMediaGeneralId) && pPath)
+                {
+                ids.AppendL(media->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                }
+            aMediaArray.AppendL(*media);
+            CleanupStack::PopAndDestroy(media);       
+            }
+        
+        firstRecord = EFalse;               
+        } // end while
+
+    if (err != KSqlAtEnd)
+        {
+        User::LeaveIfError(err);
+        }
+
+    // Append Known artist and Unknown albums
+    count = iUnknownAlbums.Count();
+    if ( count > 0)
+        {
+        unknownMedia = NULL;
+        
+        for (TInt i = 0; i < count; i++)
+            {
+            unknownMedia = iUnknownAlbums[i];
+            if (unknownMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+                {
+                ids.Append(unknownMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                }
+            aMediaArray.AppendL(*unknownMedia);                 
+            }
+        
+        iUnknownAlbums.ResetAndDestroy();
+        }
+
+    // Append Unknown artists to MediaArray
+    count = iUnknownArtists.Count();
+    if ( count > 0)
+        {
+        CMPXMedia* unknownMedia = NULL;
+        
+        for (TInt i = 0; i < count; i++)
+            {
+            unknownMedia = iUnknownArtists[i];
+            if (unknownMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+                {
+                ids.Append(unknownMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+                }
+            aMediaArray.AppendL(*unknownMedia);                 
+            }
+        
+        iUnknownArtists.ResetAndDestroy();
+        }
+    
+    // the last item in the list
+    if (unknownAlbumUnknownArtistMedia)
+        {
+        if (unknownAlbumUnknownArtistMedia->IsSupported(KMPXMediaGeneralId) && pPath)
+            {
+            ids.AppendL(unknownAlbumUnknownArtistMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+            }
+        aMediaArray.AppendL(*unknownAlbumUnknownArtistMedia);
+        CleanupStack::PopAndDestroy(unknownAlbumUnknownArtistMedia);
+        }
+    
+    // Append ids to the returned path
+    if (pPath)
+        {
+        ((CMPXCollectionPath*)pPath)->AppendL(ids.Array());
+        }
+    CleanupStack::PopAndDestroy(&ids);
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbAlbum::GenerateUniqueIdL
+// ----------------------------------------------------------------------------
+//
+TUint32 CMPXDbAlbum::GenerateUniqueIdL(const CMPXMedia& aMedia)
+    {
+    TPtrC album(KNullDesC);
+    TPtrC albumArtist(KNullDesC);
+    TPtrC artist(KNullDesC);
+    
+    // check Album attirbute
+    if (aMedia.IsSupported(KMPXMediaMusicAlbum))     
+        {
+        album.Set(aMedia.ValueText(KMPXMediaMusicAlbum).Left(KMCMaxTextLen));
+        }
+    
+    HBufC* buf(NULL);    
+    if (RetrieveAlbumArtistL(aMedia, albumArtist))
+        {
+        buf = HBufC::NewLC(album.Length() + albumArtist.Length() + KAlbumAlbumArtistSeperator().Length());
+    
+        buf->Des().Append(album);
+        buf->Des().Append(KAlbumAlbumArtistSeperator);
+        buf->Des().Append(albumArtist);
+        }
+    else
+        {
+        RetrieveArtist(aMedia, artist);
+        
+        buf = HBufC::NewLC(album.Length() + artist.Length() + KAlbumArtistSeperator().Length());
+        
+        buf->Des().Append(album);
+        buf->Des().Append(KAlbumArtistSeperator);
+        buf->Des().Append(artist);
+        }
+    
+    // try to find the item first
+    TUint32 id(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), EMPXAlbum,
+        *buf, ETrue));
+    CleanupStack::PopAndDestroy(buf);
+    
+    return id;
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbAlbum::IsUnknownAlbumL
+// ----------------------------------------------------------------------------
+//
+TBool CMPXDbAlbum::IsUnknownAlbumL(const TUint32 aId)
+    {
+    HBufC* query = PreProcessStringLC(KQueryCategoryItem);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, aId));
+    CleanupStack::PopAndDestroy(query);
+    CleanupClosePushL(recordset);
+
+    if (recordset.Next() != KSqlAtRow)
+        {
+        User::Leave(KErrNotFound);
+        }
+    
+    TPtrC album(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumName)); 
+    TPtrC artistName(MPXDbCommonUtil::GetColumnTextL(recordset, EAlbumArtistName)); 
+
+    TBool ret = EFalse;
+    if (album.Length() == 0 || artistName.Length() == 0)
+        {
+        ret = ETrue;   
+        }
+    else
+        {
+        ret = EFalse;
+        }
+    
+    CleanupStack::PopAndDestroy(&recordset);
+    
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbAlbum::RetrieveAlbumArtistL
+// ----------------------------------------------------------------------------
+//
+TBool CMPXDbAlbum::RetrieveAlbumArtistL(const CMPXMedia& aMedia, TPtrC& aName)
+    {
+    // check AlbumArtist attribute
+    if (aMedia.IsSupported(KMPXMediaMusicAlbumArtist))
+        {
+        aName.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtist).Left(KMCMaxTextLen));
+        }
+    else
+        {
+        aName.Set(KNullDesC);
+        }
+    
+    if (aName.Length() > 0 )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbAlbum::RetrieveArtist
+// ----------------------------------------------------------------------------
+//
+void CMPXDbAlbum::RetrieveArtist(const CMPXMedia& aMedia, TPtrC& aName)
+    {
+    // check Artist attribute
+    if (aMedia.IsSupported(KMPXMediaMusicArtist))
+        {
+        aName.Set(aMedia.ValueText(KMPXMediaMusicArtist).Left(KMCMaxTextLen));
+        }
+    else
+        {
+        aName.Set(KNullDesC);            
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbAlbum::NeedToUpdateArt
+// ----------------------------------------------------------------------------
+//
+TBool CMPXDbAlbum::NeedToUpdateArt(const TDesC& aDeletedSongArt, const TDesC& aCurrentAlbumArt)
+    {    
+    if (aDeletedSongArt.Length() == 0)
+        {
+        // Deleted song's art has default album art
+        return EFalse;
+        }
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+    else
+    if (aDeletedSongArt.Length() > 0)
+        {
+        TParsePtrC parse(aDeletedSongArt);
+        TPtrC ext(parse.Ext());
+        //set flag to false, so .alb will not overwrite art field in album, artist table 
+        // when song with embedded art
+        if (ext.CompareF(KAbstractAlbumExt) == 0) 
+            {     
+            // Deleted song's art is Non-embedded album art
+            return EFalse;
+            }
+        }
+    else
+#endif   
+    if (aDeletedSongArt.Length() > 0 && aCurrentAlbumArt.Length() > 0 && aDeletedSongArt.CompareF(aCurrentAlbumArt) == 0)
+        {
+        // Deleted song's art is Embedded album art and it is the same as Album's current art
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// ----------------------------------------------------------------------------
 // CMPXDbAlbum::CreateTableL
 // ----------------------------------------------------------------------------
 //
@@ -609,9 +1107,7 @@
     MPX_FUNC("CMPXDbCategory::CreateTableL");
 
     // create the table
-    HBufC* query = PreProcessStringLC(KAlbumCreateTable);
-    User::LeaveIfError(aDatabase.Exec(*query));
-    CleanupStack::PopAndDestroy(query);
+    User::LeaveIfError(aDatabase.Exec(KAlbumCreateTable));
 
     // do not create an index on the Name field
     // as it only slows down the insert/update queries overall
@@ -626,9 +1122,7 @@
     {
     MPX_FUNC("CMPXDbCategory::CheckTableL");
 
-    HBufC* query = PreProcessStringLC(KAlbumCheckTable);
-    TBool check(DoCheckTable(aDatabase, *query));
-    CleanupStack::PopAndDestroy(query);
+    TBool check(DoCheckTable(aDatabase, KAlbumCheckTable));
 
     return check;
     }
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbartist.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbartist.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -42,12 +42,11 @@
 //
 CMPXDbArtist* CMPXDbArtist::NewL(
     CMPXDbManager& aDbManager,
-    TMPXGeneralCategory aCategory,
-    MMPXDbArtistObserver& aObserver)
+    TMPXGeneralCategory aCategory)
     {
     MPX_FUNC("CMPXDbArtist::NewL");
 
-    CMPXDbArtist* self = CMPXDbArtist::NewLC(aDbManager, aCategory, aObserver);
+    CMPXDbArtist* self = CMPXDbArtist::NewLC(aDbManager, aCategory);
     CleanupStack::Pop(self);
     return self;
     }
@@ -58,12 +57,11 @@
 //
 CMPXDbArtist* CMPXDbArtist::NewLC(
     CMPXDbManager& aDbManager,
-    TMPXGeneralCategory aCategory,
-    MMPXDbArtistObserver& aObserver)
+    TMPXGeneralCategory aCategory)
     {
     MPX_FUNC("CMPXDbArtist::NewLC");
 
-    CMPXDbArtist* self = new (ELeave) CMPXDbArtist(aDbManager, aCategory, aObserver);
+    CMPXDbArtist* self = new (ELeave) CMPXDbArtist(aDbManager, aCategory);
     CleanupStack::PushL(self);
     self->ConstructL();
     return self;
@@ -84,10 +82,8 @@
 //
 CMPXDbArtist::CMPXDbArtist(
     CMPXDbManager& aDbManager,
-    TMPXGeneralCategory aCategory,
-    MMPXDbArtistObserver& aObserver) :
-    CMPXDbCategory(aDbManager, aCategory),
-    iObserver(aObserver)
+    TMPXGeneralCategory aCategory) :
+    CMPXDbCategory(aDbManager, aCategory)
     {
     MPX_FUNC("CMPXDbArtist::CMPXDbArtist");
     }
@@ -108,58 +104,63 @@
 // ----------------------------------------------------------------------------
 //
 TUint32 CMPXDbArtist::AddItemL(
-    const TDesC& aName,
-    const TDesC& aArt,
+    TMPXGeneralCategory /*aCategory*/,        
+    const CMPXMedia& aMedia,
     TInt aDriveId,
     TBool& aNewRecord,
     TBool aCaseSensitive)
     {
     MPX_FUNC("CMPXDbArtist::AddItemL");
 
+    TPtrC artist(KNullDesC);
+    TPtrC albumArt(KNullDesC);
+    
+    if (aMedia.IsSupported(KMPXMediaMusicArtist))
+        {
+        artist.Set(aMedia.ValueText(KMPXMediaMusicArtist).Left(KMCMaxTextLen));
+        }
+    
+    if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName))
+        {
+        albumArt.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen));
+        }
+       
     // try to find the item first
     TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), iCategory,
-        aName, aCaseSensitive));
-    aNewRecord = !CategoryItemExistsL(aDriveId, rowId);
+        artist, aCaseSensitive));
 
-    if (aNewRecord)
+    HBufC* query = PreProcessStringLC(KQueryCategoryItem);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(aDriveId, *query, rowId));
+    CleanupStack::PopAndDestroy(query);
+    CleanupClosePushL(recordset);
+    
+    TInt result(recordset.Next());
+    if (result == KSqlAtEnd)
         {
+        aNewRecord = result;
+        
         // insert new
-        HBufC* query = PreProcessStringLC(KQueryArtistInsert);
-        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(aName);
-        HBufC* art = MPXDbCommonUtil::ProcessSingleQuotesLC(aArt);
+        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(artist);
+        HBufC* art = MPXDbCommonUtil::ProcessSingleQuotesLC(albumArt);
 
-        iDbManager.ExecuteQueryL(aDriveId, *query, rowId, name, 1, art);
+        iDbManager.ExecuteQueryL(aDriveId, KQueryArtistInsert, rowId, name, 1, 0, art);
 
         CleanupStack::PopAndDestroy(art);
         CleanupStack::PopAndDestroy(name);
-        CleanupStack::PopAndDestroy(query);
         }
-    else
+    else if (result == KSqlAtRow)
         {
-        // retrieve the existing record
-        HBufC* query = NULL;
-        query = PreProcessStringLC(KQueryCategoryItem);
-        RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, rowId));
-        CleanupStack::PopAndDestroy(query);
-
-        CleanupClosePushL(recordset);
-
-        if (recordset.Next() != KSqlAtRow)
-            {
-            User::Leave(KErrNotFound);
-        }
-
-        // Album Art
+        // retrieve Art from Artist table
         TPtrC art(KNullDesC);
         art.Set(MPXDbCommonUtil::GetColumnTextL(recordset, EArtistArt));
 
         // the current one is Unknown and the new one is Not Unknown
-        if ( art == KNullDesC && aArt != KNullDesC )
+        if ( art == KNullDesC && albumArt != KNullDesC )
             {
             HBufC* artReplaceSingleQuote = 
-                MPXDbCommonUtil::ProcessSingleQuotesLC( aArt );
+                MPXDbCommonUtil::ProcessSingleQuotesLC( albumArt );
             _LIT( KFormatArt, "Art=\'%S\'" );
-            HBufC* setStr = HBufC::NewLC(256);
+            HBufC* setStr = HBufC::NewLC(KMaxFileName);
             setStr->Des().Format( KFormatArt, artReplaceSingleQuote );
 
             iDbManager.ExecuteQueryL(aDriveId, KQueryArtistUpdate, setStr, rowId);
@@ -167,35 +168,68 @@
             CleanupStack::PopAndDestroy(artReplaceSingleQuote);
             }
 
-        CleanupStack::PopAndDestroy(&recordset);
-
         // increment the number of songs for the category
         query = PreProcessStringLC(KQueryCategoryIncrementSongCount);
         iDbManager.ExecuteQueryL(aDriveId, *query, rowId);
         CleanupStack::PopAndDestroy(query);
         }
-
+    else
+        {
+        MPX_DEBUG2("SQL error %d", result);
+        User::Leave(result);
+        }
+    
+    CleanupStack::PopAndDestroy(&recordset);
+    
     return rowId;
     }
-
+    
 // ----------------------------------------------------------------------------
-// CMPXDbArtist::IsUnknownArtistL
+// CMPXDbArtist::DecrementSongsForCategoryL
 // ----------------------------------------------------------------------------
 //
-TBool CMPXDbArtist::IsUnknownArtistL(TUint32 aId)
+void CMPXDbArtist::DecrementSongsForCategoryL(
+    const TUint32 aId,
+    TInt aDriveId,
+    CMPXMessageArray* aItemChangedMessages,
+    TBool& aItemExist
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+    ,
+    TBool /*aMTPInUse*/
+#endif //ABSTRACTAUDIOALBUM_INCLUDED
+    )
     {
-	MPX_FUNC("CMPXDbArtist::IsUnknownArtistL");
-
-    HBufC* name = GetNameL(aId);
+    MPX_FUNC("CMPXDbArtist::DecrementSongsForCategoryL");
+    
+    TInt songsCount(0);
+    TInt albumsCount(0);
+    
+    GetSongsAndAlbumsCountL(aDriveId, aId, songsCount, albumsCount); 
+            
+    MPX_DEBUG4("id %d, songsCount %d, albumsCount %d", aId, songsCount, albumsCount);
+    
+    // if just one song uses this category. Use <= just in case
+    if (songsCount <= 1 && albumsCount == 0)  
+        {
+        aItemExist = EFalse;
+        // delete the category
+        DeleteCategoryL(aId, aDriveId);
 
-	TInt ret = EFalse;
-	if (*name == KNullDesC)
-		{
-		ret = ETrue;
-		}
-	delete name;
-
-	return ret;
+        if (aItemChangedMessages)
+            {
+            // add the item changed message
+            MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemDeleted,
+                iCategory, KDBPluginUid);
+            }
+        }
+    else if (songsCount > 0)
+        {
+        aItemExist = ETrue;
+        // decrement the number of songs for the category
+        HBufC* query = PreProcessStringLC(KQueryCategoryDecrementSongCount);
+        iDbManager.ExecuteQueryL(aDriveId, *query, aId);
+        CleanupStack::PopAndDestroy(query);
+        }
     }
 
 // ----------------------------------------------------------------------------
@@ -237,10 +271,6 @@
                 }
             if (attributeId & EMPXMediaGeneralCount)
                 {
-//				TInt albumCount = GetAlbumsCountL(aRecord.ColumnInt64(EArtistUniqueId));
-//              aMedia.SetTObjectValueL<TInt>(KMPXMediaGeneralCount,albumCount);
-//              MPX_DEBUG1("	EMPXMediaGeneralCount");
-//				MPX_DEBUG2("	AlbumCount[%d]", albumCount);
                 // get songs count from all drives
                 TInt songCount = GetSongsCountL( KDbManagerAllDrives,
                                     aRecord.ColumnInt64( EArtistUniqueId ) );
@@ -281,17 +311,6 @@
     }
 
 // ----------------------------------------------------------------------------
-// CMPXDbArtist::GetAlbumsCountL
-// ----------------------------------------------------------------------------
-//
-TInt CMPXDbArtist::GetAlbumsCountL(TUint32 aId)
-    {
-    MPX_FUNC("CMPXDbArtist::GetAlbumsCountL");
-
-	return iObserver.HandleGetAlbumsCountForArtistL(aId);
-    }
-
-// ----------------------------------------------------------------------------
 // CMPXDbArtist::GetAllCategoryItemsL
 // ----------------------------------------------------------------------------
 //
@@ -300,9 +319,7 @@
     CMPXMediaArray& aMediaArray)
     {
     MPX_FUNC("CMPXDbArtist::GetAllCategoryItemsL");
-    HBufC* query = PreProcessStringLC(KQueryArtistAll);
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query));
-    CleanupStack::PopAndDestroy(query);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryArtistAll()));
     CleanupClosePushL(recordset);
     ProcessRecordsetL(aAttrs, recordset, aMediaArray);
     CleanupStack::PopAndDestroy(&recordset);
@@ -343,37 +360,169 @@
     CleanupStack::PopAndDestroy(values);
     CleanupStack::PopAndDestroy(fields);
     }
+
 // ----------------------------------------------------------------------------
-// CMPXDbAlbum::CreateTableL
+// CMPXDbArtist::AddAlbumArtistL
+// ----------------------------------------------------------------------------
+//
+TUint32 CMPXDbArtist::AddAlbumArtistL(
+    const TDesC& aName,
+    const TDesC& aArt,
+    TInt aDriveId)
+    {
+    MPX_FUNC("CMPXDbArtist::AddAlbumArtistL");
+
+    // try to find the item first
+    TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), iCategory,
+        aName, ETrue));
+    HBufC* query = PreProcessStringLC(KQueryCategoryItem);
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(aDriveId, *query, rowId));
+    CleanupStack::PopAndDestroy(query);
+    CleanupClosePushL(recordset);
+    
+    TInt result(recordset.Next());
+    if (result == KSqlAtEnd)
+        {
+        // insert new
+        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(aName);
+        HBufC* art = MPXDbCommonUtil::ProcessSingleQuotesLC(aArt);
+
+        iDbManager.ExecuteQueryL(aDriveId, KQueryArtistInsert, rowId, name, 0, 1, art);
+
+        CleanupStack::PopAndDestroy(art);
+        CleanupStack::PopAndDestroy(name);
+        }
+    else if (result == KSqlAtRow)
+        {
+        // retrieve Art from Artist table
+        TPtrC art(KNullDesC);
+        art.Set(MPXDbCommonUtil::GetColumnTextL(recordset, EArtistArt));
+
+        // the current one is Unknown and the new one is Not Unknown
+        if ( art == KNullDesC && aArt != KNullDesC )
+            {
+            HBufC* artReplaceSingleQuote = 
+                MPXDbCommonUtil::ProcessSingleQuotesLC( aArt );
+            _LIT( KFormatArt, "Art=\'%S\'" );
+            HBufC* setStr = HBufC::NewLC(KMaxFileName);
+            setStr->Des().Format( KFormatArt, artReplaceSingleQuote );
+
+            iDbManager.ExecuteQueryL(aDriveId, KQueryArtistUpdate, setStr, rowId);
+            CleanupStack::PopAndDestroy(setStr);
+            CleanupStack::PopAndDestroy(artReplaceSingleQuote);
+            }
+
+        // increment the number of songs for the category
+        iDbManager.ExecuteQueryL(aDriveId, KQueryArtistIncrementAlbumCount, rowId);
+        }
+    else
+        {
+        MPX_DEBUG2("SQL error %d", result);
+        User::Leave(result);
+        }
+
+    CleanupStack::PopAndDestroy(&recordset);
+    
+    return rowId;
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbArtist::DecrementAlbumsForArtistL
+// ----------------------------------------------------------------------------
+//
+void CMPXDbArtist::DecrementAlbumsForArtistL(
+    const TUint32 aId,
+    TInt aDriveId,
+    CMPXMessageArray* aItemChangedMessages
+    )
+    {
+    MPX_FUNC("CMPXDbArtist::DecrementAlbumsForCategoryL");
+    
+    TInt songsCount(0);
+    TInt albumsCount(0);
+    
+    GetSongsAndAlbumsCountL(aDriveId, aId, songsCount, albumsCount);
+    
+    MPX_DEBUG4("id %d, songsCount %d, albumsCount %d", aId, songsCount, albumsCount);
+    
+    // if just one album uses this category. Use <= just in case
+    if (songsCount == 0 && albumsCount <= 1)
+        {
+        // delete the category
+        DeleteCategoryL(aId, aDriveId);
+
+        if (aItemChangedMessages)
+            {
+            // add the item changed message
+            MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemDeleted,
+                iCategory, KDBPluginUid);
+            }
+        }
+    else if (albumsCount > 0)
+        {
+        // decrement the number of albums for the category
+        iDbManager.ExecuteQueryL(aDriveId, KQueryArtistDecrementAlbumCount, aId);
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbArtist::GetSongsAndAlbumsCountL
+// ----------------------------------------------------------------------------
+//
+void CMPXDbArtist::GetSongsAndAlbumsCountL(
+    TInt aDriveId,
+    TUint32 aId, 
+    TInt& aSongCount,
+    TInt& aAlbumCount)
+    {
+    MPX_FUNC("CMPXDbArtist::GetSongsAndAlbumsCountL");
+
+    RSqlStatement recordset(
+        iDbManager.ExecuteSelectQueryL(aDriveId, KQueryArtistGetSongCountAndAlbumCount, aId));
+    CleanupClosePushL(recordset);
+
+    TInt err(KErrNone);
+    while ((err = recordset.Next()) == KSqlAtRow)
+        {
+        aSongCount += recordset.ColumnInt(KMPXTableDefaultIndex);
+        aAlbumCount += recordset.ColumnInt(KMPXTableDefaultIndex+1);
+        }
+
+    if (err != KSqlAtEnd)
+        {
+        User::Leave(err);
+        }
+
+    CleanupStack::PopAndDestroy(&recordset);
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbArtist::CreateTableL
 // ----------------------------------------------------------------------------
 //
 void CMPXDbArtist::CreateTableL(
     RSqlDatabase& aDatabase,
     TBool /* aCorruptTable */)
     {
-    MPX_FUNC("CMPXDbCategory::CreateTableL");
+    MPX_FUNC("CMPXDbArtist::CreateTableL");
 
     // create the table
-    HBufC* query = PreProcessStringLC(KArtistCreateTable);
-    User::LeaveIfError(aDatabase.Exec(*query));
-    CleanupStack::PopAndDestroy(query);
+    User::LeaveIfError(aDatabase.Exec(KArtistCreateTable));
 
     // do not create an index on the Name field
     // as it only slows down the insert/update queries overall
     }
 
 // ----------------------------------------------------------------------------
-// CMPXDbAlbum::CheckTableL
+// CMPXDbArtist::CheckTableL
 // ----------------------------------------------------------------------------
 //
 TBool CMPXDbArtist::CheckTableL(
     RSqlDatabase& aDatabase)
     {
-    MPX_FUNC("CMPXDbCategory::CheckTableL");
+    MPX_FUNC("CMPXDbArtist::CheckTableL");
 
-    HBufC* query = PreProcessStringLC(KArtistCheckTable);
-    TBool check(DoCheckTable(aDatabase, *query));
-    CleanupStack::PopAndDestroy(query);
+    TBool check(DoCheckTable(aDatabase, KArtistCheckTable));
 
     return check;
     }
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbcategory.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbcategory.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -30,6 +30,7 @@
 #include "mpxdbpluginqueries.h"
 #include "mpxdbutil.h"
 #include "mpxdbcategory.h"
+#include "mpxmediamusicdefs.h"
 
 // CONSTANTS
 
@@ -79,23 +80,26 @@
 // ----------------------------------------------------------------------------
 //
 TUint32 CMPXDbCategory::AddItemL(
-    const TDesC& aName,
+    TMPXGeneralCategory aCategory,        
+    const CMPXMedia& aMedia,
     TInt aDriveId,
     TBool& aNewRecord,
     TBool aCaseSensitive)
     {
     MPX_FUNC("CMPXDbCategory::AddItemL");
 
+    TPtrC itemName(ItemNameL(aCategory, aMedia));
+    
     // try to find the item first
     TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), iCategory,
-        aName, aCaseSensitive));
+        itemName, aCaseSensitive));
     aNewRecord = !CategoryItemExistsL(aDriveId, rowId);
 
     if (aNewRecord)
         {
         // insert new
         HBufC* query = PreProcessStringLC(KQueryCategoryInsert);
-        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(aName);
+        HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(itemName);
 
         iDbManager.ExecuteQueryL(aDriveId, *query, rowId, name, 1);
 
@@ -112,7 +116,7 @@
 
     return rowId;
     }
-
+		
 // ----------------------------------------------------------------------------
 // CMPXDbCategory::GetNameL
 // ----------------------------------------------------------------------------
@@ -240,20 +244,37 @@
         }
 
     // construct criteria string
-    HBufC* criteriaStr = MPXDbCommonUtil::StringFromArrayLC(*criteriaArray, KMCAndKeyword);
+    HBufC* criteriaStr = NULL;
+    if (criteriaArray->Count() > 0)
+        {
+        criteriaStr = MPXDbCommonUtil::StringFromArrayLC(*criteriaArray, KMCAndKeyword);
+        }
+    else
+        {
+        _LIT(KCriteriaTrue, "1");
+        criteriaStr = KCriteriaTrue().AllocLC();
+        }
+        
+    RSqlStatement recordset;
+    if (iCategory == EMPXArtist)
+        {
+        recordset = iDbManager.ExecuteSelectQueryL(KQueryArtistItems, criteriaStr);
+        CleanupStack::PopAndDestroy(2, criteriaArray);  //criteriaStr, criteriaArray
+        }
+    else 
+        {
+        HBufC* query = PreProcessStringLC(KQueryCategoryItems);
+        recordset = iDbManager.ExecuteSelectQueryL(*query, criteriaStr);
+        CleanupStack::PopAndDestroy(3, criteriaArray);  //query, criteriaStr, criteriaArray 
+        }
 
-    // either get all items or items filtered based on criteria
-    HBufC* query = PreProcessStringLC(criteriaStr->Length() ?
-        KQueryCategoryItems() : KQueryCategoryAll());
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(*query, criteriaStr));
-    CleanupStack::PopAndDestroy(3, criteriaArray); // query, criteriaStr, criteriaArray
     CleanupClosePushL(recordset);
 
     // process the results
     ProcessRecordsetL(aAttrs, recordset, aMediaArray);
     CleanupStack::PopAndDestroy(&recordset);
     }
-
+        
 // ----------------------------------------------------------------------------
 // CMPXDbCategory::DecrementSongsForCategoryL
 // ----------------------------------------------------------------------------
@@ -409,16 +430,6 @@
     {
     MPX_FUNC("CMPXDbCategory::GetSubCategoryItemsL");
 
-    // this is only valid for albums belonging to an artist
-    ASSERT((iCategory == EMPXAlbum) && (aParentCategory == EMPXArtist));
-
-    // to handle the UREL warning
-    (void)aParentCategory;
-
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryCategorySubcategoryItems, aParentId));
-    CleanupClosePushL(recordset);
-    ProcessRecordsetL(aAttrs, recordset, aMediaArray);
-    CleanupStack::PopAndDestroy(&recordset);
     }
 
 // ----------------------------------------------------------------------------
@@ -486,7 +497,9 @@
     TInt /*aDriveId*/,
     CMPXMessageArray* /*aItemChangedMessages*/)
 	{
-	// nothing
+    MPX_FUNC("CMPXDbCategory::UpdateItemL");
+    
+	// do nothing
 	}
 
 // ----------------------------------------------------------------------------
@@ -574,7 +587,7 @@
 
 // ----------------------------------------------------------------------------
 // CMPXDbCategory::ProcessRecordsetL
-// Unknown item is stored in the database as NULL (name field). This ensures the
+// Unknown item is stored in the database as empty string (name field). This ensures the
 // unknown item to be the 1st found record if it exists. This will save time in
 // searching for the unknown record among the results and avoid performing
 // descriptor comparison. If the 1st record is the unknown item, it won't be
@@ -666,6 +679,46 @@
     }
 
 // ----------------------------------------------------------------------------
+// CMPXDbCategory::ItemNameL
+// ----------------------------------------------------------------------------
+//
+TPtrC CMPXDbCategory::ItemNameL(
+    TMPXGeneralCategory aCategory,        
+    const CMPXMedia& aMedia)
+    {
+    MPX_FUNC("CMPXDbCategory::ItemNameL");
+    
+    TMPXAttribute attribute;
+    switch(aCategory)
+        {
+        case EMPXGenre:
+            {
+            attribute = KMPXMediaMusicGenre;
+            break;
+            }
+        case EMPXComposer:
+            {
+            attribute = KMPXMediaMusicComposer;
+            break;
+            }
+        default:
+            {
+            User::Leave(KErrArgument);
+            break;
+            }
+        }
+    
+    if (aMedia.IsSupported(attribute))
+        {
+        return aMedia.ValueText(attribute).Left(KMCMaxTextLen);
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+// ----------------------------------------------------------------------------
 // CMPXDbCategory::CreateTableL
 // ----------------------------------------------------------------------------
 //
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -174,7 +174,7 @@
     //
     iDbMusic = CMPXDbMusic::NewL(*iDbManager, iResource, *this);
     iDbPlaylist = CMPXDbPlaylist::NewL(*iDbManager, *this);
-    iDbArtist = CMPXDbArtist::NewL(*iDbManager, EMPXArtist, *this);
+    iDbArtist = CMPXDbArtist::NewL(*iDbManager, EMPXArtist);
     iDbAlbum = CMPXDbAlbum::NewL(*iDbManager, EMPXAlbum, *this);
     iDbGenre = CMPXDbGenre::NewL(*iDbManager, EMPXGenre);
     iDbComposer = CMPXDbComposer::NewL(*iDbManager, EMPXComposer);
@@ -2160,7 +2160,7 @@
     // Update the category records
     TBool categoryExist( EFalse );
     iDbArtist->DecrementSongsForCategoryL(artistID, drive, &aItemChangedMessages, categoryExist);
-    iDbAlbum->DecrementSongsForCategoryL(albumID, drive, &aItemChangedMessages, categoryExist, artistID, *art);
+    iDbAlbum->DecrementSongsForAlbumL(albumID, drive, &aItemChangedMessages, categoryExist, *art);
     iDbGenre->DecrementSongsForCategoryL(genreID, drive, &aItemChangedMessages, categoryExist);
     iDbComposer->DecrementSongsForCategoryL(composerID, drive, &aItemChangedMessages, categoryExist);
     CleanupStack::PopAndDestroy(art);
@@ -2563,7 +2563,16 @@
     //////////////////////////////////////////////////////////////////////
     else
         {
-        iDbMusic->FindSongsL(id, containerId, type, aCriteria, aAttrs, aMediaArray);
+        TBool sortByTrackOrder = EFalse;
+		
+        // construct the sort order depending on category. Albums are always sorted by track,
+        // then name, except for unknown album. Songs are sorted by name for unknown album.
+        // NULL track number is stored as KMaxTInt so that they will be sorted to the end
+        if ((type == EMPXGroup) && (MPX_ITEM_CATEGORY(id) == EMPXAlbum) && !iDbAlbum->IsUnknownAlbumL(id))
+            {
+            sortByTrackOrder = ETrue;
+            }
+        iDbMusic->FindSongsL(id, containerId, type, aCriteria, aAttrs, aMediaArray, sortByTrackOrder);
         }
     }
 
@@ -3049,103 +3058,63 @@
 #endif // RD_MULTIPLE_DRIVE
 
 // ----------------------------------------------------------------------------
+// CMPXDbHandler::AddAbstractAlbumItemL
+// ----------------------------------------------------------------------------
+//
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED
+TUint32 CMPXDbHandler::AddAbstractAlbumItemL(
+    const TDesC& aName,
+    TInt aDriveId,
+    CMPXMessageArray* aItemChangedMessages,
+    TBool& aItemExist,
+    const TDesC& aUri,
+    const TDesC& aAlbumArtist
+    )
+    {
+    MPX_FUNC("CMPXDbHandler::AddAbstractAlbumItemL()");
+
+    MPX_PERF_START(CMPXDbHandler_AddAbstractAlbumItemL);
+    
+    TBool newRecord(EFalse);
+    TUint32 id(0);
+
+    //AbstractAlbum is not case sensitive
+    id =  iDbAbstractAlbum->AddItemL(aUri, aName, aAlbumArtist, aDriveId, newRecord, EFalse);
+    MPX_PERF_END(CMPXDbHandler_AddAbstractAlbumItemL);
+    
+    return id;
+    }
+#endif
+
+// ----------------------------------------------------------------------------
 // CMPXDbHandler::AddCategoryItemL
 // ----------------------------------------------------------------------------
 //
 TUint32 CMPXDbHandler::AddCategoryItemL(
     TMPXGeneralCategory aCategory,
-    const TDesC& aName,
+    const CMPXMedia& aMedia,
     TInt aDriveId,
     CMPXMessageArray* aItemChangedMessages,
-    TBool& aItemExist
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED
-    ,const TDesC& aUri
-    ,const TDesC& aAlbumArtist
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
-    )
+    TBool& aItemExist)
     {
     MPX_FUNC("CMPXDbHandler::AddCategoryItemL()");
-
+    
     MPX_PERF_START(CMPXDbHandler_AddCategoryItemL);
 
+    ASSERT(aCategory != EMPXAbstractAlbum);
+	
     TBool newRecord(EFalse);
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED
-    TUint32 id(0);
-    //for AbstractAlbum, SetAbstractAlbum, associate songs with abstractalbum.
-    //only called with newRecord as EFalse
-    //increment songCount if id exist in AbstractAlbum table, otherwise do nothing.
-
-    //only Genre, AbstractAlbum are not case sensitive
-    TBool caseSensitive = ETrue;
-    if ((aCategory == EMPXGenre) || (aCategory == EMPXAbstractAlbum))
-        caseSensitive = EFalse;
-
-    if (aCategory == EMPXAbstractAlbum)
-        {
-        id =  iDbAbstractAlbum->AddItemL(aUri, aName, aAlbumArtist, aDriveId, newRecord, caseSensitive);
-        }
-    else
-        {
-        id = DbCategoryL(aCategory)->AddItemL(aName, aDriveId, newRecord, caseSensitive);
-#else
-    TUint32 id(DbCategoryL(aCategory)->AddItemL(aName, aDriveId, newRecord, (aCategory != EMPXGenre)));
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
+
+    TUint32 id = DbCategoryL(aCategory)->AddItemL(aCategory, aMedia, aDriveId, newRecord, aCategory != EMPXGenre);
 
     if (newRecord && aItemChangedMessages)
         {
         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemInserted,
             aCategory, KDBPluginUid);
         }
-    // when the added item's category is Genre or Composer,
-    // and it is NOT a new record,
+    // when the added item's category is Genre, Composer or Artist, and it is NOT a new record,
     // we should send the item number changed message
-    else if ( ( aCategory == EMPXGenre || aCategory == EMPXComposer ) &&
-            !newRecord && aItemChangedMessages )
-        {
-        MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemModified,
-            aCategory, KDBPluginUid);
-        }
-    aItemExist = !newRecord;
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED      
-       }
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
-    MPX_PERF_END(CMPXDbHandler_AddCategoryItemL);
-    return id;
-    }
-
-TUint32 CMPXDbHandler::AddCategoryItemL(
-        TMPXGeneralCategory aCategory,
-        const TDesC& aName,
-        const TDesC& aArtistName,
-        const TDesC& aArt,
-        TInt aDriveId,
-        CMPXMessageArray* aItemChangedMessages,
-        TBool& aItemExist)
-	{
-    MPX_FUNC("CMPXDbHandler::AddCategoryItemL()");
-
-    MPX_PERF_START(CMPXDbHandler_AddCategoryItemL);
-
-    TBool newRecord(EFalse);
-
-    TUint32 id = 0;
-    if(aCategory == EMPXAlbum)
-        {
-        id = iDbAlbum->AddItemL(aName, aArtistName, aArt, aDriveId, newRecord, (aCategory != EMPXGenre));
-        }
-    else
-        {
-        id = iDbArtist->AddItemL(aName, aArt, aDriveId, newRecord, (aCategory != EMPXGenre));
-        }
-
-    if (newRecord && aItemChangedMessages)
-        {
-        MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemInserted,
-            aCategory, KDBPluginUid);
-        }
-    // when the added item's category is Artist, and it is NOT a new record,
-    // we should send the item number changed message
-    else if (  aCategory == EMPXArtist &&
+    else if ( ( aCategory == EMPXGenre || aCategory == EMPXComposer || aCategory == EMPXArtist) &&
             !newRecord && aItemChangedMessages )
         {
         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemModified,
@@ -3154,31 +3123,23 @@
     aItemExist = !newRecord;
     MPX_PERF_END(CMPXDbHandler_AddCategoryItemL);
 
-    return id;
+    return id;    
     }
 
+// ----------------------------------------------------------------------------
+// CMPXDbHandler::UpdateCategoryItemL
+// ----------------------------------------------------------------------------
+//
 void CMPXDbHandler::UpdateCategoryItemL(
-        TMPXGeneralCategory aCategory,
-        TUint32 aCategoryId,
-        const CMPXMedia& aMedia,
-        TInt aDrive,
-        CMPXMessageArray* aItemChangedMessages)
+    TMPXGeneralCategory aCategory,
+    TUint32 aCategoryId,
+    const CMPXMedia& aMedia,
+    TInt aDrive,
+    CMPXMessageArray* aItemChangedMessages)
     {
-    switch(aCategory)
-        {
-        case EMPXAlbum:
-            iDbAlbum->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
-            break;
-
-        case EMPXArtist:
-            iDbArtist->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
-            break;
-
-        default:
-            DbCategoryL(aCategory)->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
-            break;
-        }
+    DbCategoryL(aCategory)->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
     }
+
 // ----------------------------------------------------------------------------
 // CMPXDbHandler::DeleteSongForCategoryL
 // ----------------------------------------------------------------------------
@@ -3188,11 +3149,21 @@
     TUint32 aCategoryId,
     TInt aDriveId,
     CMPXMessageArray* aItemChangedMessages,
-    TBool& aItemExist)
+    TBool& aItemExist,
+    const TDesC& aArt   
+    )
     {
     MPX_FUNC("CMPXDbHandler::DeleteSongForCategoryL");
-    DbCategoryL(aCategory)->DecrementSongsForCategoryL(aCategoryId, aDriveId,
-        aItemChangedMessages, aItemExist);
+    switch(aCategory)
+        {
+        case EMPXAlbum:
+            iDbAlbum->DecrementSongsForAlbumL(aCategoryId, aDriveId, aItemChangedMessages, aItemExist, aArt);
+            break;
+        default:
+            DbCategoryL(aCategory)->DecrementSongsForCategoryL(aCategoryId, aDriveId,
+                    aItemChangedMessages, aItemExist);
+            break;
+        }
     }
 
 // ----------------------------------------------------------------------------
@@ -3233,7 +3204,6 @@
         SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, plId);
     }
 
-
 // ---------------------------------------------------------------------------
 // CMPXDbHandler::IsRemoteDrive
 // ---------------------------------------------------------------------------
@@ -3279,28 +3249,6 @@
     CleanupStack::PopAndDestroy(&attributes);        
     }
 
-TInt CMPXDbHandler::HandleGetAlbumsCountForArtistL(TUint32 aArtistId)
-    {
-    return iDbAlbum->GetAlbumsCountForArtistL(aArtistId);
-    }
-
-TBool CMPXDbHandler::HandleIsUnknownArtistL(TUint32 aArtistId)
-    {
-    return iDbArtist->IsUnknownArtistL(aArtistId);
-    }
-
-// ---------------------------------------------------------------------------
-// CMPXDbHandler::HandleArtistForAlbumL
-// ---------------------------------------------------------------------------
-//
-HBufC* CMPXDbHandler::HandleArtistForAlbumL(const TUint32 aAlbumId)
-    {
-
-    TUint32 artistId = iDbMusic->ArtistForAlbumL(aAlbumId);
-    HBufC* artistname = GetNameMatchingIdL(artistId);
-    return artistname;
-    }
-
 // ---------------------------------------------------------------------------
 // CMPXDbHandler::HandleAlbumartForAlbumL
 // ---------------------------------------------------------------------------
@@ -3309,6 +3257,7 @@
     {
     return iDbMusic->AlbumartForAlbumL(aAlbumId, aArt);
     }
+
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED   
 // ----------------------------------------------------------------------------------------------------------
 // CMPXDbHandler::HandleGetAlbumNameForSongL
@@ -3319,4 +3268,43 @@
     return iDbAbstractAlbum->GetUriL(aId);
     }
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
+
+// ----------------------------------------------------------------------------
+// CMPXDbHandler::DeleteAlbumForArtistL
+// ----------------------------------------------------------------------------
+//
+void CMPXDbHandler::DeleteAlbumForArtistL(TUint32 aCategoryId,
+    TInt aDrive, CMPXMessageArray* aItemChangedMessages)
+    {
+    MPX_FUNC("CMPXDbHandler::DeleteAlbumForArtistL");
+    iDbArtist->DecrementAlbumsForArtistL(aCategoryId, aDrive, aItemChangedMessages);
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbHandler::AddAlbumArtistL
+// ----------------------------------------------------------------------------
+//
+TUint32 CMPXDbHandler::AddAlbumArtistL(const TDesC& aName, const TDesC& aArt, TInt aDriveId)
+    {
+    MPX_FUNC("CMPXDbHandler::AddAlbumArtistL");
+    return iDbArtist->AddAlbumArtistL(aName, aArt, aDriveId);
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbHandler::GenerateUniqueIdForAlbumL
+// ----------------------------------------------------------------------------
+//
+TUint32 CMPXDbHandler::GenerateUniqueIdForAlbumL(const CMPXMedia& aMedia)
+    {
+    return iDbAlbum->GenerateUniqueIdL(aMedia);
+    }
+
+// ----------------------------------------------------------------------------
+// CMPXDbHandler::IsUnknownAlbumL
+// ----------------------------------------------------------------------------
+//
+TBool CMPXDbHandler::IsUnknownAlbumL(const TUint32 aId)
+    {
+    return iDbAlbum->IsUnknownAlbumL(aId);
+    }
 // End of file
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -42,12 +42,6 @@
 
 // CONSTANTS
 
-// This is what KNullDesC album computes to for the hash
-// to-do: generate this Id through
-//        MPXDbUtil::GenerateUniqueIdL(EMPXAlbum, KNullDesC, EFalse)
-//        instead of hard-coding the number so if GenerateUniqueIdL
-//        is modified, this constant doesn't need to be redefined
-const TInt KUnknownAlbumID = 1770790356;
 // UniqueID column in Uris requests
 const TInt KColUniqueID = 0;
 // URI column in Uris requests
@@ -254,22 +248,25 @@
             User::Leave(KErrNotFound);
             }
 
+#ifdef ABSTRACTAUDIOALBUM_INCLUDED        
+        iArtNeedUpdated = ETrue;    // reset flag
+#endif
         TDriveUnit driveUnit(MPXDbCommonUtil::GetDriveIdMatchVolIdL(iDbManager.Fs(),
           recordset.ColumnInt64(EMusicVolumeId)));
         visible = DoUpdateSongL(aSongId, aMedia, driveUnit, aItemChangedMessages,
           recordset);
-
+        
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
         if(iArtNeedUpdated)
             {
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
 	        // Update Album table
-	        if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) || aMedia.IsSupported(KMPXMediaMusicArtist))
+            if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName))
 	            {
 	            TUint32 albumId = recordset.ColumnInt64(EMusicAlbum);
 	            iObserver.UpdateCategoryItemL(EMPXAlbum, albumId, aMedia, driveUnit, aItemChangedMessages);
 	            }
-
+            
 	        // Update Artist table
 	        if ( aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) )
 	            {
@@ -278,7 +275,6 @@
 	            }
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
             }
-        iArtNeedUpdated = ETrue;  //reset flag
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
         CleanupStack::PopAndDestroy(&recordset);
         }
@@ -685,22 +681,18 @@
     {
     MPX_FUNC("CMPXDbMusic::GetAllSongsLimitedL");
 
-	// Reset and create a cache for the query results.
+	// Reset the previous query results. This will cause creation of query result
+	// cache during actual incremental open stage (i.e. GetSongsAtOffsetL).
 	if (iAllSongsQueryResult.Count())
 		{
         iAllSongsQueryResult.ResetAndDestroy();
 		}
 
-	ExecuteQueryAllSongsL(aAttrs);
-
-    TInt limit = aLimit > iAllSongsQueryResult.Count() ?
-    	iAllSongsQueryResult.Count() : aLimit;
-
-	for ( TInt i=0; i < limit; i++ )
-		{
-        CMPXMedia* m = iAllSongsQueryResult[i];
-		aMediaArray.AppendL(*m);
-		}
+    // Gets a subset of the data from all songs ordered by title
+    HBufC* query = HBufC::NewLC( KQueryMusicGetAllSongsMinimumLimited().Length() + KMCIntegerLen );
+    query->Des().Format( KQueryMusicGetAllSongsMinimumLimited, aLimit );
+    ExecuteMediaQueryL(aAttrs, aMediaArray, *query);
+    CleanupStack::PopAndDestroy( query );
     }
 
 // ----------------------------------------------------------------------------
@@ -712,7 +704,7 @@
     // Run query and add result media objects to the cache array.
     MPX_FUNC("CMPXDbMusic::ExecuteQueryAllSongsL");
 
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetAllSongsMinimum));
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetAllSongsMinimum()));
     CleanupClosePushL(recordset);
 
     TInt err(KErrNone);
@@ -732,6 +724,7 @@
         }
     }
 
+
 // ----------------------------------------------------------------------------
 // CMPXDbMusic::GetSongsInBlockL
 // ----------------------------------------------------------------------------
@@ -812,7 +805,7 @@
     MPX_FUNC("CMPXDbMusic::GetSongsForAlbumL");
 
     TPtrC query;
-    if (aAlbumId == KUnknownAlbumID)
+    if (iObserver.IsUnknownAlbumL(aAlbumId))
         {
         query.Set(ExtraFieldsRequired(aAttrs) ? KQueryMusicGetSongsForUnknownAlbum() :
             KQueryMusicGetSongsForUnknownAlbumNoCategories());
@@ -993,7 +986,9 @@
     TMPXGeneralType aType,
     const CMPXMedia& aCriteria,
     const TArray<TMPXAttribute>& aAttrs,
-    CMPXMediaArray& aMediaArray)
+    CMPXMediaArray& aMediaArray,
+    TBool aSortByTrackOrder   
+    )
     {
     MPX_FUNC("CMPXDbMusic::FindSongsL");
 
@@ -1001,12 +996,8 @@
     HBufC* criteriaStr = GenerateMusicMatchingCriteriaLC(aGeneralId, aContainerId, aType,
         aCriteria);
 
-    // construct the sort order depending on category. Albums are always sorted by track,
-    // then name, except for unknown album. Songs are sorted by name for unknown album.
-    // NULL track number is stored as KMaxTInt so that they will be sorted to the end
-    TPtrC sortOrder;
-    if ((aType == EMPXGroup) && (MPX_ITEM_CATEGORY(aGeneralId) == EMPXAlbum) &&
-        (aGeneralId != MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), EMPXAlbum, KNullDesC, EFalse)))
+    TPtrC sortOrder;  
+    if (aSortByTrackOrder)
         {
         sortOrder.Set(KQueryMusicFindAllSortOrderTrack);
         }
@@ -1014,7 +1005,7 @@
         {
         sortOrder.Set(KQueryMusicFindAllSortOrderTitle);
         }
-
+        
     // construct the query
     HBufC* query = HBufC::NewLC(KQueryMusicFindAll().Length() + criteriaStr->Length() +
         sortOrder.Length());
@@ -1099,37 +1090,19 @@
     }
 
 // ----------------------------------------------------------------------------
-// CMPXDbMusic::ArtistForAlbumL
-// ----------------------------------------------------------------------------
-//
-TUint32 CMPXDbMusic::ArtistForAlbumL(const TUint32 aId)
-    {
-    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetArtistForAlbum, aId));
-
-    CleanupClosePushL(recordset);
-    if (recordset.Next() != KSqlAtRow)
-        {
-        User::Leave(KErrNotFound);
-        }
-
-    TUint32 artistId = recordset.ColumnInt64(KMPXTableDefaultIndex);
-    CleanupStack::PopAndDestroy(&recordset);
-
-    return artistId;
-    }
-
-// ----------------------------------------------------------------------------
 // CMPXDbMusic::AlbumartForAlbumL
 // ----------------------------------------------------------------------------
 //
 HBufC* CMPXDbMusic::AlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt)
     {
-    MPX_FUNC("CMPXDbMusic::AlbumartForAlbumL");
+	MPX_FUNC("CMPXDbMusic::AlbumartForAlbumL");
+	
     RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetAlbumartForAlbum, aAlbumId));
     HBufC* albumart(NULL);
    
     CleanupClosePushL(recordset);
-    while ( recordset.Next() == KSqlAtRow )
+    TInt err(KErrNone);
+    while ((err = recordset.Next()) == KSqlAtRow)
         {     
         TPtrC art(MPXDbCommonUtil::GetColumnTextL(recordset, KMPXTableDefaultIndex));		
         if (art.Length()>0 && art.Compare(KNullDesC)!=0 &&  art.CompareF(aArt)!=0 )
@@ -2122,6 +2095,8 @@
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
     TUint32 abstractAlbumId(0);
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
+    //need to get song art for updating art field in Album and Artist tables
+    TPtrC art(KNullDesC);
     if (aMusicTable)
         {
         artistId = aMusicTable->ColumnInt64(EMusicArtist);
@@ -2131,21 +2106,23 @@
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
         abstractAlbumId = aMusicTable->ColumnInt64(EMusicAbstractAlbum);
 #endif // ABSTRACTAUDIOALBUM_INCLUDED        
+        art.Set(MPXDbCommonUtil::GetColumnTextL(*aMusicTable, EMusicArt));
         }
 
     // update the artist field
     TUint32 id(0);
     if (UpdateCategoryFieldL(EMPXArtist, aMedia, KMPXMediaMusicArtist, artistId,
-        aDrive, aItemChangedMessages, id))
+        aDrive, aItemChangedMessages, id, art))
         {
         MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicArtist, id);
         metaDataModified = (aMusicTable != NULL);
         visibleChange = CMPXDbActiveTask::EAllVisible;
+        iArtNeedUpdated = EFalse;
         }
 
     // update the album field
     if (UpdateCategoryFieldL(EMPXAlbum, aMedia, KMPXMediaMusicAlbum, albumId,
-        aDrive, aItemChangedMessages, id))
+        aDrive, aItemChangedMessages, id, art))
         {
         MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicAlbum, id);
         metaDataModified = (aMusicTable != NULL);
@@ -2166,6 +2143,7 @@
             MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, albumId,
                     EMPXItemInserted, EMPXAlbum, KDBPluginUid);
             }
+        iArtNeedUpdated = EFalse;
         }
 
     // update the genre field
@@ -2472,8 +2450,17 @@
     TUint32 aOldId,
     TInt aDriveId,
     CMPXMessageArray* aItemChangedMessages,
-    TUint32& aItemId)
+    TUint32& aItemId, 
+    const TDesC& aArt)
     {
+    MPX_FUNC("CMPXDbMusic::UpdateCategoryFieldL");
+    
+	if (aCategory == EMPXAlbum)
+	    {
+	    return UpdateCategoryFieldForAlbumL(aMedia, aAttribute, aOldId, 
+	        aDriveId, aItemChangedMessages, aItemId, aArt);
+	    }
+	
     TBool updated(EFalse);
     TBool itemNotRemoved( EFalse );
     TBool itemAdded( EFalse );
@@ -2500,7 +2487,6 @@
                       
             aItemId = MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), aCategory,
                 name, caseSensitive);
-
 #else
             // only genre is not case sensitive
             aItemId = MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), aCategory,
@@ -2515,8 +2501,8 @@
                     {
                     if (aMedia.ValueTObjectL<TMPXGeneralCategory>(KMPXMediaGeneralCategory) == EMPXSong )
                         {
-                        iObserver.AddCategoryItemL(aCategory, KNullDesC, aDriveId,
-                          aItemChangedMessages, itemAdded, name, KNullDesC);                
+                        iObserver.AddAbstractAlbumItemL(KNullDesC, aDriveId,
+                            aItemChangedMessages, itemAdded, name, KNullDesC);                
                         }
                     else
                         {     
@@ -2527,42 +2513,40 @@
                             albumartist.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtist).Left(KMCMaxTextLen));
                             //get AlbumArt AbstractAlbum
                             MPX_DEBUG2("     albumartist[%S]", &albumartist);
-                             }
+                            }
                         if (aMedia.IsSupported(KMPXMediaGeneralTitle) )
-                          {                         
-                          abstractAlbumName.Set(aMedia.ValueText(KMPXMediaGeneralTitle).Left(KMCMaxTextLen));
-                          MPX_DEBUG2("     abstractAlbumName[%S]", &abstractAlbumName);
-                          }                                                     
-                      // ignore the return value 
-                      
-                      iObserver.AddCategoryItemL(aCategory, abstractAlbumName, aDriveId,
-                          aItemChangedMessages, itemAdded, name, albumartist);       
+                            {                         
+                            abstractAlbumName.Set(aMedia.ValueText(KMPXMediaGeneralTitle).Left(KMCMaxTextLen));
+                            MPX_DEBUG2("     abstractAlbumName[%S]", &abstractAlbumName);
+                            }
+                        
+                        // ignore the return value                       
+                        iObserver.AddAbstractAlbumItemL(abstractAlbumName, aDriveId,
+                            aItemChangedMessages, itemAdded, name, albumartist);       
                         }
                     }
                 else
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
-                    if (aCategory == EMPXArtist || aCategory == EMPXAlbum)
+                if (aCategory == EMPXArtist)
                     {
-                    TPtrC art(KNullDesC);
-                    TPtrC artistname(KNullDesC);
-
-                    if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName))
+                    //for the update case, need to maintain art field for Artist/Album table.
+                    if (aOldId && (aOldId != aItemId))
                         {
-                        art.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen));
+                        CMPXMedia* media = CMPXMedia::NewL(aMedia);
+                        CleanupStack::PushL(media);
+                        media->SetTextValueL(KMPXMediaMusicAlbumArtFileName, aArt);                        
+                        iObserver.AddCategoryItemL(aCategory, *media, aDriveId, aItemChangedMessages, itemAdded);                        
+                        CleanupStack::PopAndDestroy(media);
+                        } 
+                    else
+                        {      
+                        iObserver.AddCategoryItemL(aCategory, aMedia, aDriveId, aItemChangedMessages, itemAdded);
                         }
-                    if (aCategory == EMPXAlbum)
-                        {
-                        if (aMedia.IsSupported(KMPXMediaMusicArtist))
-                            {
-                            artistname.Set(aMedia.ValueText(KMPXMediaMusicArtist).Left(KMCMaxTextLen));
-                            }
-                        }
-                    iObserver.AddCategoryItemL(aCategory, name, artistname, art, aDriveId, aItemChangedMessages, itemAdded);
                     }
                 else
                     {
                     // ignore the return value
-                    iObserver.AddCategoryItemL(aCategory, name, aDriveId,
+                    iObserver.AddCategoryItemL(aCategory, aMedia, aDriveId,
                         aItemChangedMessages, itemAdded);
                     }
                 updated = ETrue;
@@ -2590,37 +2574,18 @@
                     TPtrC abstractAlbumName(aMedia.ValueText(KMPXMediaGeneralTitle).Left(KMCMaxTextLen));
                     MPX_DEBUG2("    Music abstractAlbumName[%S]", &abstractAlbumName);     
                     // ignore the return value
-                    iObserver.AddCategoryItemL(aCategory, abstractAlbumName, aDriveId,
-                       aItemChangedMessages, itemAdded, KNullDesC, albumartist);     
+                    iObserver.AddAbstractAlbumItemL(abstractAlbumName, aDriveId,
+                        aItemChangedMessages, itemAdded, KNullDesC, albumartist);     
                     }            
                else
 #endif // ABSTRACTAUDIOALBUM_INCLUDED        
-                    if (aCategory == EMPXArtist || aCategory == EMPXAlbum)
-                   {
-                   TPtrC art(KNullDesC);
-                   TPtrC artistname(KNullDesC);
-                   if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName))
-                       {
-                       art.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen));
-                        }
-                   if (aCategory == EMPXAlbum)
-                       {
-                       if (aMedia.IsSupported(KMPXMediaMusicArtist))
-                           {
-                           artistname.Set(aMedia.ValueText(KMPXMediaMusicArtist).Left(KMCMaxTextLen));
-                           }
-                       }
-                   iObserver.AddCategoryItemL(aCategory, KNullDesC, artistname, art, aDriveId,
-                        aItemChangedMessages, itemAdded);
-                   }
-               else
                    {
                    // ignore the return value
-                      iObserver.AddCategoryItemL(aCategory, KNullDesC, aDriveId,
-                            aItemChangedMessages, itemAdded);
-                      }
-                 updated = ETrue;
-                 }
+                   iObserver.AddCategoryItemL(aCategory, aMedia, aDriveId,
+                       aItemChangedMessages, itemAdded);
+                   }
+               updated = ETrue;
+               }
             }
 
         if (aOldId && (aOldId != aItemId))
@@ -2686,7 +2651,6 @@
     return updated;
     }
 
-
 // ----------------------------------------------------------------------------
 // CMPXDbMusic::ExtraFieldsRequired
 // ----------------------------------------------------------------------------
@@ -2767,4 +2731,120 @@
         ;
     }
 
+// ----------------------------------------------------------------------------
+// CMPXDbMusic::UpdateCategoryFieldForAlbumL
+// ----------------------------------------------------------------------------
+//
+TBool CMPXDbMusic::UpdateCategoryFieldForAlbumL(
+    const CMPXMedia& aMedia,
+    const TMPXAttribute& aAttribute,
+    TUint32 aOldId,
+    TInt aDriveId,
+    CMPXMessageArray* aItemChangedMessages,
+    TUint32& aItemId, 
+    const TDesC& aArt)
+    {
+    MPX_FUNC("CMPXDbMusic::UpdateCategoryFieldForAlbumL");
+
+    TBool updated(EFalse);
+    TBool itemNotRemoved( EFalse );
+    TBool itemAdded( EFalse );
+
+    // update category table and add category Id to the music table
+    if (!aOldId || aMedia.IsSupported(aAttribute))
+        {
+        TInt changeMsgCount( 0 );
+        if( aItemChangedMessages )
+            {
+            changeMsgCount = aItemChangedMessages->Count();
+            }
+            
+        // construct the new ID for the category record
+        aItemId = iObserver.GenerateUniqueIdForAlbumL(aMedia);
+            
+        if (!aOldId || (aOldId != aItemId))
+            {
+            // only add if the ID changed,
+            // otherwise the song was updated but the artist name was not
+
+            //for the update case, need to maitain art field for Artist/Album table.
+            if (aOldId && (aOldId != aItemId))
+                {
+                CMPXMedia* media = CMPXMedia::NewL(aMedia);
+                CleanupStack::PushL(media);
+                media->SetTextValueL(KMPXMediaMusicAlbumArtFileName, aArt);
+                
+                iObserver.AddCategoryItemL(EMPXAlbum, *media, aDriveId, aItemChangedMessages, itemAdded);
+                CleanupStack::PopAndDestroy(media);
+                }  
+            else // !aOldId
+                {
+                iObserver.AddCategoryItemL(EMPXAlbum, aMedia, aDriveId, aItemChangedMessages, itemAdded);
+                }                
+            updated = ETrue;
+            }
+
+        if (aOldId && (aOldId != aItemId))
+            {
+            iObserver.DeleteSongForCategoryL(EMPXAlbum, aOldId, aDriveId, 
+                aItemChangedMessages, itemNotRemoved, aArt);
+            updated = ETrue;
+            }
+
+        // Special case where the item(s) has been renamed.
+        // In this case, a new category is created +1 change msg
+        //               a old category is removed +1 change msg
+        // We merge these 2 change messages into one using the deprecated ID
+        //
+        if( aItemChangedMessages )
+            {
+            TInt newChangeMsgCount( aItemChangedMessages->Count() );
+            if(  newChangeMsgCount - changeMsgCount > 0 )
+                {
+                TInt oldId = KErrNotFound;
+                TInt newId = KErrNotFound;
+                for( TInt i=0; i<newChangeMsgCount; ++i )
+                    {
+                    CMPXMessage& msg = *(*aItemChangedMessages)[i];
+
+                    TMPXItemId id = msg.ValueTObjectL<TMPXItemId>(KMPXMessageMediaGeneralId);
+                    TMPXChangeEventType changeType = msg.ValueTObjectL<TMPXChangeEventType>(KMPXMessageChangeEventType);
+
+                    // Look for the added and deleted category IDs
+                    //
+                    if( id == aOldId && changeType == EMPXItemDeleted )
+                        {
+                        oldId = i;
+                        }
+                    else if( id == aItemId && changeType == EMPXItemInserted )
+                        {
+                        newId = i;
+                        }
+                    }// for
+
+                if( oldId != KErrNotFound &&
+                    newId != KErrNotFound )
+                    {
+                    aItemChangedMessages->Remove(oldId);  // category removed
+                    aItemChangedMessages->Remove(newId);  // category added
+                    MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aItemId, EMPXItemModified,
+                                                            EMPXAlbum, KDBPluginUid, aOldId );
+                    }
+                else if ( oldId !=KErrNotFound && itemAdded ) // old item removed, new item already exist
+                    {
+                    MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aItemId, EMPXItemModified,
+                                                            EMPXAlbum, KDBPluginUid, aOldId );
+                    }
+                else if ( newId !=KErrNotFound && itemNotRemoved ) // new item added, old item still exist
+                    {
+                    MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aOldId, EMPXItemModified,
+                                                            EMPXAlbum, KDBPluginUid, aItemId );
+                    }
+                }
+            }// aItemChangedMessages
+        }// if (!aOldId || aMedia.IsSupported(aAttribute))
+
+    return updated;
+    }
+
 // End of File
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -59,7 +59,7 @@
 #include "mpxdbplugin.h"
 
 // CONSTANTS
-const TInt KFirstFetchCount = 400;
+const TInt KFirstFetchCount = 100;
 
 const TUid KCRUIDMusicPlayerFeatures = { 0x101FFCD0 };
 const TInt KMusicPlayerFeatures = 1;
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainer.h	Tue Aug 24 03:36:14 2010 -0500
@@ -30,6 +30,7 @@
 class HbDocumentLoader;
 class MpCollectionDataModel;
 class MpMpxCollectionData;
+class HbGroupBox;
 
 class MpCollectionContainer : public HbWidget
 {
@@ -62,6 +63,7 @@
 
 protected:
 
+    HbGroupBox              *mInfoBar;
     HbDocumentLoader        *mDocumentLoader;   // Not own
     MpCollectionDataModel   *mDataModel;        // Not own
     MpMpxCollectionData     *mCollectionData;   // Not own
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontaineralbums.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontaineralbums.h	Tue Aug 24 03:36:14 2010 -0500
@@ -20,7 +20,6 @@
 
 #include "mpcollectionlistcontainer.h"
 
-class HbGroupBox;
 class HgMediawall;
 class MpCollectionTBoneListDataModel;
 
@@ -49,8 +48,7 @@
     void setupContainer();
 
 private:
-
-    HbGroupBox                      *mInfoBar;          // Own
+    
 	HgMediawall                     *mTBone;            // Own
     MpCollectionTBoneListDataModel  *mTBoneListModel;   // Own
     int                             mCurrentAlbumIndex;
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerallsongs.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerallsongs.h	Tue Aug 24 03:36:14 2010 -0500
@@ -20,8 +20,6 @@
 
 #include "mpcollectionlistcontainer.h"
 
-class HbGroupBox;
-
 class MpCollectionContainerAllSongs : public MpCollectionListContainer
 {
     Q_OBJECT
@@ -39,10 +37,6 @@
 
     void setupContainer();
 
-private:
-
-    HbGroupBox     *mInfoBar;   // Own
-
 };
 
 #endif  // MPCOLLECTIONCONTAINERALLSONGS_H
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerartists.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerartists.h	Tue Aug 24 03:36:14 2010 -0500
@@ -20,7 +20,6 @@
 
 #include "mpcollectionlistcontainer.h"
 
-class HbGroupBox;
 class HgMediawall;
 class MpCollectionTBoneListDataModel;
 
@@ -49,8 +48,7 @@
     void setupContainer();
 
 private:
-
-    HbGroupBox                      *mInfoBar;          // Own
+    
     HgMediawall                     *mTBone;            // Own
     MpCollectionTBoneListDataModel  *mTBoneListModel;   // Own
     int                             mCurrentArtistIndex;
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerplaylists.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectioncontainerplaylists.h	Tue Aug 24 03:36:14 2010 -0500
@@ -20,7 +20,6 @@
 
 #include "mpcollectionlistcontainer.h"
 
-class HbGroupBox;
 
 class MpCollectionContainerPlaylists : public MpCollectionListContainer
 {
@@ -43,8 +42,6 @@
     void setupContainer();
 
 private:
-
-    HbGroupBox      *mInfoBar;              // Own
     int             mCurrentPlaylistIndex;
     
 };
--- a/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/inc/mpcollectionview.h	Tue Aug 24 03:36:14 2010 -0500
@@ -52,7 +52,6 @@
     void initializeView();
     void activateView();
     void deactivateView();
-    void setDefaultView();
     bool isActivated();    
     void openItem( int index );
     void showItemDetails( int index );
@@ -122,6 +121,7 @@
     int generateShuffleIndex();
     void startContainerTransition( TCollectionContext contextFrom, TCollectionContext contextTo );
     void closeActiveDialog( bool onlyContextMenu = false );
+    void showCorruptedNote();
 
 private:
 
--- a/mpviewplugins/mpcollectionviewplugin/resources/musiccollection.docml	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/resources/musiccollection.docml	Tue Aug 24 03:36:14 2010 -0500
@@ -1,14 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <hbdocument version="0.9">
     <widget name="mainContainer" type="HbWidget">
+        <widget name="infoBar" type="HbGroupBox">
+            <sizehint type="PREFERRED" height="0.0" width="var(hb-param-screen-width)"/>
+        </widget>
         <widget name="nowPlaying" type="MpNowPlayingWidget">
-            <sizehint type="MAXIMUM" height="0.0" />
+            <sizehint type="PREFERRED" height="0.0" width="var(hb-param-screen-width)"/>
         </widget>
         <widget name="container" type="HbWidget">
             <sizehint height="expr(var(hb-param-screen-height) - var(hb-param-widget-chrome-height) - var(hb-param-widget-toolbar-height))" type="PREFERRED" width="var(hb-param-screen-width)"/>
         </widget>
         <layout orientation="Vertical" spacing="0un" type="linear">
             <contentsmargins bottom="0.0un" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0un"/>
+            <linearitem itemname="infoBar" spacing="0.0un" />
             <linearitem itemname="container" spacing="0.0un"/>
             <linearitem itemname="nowPlaying" spacing="0.0un"/>
         </layout>
@@ -16,32 +20,39 @@
 
     <section name="showBanner">
         <widget name="nowPlaying">
-            <sizehint type="MAXIMUM" height="expr(2*var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary))" />
-            <sizehint type="MINIMUM" height="expr(2*var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary))" />
-            <sizehint type="PREFERRED" height="expr(2*var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary))" />            
+            <sizehint type="PREFERRED" height="expr(2*var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary))" />
+            <bool name="visible" value="TRUE" />  
         </widget>
     </section>
     
     <section name="hideBanner">
         <widget name="nowPlaying">
-            <sizehint type="MAXIMUM" height="0.0" />
-            <sizehint type="MINIMUM" height="0.0" />
-            <sizehint type="PREFERRED" height="0.0" />        
+            <sizehint type="PREFERRED" height="0.0" />
+            <bool name="visible" value="FALSE" />          
+        </widget>
+    </section>
+    
+    <section name="showInfoBar">
+    	<widget name="infoBar">
+    		<sizehint type="PREFERRED" height="expr(2*var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-primary))" />
+    		<bool name="visible" value="TRUE"/>
+    	</widget>
+    </section>
+    
+   <section name="hideInfoBar">
+        <widget name="infoBar">
+            <sizehint type="PREFERRED" height="0.0" />
+            <bool name="visible" value="FALSE" />        
         </widget>
     </section>
     
     <section name="allSongs">
         <widget name="container">
-            <widget name="allSongsDetail" type="HbGroupBox">
-                <bool name="collapsable" value="FALSE"/>
-                <real name="z" value="1.0"/>
-            </widget>
             <widget name="allSongsList" type="HbListView">
                 <sizehint height="expr(var(hb-param-screen-height) - var(hb-param-widget-chrome-height) - var(hb-param-widget-toolbar-height))" type="PREFERRED" width="var(hb-param-screen-width)"/>
             </widget>
             <layout orientation="Vertical" spacing="0un" type="linear">
                 <contentsmargins bottom="0.0" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0"/>
-                <linearitem itemname="allSongsDetail" spacing="0.0"/>
                 <linearitem itemname="allSongsList" spacing="0.0"/>
             </layout>
         </widget>
@@ -61,13 +72,8 @@
 
     <section name="artistAlbums">
         <widget name="container">
-            <widget name="artistDetail" type="HbGroupBox">
-                <bool name="collapsable" value="FALSE"/>
-                <real name="z" value="1.0"/>
-            </widget>
             <layout orientation="Vertical" spacing="0un" type="linear">
                 <contentsmargins bottom="0.0" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0"/>
-                <linearitem itemname="artistDetail" spacing="0.0"/>
                 <linearitem itemname="artistsList" spacing="0.0"/>
             </layout>
         </widget>
@@ -91,10 +97,6 @@
     
     <section name="artistAlbumTBoneFetcher">
         <widget name="container">
-            <widget name="artistDetail" type="HbGroupBox">
-                <bool name="collapsable" value="FALSE"/>
-                <real name="z" value="1.0"/>
-            </widget>
             <widget name="artistAlbumWall" type="HgMediawall">
                 <sizehint height="expr(var(hb-param-margin-gene-screen) + 24.5un + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary) + (2*var(hb-param-margin-gene-middle-vertical)) + 1.5un)" type="MAXIMUM" width="var(hb-param-screen-width)"/>
                 <sizehint height="expr(var(hb-param-margin-gene-screen) + 24.5un + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary) + (2*var(hb-param-margin-gene-middle-vertical)) + 1.5un)" type="PREFERRED" width="var(hb-param-screen-width)"/>
@@ -103,7 +105,6 @@
             </widget>
             <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
                 <contentsmargins bottom="0.0" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0"/>
-                <linearitem itemname="artistDetail" spacing="0.0"/>
                 <linearitem itemname="artistAlbumWall"/>
                 <linearitem itemname="artistsList"/>
             </layout>
@@ -140,10 +141,6 @@
     
     <section name="albumTBoneFetcher">
         <widget name="container">
-            <widget name="albumTBoneDetail" type="HbGroupBox">
-                <bool name="collapsable" value="FALSE"/>
-                <real name="z" value="1.0"/>
-            </widget>
             <widget name="albumWall" type="HgMediawall">
                 <sizehint height="expr(var(hb-param-margin-gene-screen) + 24.5un + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary) + (2*var(hb-param-margin-gene-middle-vertical)) + 1.5un)" type="MAXIMUM" width="var(hb-param-screen-width)"/>
                 <sizehint height="expr(var(hb-param-margin-gene-screen) + 24.5un + var(hb-param-text-height-primary) + var(hb-param-text-height-secondary) + (2*var(hb-param-margin-gene-middle-vertical)) + 1.5un)" type="PREFERRED" width="var(hb-param-screen-width)"/>
@@ -152,7 +149,6 @@
             </widget>
             <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
                 <contentsmargins bottom="0.0" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0"/>
-                <linearitem itemname="albumTBoneDetail" spacing="0.0"/>
                 <linearitem itemname="albumWall"/>
                 <linearitem itemname="albumsList"/>
             </layout>
@@ -173,12 +169,8 @@
 
     <section name="playlistSongs">
         <widget name="container">
-            <widget name="playlistSongsDetail" type="HbGroupBox">
-                <bool name="collapsable" value="FALSE"/>
-            </widget>
             <layout orientation="Vertical" spacing="0un" type="linear">
                 <contentsmargins bottom="0.0" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0"/>
-                <linearitem itemname="playlistSongsDetail" spacing="0.0"/>
                 <linearitem itemname="playlistsList" spacing="0.0"/>
             </layout>
         </widget>
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -18,7 +18,9 @@
 #include <QtCore>
 
 #include <hbabstractviewitem.h>
+#include <hbgroupbox.h>
 
+#include "mpcollectiondocumentloader.h"
 #include "mpcollectioncontainer.h"
 #include "mpcollectiondatamodel.h"
 #include "mpmpxcollectiondata.h"
@@ -60,7 +62,9 @@
       mDocumentLoader(loader),
       mViewMode(MpCommon::DefaultView)
 {
-    TX_LOG
+    TX_ENTRY
+    mInfoBar = qobject_cast<HbGroupBox*>(mDocumentLoader->findWidget(QString( "infoBar")));
+    TX_EXIT
 }
 
 /*!
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontaineralbums.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -29,6 +29,7 @@
 #include "mpcollectiondatamodel.h"
 #include "mpcollectiontbonelistdatamodel.h"
 #include "mptrace.h"
+#include "mpenginefactory.h"
 
 /*!
     \class MpCollectionContainerAlbums
@@ -50,7 +51,6 @@
  */
 MpCollectionContainerAlbums::MpCollectionContainerAlbums( HbDocumentLoader *loader, QGraphicsItem *parent )
     : MpCollectionListContainer(loader, parent),
-      mInfoBar(0),
       mTBone(0),
       mTBoneListModel(0),
       mCurrentAlbumIndex(0)
@@ -65,8 +65,7 @@
 MpCollectionContainerAlbums::~MpCollectionContainerAlbums()
 {
     TX_ENTRY
-	delete mInfoBar;
-    delete mTBone;
+	delete mTBone;
     delete mList;
     delete mTBoneListModel;
     TX_EXIT
@@ -92,7 +91,7 @@
             mTBone->setModel(dataModel);
             mTBone->scrollTo( dataModel->index(mCurrentAlbumIndex, 0) );
             if ( mTBoneListModel == 0 ) {
-                mTBoneListModel = new MpCollectionTBoneListDataModel(mCollectionData);
+                mTBoneListModel = new MpCollectionTBoneListDataModel(mCollectionData, MpEngineFactory::sharedEngine()->playbackData());
                 connect( mTBoneListModel, SIGNAL(albumDataChanged()), this, SLOT(albumDataChanged()) );
                 connect( mTBoneListModel, SIGNAL(albumDataAvailable()), this, SLOT(albumDataAvailable()) );
             }
@@ -247,6 +246,9 @@
 void MpCollectionContainerAlbums::setupContainer()
 {
     TX_ENTRY_ARGS("mCollectionContext=" << mCollectionContext);
+    
+    mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "showInfoBar");
+    
     if ( mCollectionData->count() ) {
         bool ok = false;
         QGraphicsWidget *widget;
@@ -262,14 +264,13 @@
                 mIndexFeedback->setItemView(mList);
                 initializeList();
             }
-            if ( mInfoBar ) {
-                delete mInfoBar;
-                mInfoBar = 0;
-            }
             if ( mTBone ) {
                 delete mTBone;
                 mTBone = 0;
             }
+                        
+            mInfoBar->setHeading(hbTrId("txt_mus_subhead_albums_1l").arg(mCollectionData->count()));
+            
         }
         else if ( mCollectionContext == ECollectionContextAlbumsTBone ) {
             if ( mViewMode == MpCommon::FetchView ) {
@@ -278,9 +279,8 @@
                     TX_LOG_ARGS("Error: invalid xml file.");
                     Q_ASSERT_X(ok, "MpCollectionContainerAlbums::setupContainer", "invalid xml file");
                 }
-                widget = mDocumentLoader->findWidget(QString("albumTBoneDetail"));
-                mInfoBar = qobject_cast<HbGroupBox*>(widget);
-                mInfoBar->setHeading( hbTrId("txt_mus_subtitle_select_a_song") );
+ 
+                mInfoBar->setHeading(hbTrId("txt_mus_subtitle_select_song"));
             }
             else {
                 mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "albumTBone", &ok);
@@ -288,6 +288,9 @@
                     TX_LOG_ARGS("Error: invalid xml file.");
                     Q_ASSERT_X(ok, "MpCollectionContainerAlbums::setupContainer", "invalid xml file");
                 }
+                
+                mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "hideInfoBar");
+                
             }
             widget = mDocumentLoader->findWidget(QString("albumWall"));
             mTBone = qobject_cast<HgMediawall*>(widget);
@@ -302,14 +305,13 @@
     }
     else {
         // Must delete widgets when last song is deleted and view is reloaded.
-        if ( mInfoBar ) {
-            delete mInfoBar;
-            mInfoBar = 0;
-        }
         if ( mTBone ) {
             delete mTBone;
             mTBone = 0;
         }
+        
+        mInfoBar->setHeading(hbTrId("txt_mus_subhead_albums_1l").arg(0));
+        
         // Call empty list from base class
         setupEmptyListContainer();
     }
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerallsongs.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerallsongs.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -41,8 +41,7 @@
  Constructs the collection container.
  */
 MpCollectionContainerAllSongs::MpCollectionContainerAllSongs( HbDocumentLoader *loader, QGraphicsItem *parent )
-    : MpCollectionListContainer(loader, parent),
-      mInfoBar(0)
+    : MpCollectionListContainer(loader, parent)
 {
     TX_LOG
     mCollectionContext = ECollectionContextAllSongs;
@@ -54,7 +53,6 @@
 MpCollectionContainerAllSongs::~MpCollectionContainerAllSongs()
 {
     TX_ENTRY
-    delete mInfoBar;
     delete mList;
     TX_EXIT
 }
@@ -91,16 +89,18 @@
 void MpCollectionContainerAllSongs::setupContainer()
 {
     TX_ENTRY
+    
+    mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "showInfoBar");
+    
     if ( mCollectionData->count() ) {
         bool ok = false;
+        QGraphicsWidget *widget;
+        
         mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "allSongs", &ok);
         if ( !ok ) {
             TX_LOG_ARGS("Error: invalid xml file.");
             Q_ASSERT_X(ok, "MpCollectionContainerAllSongs::setupContainer", "invalid xml file");
         }
-        QGraphicsWidget *widget;
-        widget = mDocumentLoader->findWidget(QString("allSongsDetail"));
-        mInfoBar = qobject_cast<HbGroupBox*>(widget);
 
         widget = mDocumentLoader->findWidget(QString("allSongsList"));
         mList = qobject_cast<HbListView*>(widget);
@@ -109,15 +109,16 @@
 
         QString details;
         if ( mViewMode == MpCommon::FetchView ) {
-            details = hbTrId("txt_mus_subtitle_select_a_song");
+            details = hbTrId("txt_mus_subtitle_select_song");
         }
         else {
-            int count = mCollectionData->count();
-            details = hbTrId("txt_mus_subhead_songs_l1").arg( count );
+            details = hbTrId("txt_mus_subhead_songs_l1").arg(mCollectionData->count());
         }
         mInfoBar->setHeading(details);
     }
     else {
+        mInfoBar->setHeading(hbTrId("txt_mus_subhead_songs_l1").arg(0));
+
         // Call empty list from base class
         setupEmptyListContainer();
     }
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -30,6 +30,7 @@
 #include "mpcollectiondatamodel.h"
 #include "mpcollectiontbonelistdatamodel.h"
 #include "mptrace.h"
+#include "mpenginefactory.h"
 
 /*!
     \class MpCollectionContainerArtists
@@ -53,7 +54,6 @@
  */
 MpCollectionContainerArtists::MpCollectionContainerArtists( HbDocumentLoader *loader, QGraphicsItem *parent )
     : MpCollectionListContainer(loader, parent),
-      mInfoBar(0),
       mTBone(0),
       mTBoneListModel(0),
       mCurrentArtistIndex(0),
@@ -69,7 +69,6 @@
 MpCollectionContainerArtists::~MpCollectionContainerArtists()
 {
     TX_ENTRY
-    delete mInfoBar;
     delete mTBone;
     delete mList;
     delete mTBoneListModel;
@@ -135,7 +134,7 @@
                 mTBone->setModel(dataModel);
                 mTBone->scrollTo( dataModel->index(mCurrentAlbumIndex - mAlbumIndexOffset, 0) );
                 if ( mTBoneListModel == 0 ) {
-                    mTBoneListModel = new MpCollectionTBoneListDataModel(mCollectionData);
+                    mTBoneListModel = new MpCollectionTBoneListDataModel(mCollectionData, MpEngineFactory::sharedEngine()->playbackData());
                     connect( mTBoneListModel, SIGNAL(albumDataChanged()), this, SLOT(albumDataChanged()) );
                     connect( mTBoneListModel, SIGNAL(albumDataAvailable()), this, SLOT(albumDataAvailable()) );
                 }
@@ -314,6 +313,9 @@
 void MpCollectionContainerArtists::setupContainer()
 {
     TX_ENTRY_ARGS("mCollectionContext=" << mCollectionContext);
+           
+    mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "showInfoBar");
+    
     if ( mCollectionData->count() ) {
         bool ok = false;
         QGraphicsWidget *widget;
@@ -331,14 +333,13 @@
                     mIndexFeedback->setItemView(mList);
                     initializeList();
                 }
-                if ( mInfoBar ) {
-                    delete mInfoBar;
-                    mInfoBar = 0;
-                }
                 if ( mTBone ) {
                     delete mTBone;
                     mTBone = 0;
                 }
+                
+                mInfoBar->setHeading(hbTrId("txt_mus_subhead_artist_1l").arg(mCollectionData->count()));
+     
                 break;
             case ECollectionContextArtistAlbums:
                 mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "artistAlbums", &ok);
@@ -346,8 +347,6 @@
                     TX_LOG_ARGS("Error: invalid xml file.");
                     Q_ASSERT_X(ok, "MpCollectionContainerArtists::setupContainer", "invalid xml file");
                 }
-                widget = mDocumentLoader->findWidget(QString("artistDetail"));
-                mInfoBar = qobject_cast<HbGroupBox*>(widget);
 
                 artist = mCollectionData->collectionTitle();
                 if ( artist.isEmpty() ) {
@@ -367,9 +366,8 @@
                         TX_LOG_ARGS("Error: invalid xml file.");
                         Q_ASSERT_X(ok, "MpCollectionContainerAlbums::setupContainer", "invalid xml file");
                     }
-                    widget = mDocumentLoader->findWidget(QString("artistDetail"));
-                    mInfoBar = qobject_cast<HbGroupBox*>(widget);
-                    mInfoBar->setHeading( hbTrId("txt_mus_subtitle_select_a_song") );
+                    
+                    mInfoBar->setHeading( hbTrId("txt_mus_subtitle_select_song") );
                 }
                 else {
                     mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "artistAlbumTBone", &ok);
@@ -377,10 +375,9 @@
                         TX_LOG_ARGS("Error: invalid xml file.");
                         Q_ASSERT_X(ok, "MpCollectionContainerAlbums::setupContainer", "invalid xml file");
                     }
-                    if ( mInfoBar ) {
-                        delete mInfoBar;
-                        mInfoBar = 0;
-                    }
+                    
+                    mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "hideInfoBar");
+                                       
                 }
                 widget = mDocumentLoader->findWidget(QString("artistAlbumWall"));
                 mTBone = qobject_cast<HgMediawall*>(widget);
@@ -397,7 +394,7 @@
                 // No need to load anything. Just reuse the section "artistAlbums" loaded
                 // in ECollectionContextArtistAlbums context.
                 if ( mViewMode == MpCommon::FetchView ) {
-                    mInfoBar->setHeading( hbTrId("txt_mus_subtitle_select_a_song") );
+                    mInfoBar->setHeading( hbTrId("txt_mus_subtitle_select_song") );
                 }
                 else {
                     artist = mCollectionData->collectionTitle();
@@ -415,15 +412,14 @@
         }
     }
     else {
-        // Must delete widgets when last song is deleted and view is reloaded.
-        if ( mInfoBar ) {
-            delete mInfoBar;
-            mInfoBar = 0;
-        }
+        // Must delete widget when last song is deleted and view is reloaded.
         if ( mTBone ) {
             delete mTBone;
             mTBone = 0;
         }
+
+        mInfoBar->setHeading(hbTrId("txt_mus_subhead_artist_1l").arg(0));
+                
         // Call empty list from base class
         setupEmptyListContainer();
     }
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerplaylists.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -49,7 +49,6 @@
  */
 MpCollectionContainerPlaylists::MpCollectionContainerPlaylists( HbDocumentLoader *loader, QGraphicsItem *parent )
     : MpCollectionListContainer(loader, parent),
-      mInfoBar(0),
       mCurrentPlaylistIndex(0)
 {
     TX_LOG
@@ -63,7 +62,6 @@
 MpCollectionContainerPlaylists::~MpCollectionContainerPlaylists()
 {
     TX_ENTRY
-    delete mInfoBar;
     delete mList;
     TX_EXIT
 }
@@ -130,6 +128,9 @@
 void MpCollectionContainerPlaylists::setupContainer()
 {
     TX_ENTRY_ARGS("mCollectionContext=" << mCollectionContext);
+    
+    mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "showInfoBar");
+       
     if ( mCollectionData->count() ) {
         bool ok = false;
         QGraphicsWidget *widget;
@@ -144,10 +145,8 @@
                 mList = qobject_cast<HbListView*>(widget);
                 initializeList();
             }
-            if ( mInfoBar ) {
-                delete mInfoBar;
-                mInfoBar = 0;
-            }
+
+            mInfoBar->setHeading(hbTrId("txt_mus_subhead_playlists_1l").arg(mCollectionData->count()));
         }
         else if ( mCollectionContext == ECollectionContextPlaylistSongs ) {
             mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "playlistSongs", &ok);
@@ -155,16 +154,13 @@
                 TX_LOG_ARGS("Error: invalid xml file.");
                 Q_ASSERT_X(ok, "MpCollectionContainerPlaylists::setupContainer", "invalid xml file");
             }
-
-            widget = mDocumentLoader->findWidget(QString("playlistSongsDetail"));
-            mInfoBar = qobject_cast<HbGroupBox*>(widget);
-
+            
             QString details;
             if ( mViewMode == MpCommon::FetchView ) {
-                details = hbTrId("txt_mus_subtitle_select_a_song");
+                details = hbTrId("txt_mus_subtitle_select_song");
             }
             else {
-                details = mCollectionData->collectionTitle();
+                details = hbTrId("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(mCollectionData->count()); 
             }
             mInfoBar->setHeading(details);
         }
@@ -174,11 +170,10 @@
         }
     }
     else {
-        if ( mInfoBar ) {
-            delete mInfoBar;
-            mInfoBar = 0;
-        }
-        // Call empty list from base class
+    
+        mInfoBar->setHeading(hbTrId("txt_mus_subhead_1_2l").arg(mCollectionData->collectionTitle()).arg(0));
+
+        // Call empty list from base class    
         setupEmptyListContainer();
     }
     TX_EXIT
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionpopuphandler.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionpopuphandler.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -367,6 +367,7 @@
     MpCollectionDataModel *collectionDataModel;
     collectionDataModel = new MpCollectionDataModel( collectionData );
     collectionDataModel->refreshModel();
+    mPermanentData->mAbstractItemModel = collectionDataModel;
 
     getModelIndexes( hbTrId( "txt_mus_title_select_songs" ), collectionDataModel, 
                      SLOT( handleAddToCurrentPlaylist( HbAction* ) ) );
@@ -642,9 +643,14 @@
         }
     }
 
-    //Dialog is using CollectionView main model, avoid dialog destructor to alter it.
-    dialog->setModel( 0 );
-
+    //Dialog won't use CollectionView main model any more, return it to its original layout.
+    MpCollectionDataModel *mpModel = qobject_cast<MpCollectionDataModel *>( dialog->model() );
+    if ( mpModel ) {
+        //setLayout() only applies for MpCollectionDataModel where we need to 
+        //decide which layout to use for the secondary text.
+        //MpCollectionTBoneListDataModel doesn't have secondary text.
+        mpModel->setLayout( ECollectionListView );
+    }
     TX_EXIT
 }
 
@@ -672,9 +678,14 @@
         }
     }
 
-    //Dialog is using CollectionView main model, avoid dialog destructor to alter it.
-    dialog->setModel( 0 );
-
+    //Dialog won't use CollectionView main model any more, return it to its original layout.
+    MpCollectionDataModel *mpModel = qobject_cast<MpCollectionDataModel *>( dialog->model() );
+    if ( mpModel ) {
+        //setLayout() only applies for MpCollectionDataModel where we need to 
+        //decide which layout to use for the secondary text.
+        //MpCollectionTBoneListDataModel doesn't have secondary text.
+        mpModel->setLayout( ECollectionListView );
+    }
     TX_EXIT
 }
 
@@ -703,10 +714,7 @@
         }
     }
 
-    //Pull the model to delete it. Dialog destructor only removes items from model, but doesn't delete them.
-    mPermanentData->mAbstractItemModel = dialog->model();
-    dialog->setModel( 0 );
-
+    //Dialog is using an isolated model which will be deleted, no need to change its layout.
     mPermanentData->clear();
 
     TX_EXIT
@@ -774,8 +782,7 @@
         }
     }
 
-    dialog->setModel( 0 );
-
+    //Dialog is using an isolated model which will be deleted, no need to change its layout.
     mPermanentData->clear();
 
     TX_EXIT
@@ -833,7 +840,7 @@
         }
     }
     else if (context != ECollectionContextPlaylists ) {  //no progress dialog for delete playlist
-        launchProgressDialog( "txt_mus_info_deleting" );
+        launchProgressDialog( "txt_common_info_deleting" );
     }
     TX_EXIT
 }
@@ -1021,6 +1028,13 @@
     HbSelectionDialog *dialog = new HbSelectionDialog();
     dialog->setHeadingWidget( new HbLabel( label ) );
     dialog->setSelectionMode( HbAbstractItemView::MultiSelection );
+    MpCollectionDataModel *mpModel = qobject_cast<MpCollectionDataModel *>( model );
+    if ( mpModel ) {
+        //setLayout() only applies for MpCollectionDataModel where we need to 
+        //decide which layout to use for the secondary text.
+        //MpCollectionTBoneListDataModel doesn't have secondary text.
+        mpModel->setLayout( ECollectionSelectionDialog );
+    }
     dialog->setModel( model );
     dialog->clearActions();
     action = new HbAction( hbTrId( "txt_common_button_ok" ) );
@@ -1055,12 +1069,19 @@
     listView->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded);
     MpCollectionDataModel *model;
     //Ownership of the model is passed to the listView as a child object.
-    model = new MpCollectionDataModel( mMpEngine->collectionData() , listView );
+    model = new MpCollectionDataModel( mMpEngine->collectionData() , mMpEngine->playbackData(), listView );
     model->refreshModel();
     connect( model,
              SIGNAL( orderChanged( int, int, int, int ) ),
              mMpEngine,
              SLOT( reorderPlaylist( int, int, int, int ) ) );
+    MpCollectionDataModel *mpModel = qobject_cast<MpCollectionDataModel *>( model );
+    if ( mpModel ) {
+        //setLayout() only applies for MpCollectionDataModel where we need to 
+        //decide which layout to use for the secondary text.
+        //MpCollectionTBoneListDataModel doesn't have secondary text.
+        mpModel->setLayout( ECollectionArrangeSongsDialog );
+    }
     listView->setModel( model );
     listView->setArrangeMode( true );
     HbDialog *dialog = new HbDialog();
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -182,7 +182,7 @@
     connect( mCollectionData, SIGNAL( contextChanged( TCollectionContext ) ), 
              this, SLOT( setContext( TCollectionContext ) ), 
 			 Qt::QueuedConnection );
-    mCollectionDataModel = new MpCollectionDataModel( mCollectionData );
+    mCollectionDataModel = new MpCollectionDataModel( mCollectionData , mMpEngine->playbackData());
     
     connect( mCollectionDataModel, SIGNAL( dataReloaded() ),
              this, SLOT( containerDataChanged() ) );
@@ -293,21 +293,6 @@
 }
 
 /*!
- Sets the default collection - AllSongs
- */
-void MpCollectionView::setDefaultView()
-{
-    TX_ENTRY
-    if ( mCollectionContext != ECollectionContextAllSongs ) {
-        // Open 'All Songs' by default
-        mMpEngine->openCollection( ECollectionContextAllSongs );
-    }
-
-
-    TX_EXIT
-}
-
-/*!
  Returns view activation status.
  */
 bool MpCollectionView::isActivated()
@@ -458,14 +443,24 @@
             case ECollectionContextArtistAllSongs:
             case ECollectionContextPlaylistSongs:
                 doOpen = false;
-                songUri = mCollectionData->itemData( index, MpMpxCollectionData::Uri );
-                emit songSelected( songUri );
+                if (!mCollectionData->hasItemProperty(index, MpMpxCollectionData::Corrupted)) {
+                    songUri = mCollectionData->itemData( index, MpMpxCollectionData::Uri );
+                    emit songSelected( songUri );
+                    }
+                else {
+                    showCorruptedNote();
+                }
                 break;
             case ECollectionContextArtistAlbumsTBone:
             case ECollectionContextAlbumsTBone:
                 doOpen = false;
-                songUri = mCollectionData->albumSongData( index, MpMpxCollectionData::Uri );
-                emit songSelected( songUri );
+                if (!mCollectionData->hasAlbumSongProperty(index, MpMpxCollectionData::Corrupted)) {
+                    songUri = mCollectionData->albumSongData( index, MpMpxCollectionData::Uri );
+                    emit songSelected( songUri );
+                    }
+                else {
+                    showCorruptedNote();
+                }
                 break;
             default:
                 break;
@@ -489,8 +484,23 @@
             mCollectionData->setContext( ECollectionContextAlbumsTBone );
         }
         else {
-            // Real open. Forward it to the engine.
-            mMpEngine->openCollectionItem( index );
+            switch ( mCollectionContext ) {
+                case ECollectionContextAllSongs:
+                case ECollectionContextArtistAllSongs:
+                case ECollectionContextPlaylistSongs:
+                    if (!mCollectionData->hasItemProperty(index, MpMpxCollectionData::Corrupted)) {
+                        mMpEngine->openCollectionItem( index );
+                        }
+                    else {
+                        showCorruptedNote();
+                    }
+                    break;
+                case ECollectionContextArtists:
+                case ECollectionContextPlaylists:
+                    mMpEngine->openCollectionItem( index );
+                default:
+                    break;
+            }
         }
     }
     TX_EXIT
@@ -514,7 +524,12 @@
 void MpCollectionView::playAlbumSongs( int albumIndex, int songIndex )
 {
     TX_ENTRY_ARGS( "albumIndex=" << albumIndex << "songIndex=" << songIndex );
-    mMpEngine->playAlbumSongs(albumIndex, songIndex);
+    if (!mCollectionData->hasAlbumSongProperty(songIndex, MpMpxCollectionData::Corrupted)) {
+        mMpEngine->playAlbumSongs(albumIndex, songIndex);
+    }
+    else {
+        showCorruptedNote();
+    }
     TX_EXIT
 }
 
@@ -620,6 +635,7 @@
  */
 void MpCollectionView::shufflePlayAll()
 {
+    TX_ENTRY
     mMpEngine->setShuffle( true );
     MpSettingsManager::setShuffle( true );
     int index = generateShuffleIndex();
@@ -632,6 +648,7 @@
             openIndex( index );
             break;
     }
+    TX_EXIT
 }
 
 /*!
@@ -795,10 +812,16 @@
     }
     else {
         closeActiveDialog();
-        
-        //Update cache, even if collection is in background.
-        //Library refreshing could be triggered at any point due USB/MMC events.
-        mMpEngine->reopenCollection();
+
+        // Update cache, even if collection is in background.
+        // Library refreshing could be triggered at any point due USB/MMC events.
+        if ( mCollectionContext == ECollectionContextAllSongs ) {
+            mMpEngine->reopenCollection();
+        }
+		// We force to go to the all songs collection when the refresh is finished.
+        else{
+            openSongs();
+        }
     }
     TX_EXIT
 }
@@ -1176,11 +1199,9 @@
     bool ok = false;
     if ( visible ) {
         mDocumentLoader->load( MUSIC_COLLECTION_DOCML, "showBanner", &ok );
-        mNowPlayingBanner->show();
     }
     else {
         mDocumentLoader->load( MUSIC_COLLECTION_DOCML, "hideBanner", &ok );
-        mNowPlayingBanner->hide();
     }
 
     if ( !ok ) {
@@ -1191,27 +1212,54 @@
 
 /*!
  \internal
- Generates a random index for shuffle all.
+ Generates a random index for shuffle all. In case of All Songs, due to incremental open
+ delay, the chosen index may not be available yet. In such case, narrow down the upper limit
+ and regenerate until a valid index is found.
  */
 int MpCollectionView::generateShuffleIndex()
 {
     int low = 0;
     int high = 0;
+    bool tbone;
     switch ( mCollectionContext ) {
         case ECollectionContextArtistAlbumsTBone:
         case ECollectionContextAlbumsTBone:
+            tbone = true;
             high = mCollectionData->albumSongsCount();
             break;
         default:
+            tbone = false;
             high = mCollectionData->count();
             break;
     }
 
+    bool validIndex = false;
+    int index = 0;
+    int songId;
     time_t seconds;
-    time( &seconds );
-    srand( ( unsigned int ) seconds );
+    while ( !validIndex ) {
+        time( &seconds );
+        srand( ( unsigned int ) seconds );
+        index = rand() % ( high - low + 1 ) + low;
+
+        if ( tbone ) {
+            songId = mCollectionData->albumSongId(index);
+        }
+        else {
+            songId = mCollectionData->itemId(index);
+        }
 
-    int index = rand() % ( high - low + 1 ) + low;
+        if ( songId != -1 ) {
+            // Got a valid index; exit the loop.
+            validIndex = true;
+        }
+        else {
+            // Invalid index; re-select an index, but narrow down the
+            // upper range to increase the change of hitting a valid index.
+            high = index;
+        }
+        TX_LOG_ARGS( "index=" << index << "valid=" << validIndex );
+    }
     return index;
 }
 
@@ -1279,3 +1327,16 @@
     menu()->close();
 }
 
+/*!
+ \internal
+ Shows Corrupted Note in collection view
+ */
+void MpCollectionView::showCorruptedNote()
+{
+    TX_ENTRY
+    HbMessageBox *messageBox = new HbMessageBox( hbTrId( "txt_mus_info_file_is_corrupt" ), HbMessageBox::MessageTypeInformation );
+    messageBox->setAttribute( Qt::WA_DeleteOnClose );
+    messageBox->setIcon( HbIcon( QString("qtg_small_fail") ) ); 
+    messageBox->show();
+    TX_EXIT
+}
--- a/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/src/unittest_mpcollectioncontainers.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpcollectionviewplugin/tsrc/unittest_mpcollectioncontainers/src/unittest_mpcollectioncontainers.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -260,7 +260,7 @@
     MpCollectionContainerAllSongs *allSongs = static_cast<MpCollectionContainerAllSongs*>(mTest);
 
     // Fetcher mode.
-    QCOMPARE(allSongs->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_a_song"));
+    QCOMPARE(allSongs->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_song"));
 }
 
 /*!
@@ -409,7 +409,7 @@
     QVERIFY(artists->mTBoneListModel != 0);
     QVERIFY(artists->mAlbumIndexOffset == 0);
     QCOMPARE(spy.count(), 1);
-    QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_a_song"));
+    QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_song"));
 
     // User selects back - navigate back to artists
     mCollectionData->mContext = ECollectionContextArtists;
@@ -434,7 +434,7 @@
     QCOMPARE(artists->mCollectionContext, ECollectionContextArtistAllSongs);
     QVERIFY(artists->mList != 0);
     QVERIFY(artists->mInfoBar != 0);
-    QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_a_song"));
+    QCOMPARE(artists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_song"));
 }
 
 /*!
@@ -529,7 +529,7 @@
     QCOMPARE(albums->mTBone->reflectionsEnabled(), false);
     // We set mCurrentAlbumAvailable to true, so no signal should emit.
     QCOMPARE(spy.count(), 0);
-    QCOMPARE(albums->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_a_song"));
+    QCOMPARE(albums->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_song"));
 
     // User selects back - navigate back to albums
     mCollectionData->mContext = ECollectionContextAlbums;
@@ -620,7 +620,7 @@
     QVERIFY(playlists->mList != 0);
     QVERIFY(playlists->mInfoBar != 0);
     QVERIFY(playlists->mNoMusic == 0);
-    QCOMPARE(playlists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_a_song"));
+    QCOMPARE(playlists->mInfoBar->heading(), hbTrId("txt_mus_subtitle_select_song"));
 
     // User selects back - navigate back to playlists
     mCollectionData->mContext = ECollectionContextPlaylists;
--- a/mpviewplugins/mpdetailsviewplugin/inc/mpdetailsview.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/inc/mpdetailsview.h	Tue Aug 24 03:36:14 2010 -0500
@@ -87,12 +87,11 @@
     void handleInspireMeGroupBoxToggled( bool state );
     void renderInspireMeMetadata();
     void renderInspireMeAlbumArts();
-    void abortInspireMeProcess();    
+    void abortInspireMeProcess();
 
 private:
     void startInspireMe();
     bool isMetadata() const;
-    void setupMenu();
     void saveGroupBoxStates();
 
 private:    
--- a/mpviewplugins/mpdetailsviewplugin/inc/mpquerymanager.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/inc/mpquerymanager.h	Tue Aug 24 03:36:14 2010 -0500
@@ -26,6 +26,7 @@
 #include "mpviewbase.h"
 
 class QNetworkAccessManager;
+class QSignalMapper;
 class ThumbnailManager;
 
 /*!
@@ -46,10 +47,9 @@
     
 public:
     void reset();
-    void queryLocalMusicStore( QString mArtist,QString mAlbum,QString mTitle );
     void queryInspireMeItems( QString mArtist,QString mAlbum,QString mTitle );
     void queryLocalMusicStore();
-    bool isLocalMusicStore() const;
+    bool isLocalMusicStore();
     
     int recommendationsCount() const;
     QString recommendedSong(int index) const;
@@ -60,15 +60,12 @@
     void retrieveInformationFinished( QNetworkReply* reply );
     void retrieveInformationNetworkError( QNetworkReply::NetworkError error );
     void retrieveInformationSslErrors( const QList<QSslError> &error );
-    void albumArtDownloaded( QNetworkReply* reply );    
-    void setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName );
-    void thumbnailReady( const QPixmap pixmap, void *data, int id, int error );
+    void albumArtDownloaded( int index );    
                   
 private:
-    void clearThumbnails();
     void clearRecommendations();    
     void clearNetworkReplies();    
-    void signalError();    
+    void signalError();
     void constructRequest( QString &uri );     
     // retrieve URI from Ovi music server
     void retrieveInformation( const QString &urlEncoded );
@@ -76,7 +73,6 @@
     QString keyValues( QStringList keys, QStringList values ) const;
     void handleParsedXML();
 
-    bool writeImageToFile( const QByteArray &aImageData, const QString &aImageFileName );
     
 signals:
     void inspireMeItemAlbumArtReady();
@@ -95,14 +91,12 @@
     QList<QNetworkReply *>  	mReplys;
     QList<int>                  mThumbnailRequests;
     
-    QDomDocument            	mDomDocument;
-    ThumbnailManager        	*mThumbnailManager; //owned    
+    QDomDocument            	mDomDocument; 
     
     QString                 	mArtist;
     QString                 	mAlbum;
     QString                 	mTitle;
     QString                 	mMusicStore;
-    QStringList          		mRecommendationAlbumArtsName;
     
     QStringList          		mRecommendationSongs;
     QStringList          		mRecommendationArtists;
@@ -115,6 +109,8 @@
     RequestType         		mRequestType;
     int                         mRecommendationCount;
  
+    QSignalMapper               *mDownloadSignalMapper;
+
 };
 #endif /* MPQUERYMANAGER_H_ */
 
--- a/mpviewplugins/mpdetailsviewplugin/src/mpdetailsview.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/src/mpdetailsview.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -176,9 +176,6 @@
 
     mMpEngine = MpEngineFactory::sharedEngine();
     mSongData = mMpEngine->songData();
-
-    // TODO: might need later
-    setupMenu();
     mMpQueryManager = new MpQueryManager();
 
     connect( mSoftKeyBack, SIGNAL( triggered() ), this, SLOT( back() ) );
@@ -191,7 +188,7 @@
     connect( mMpQueryManager, SIGNAL(inspireMeItemsMetadataRetrieved()), this, SLOT(renderInspireMeMetadata()));
     connect( mMpQueryManager, SIGNAL(inspireMeItemAlbumArtReady()), this, SLOT(renderInspireMeAlbumArts()));    
     connect( mMpQueryManager, SIGNAL(localMusicStoreRetrieved(bool)), this, SLOT(queryInspireMe(bool)), Qt::QueuedConnection);
-    connect( mMpQueryManager, SIGNAL(localMusicStoreRetrievalError()), this, SLOT(abortInspireMeProcess()));
+	connect( mMpQueryManager, SIGNAL(localMusicStoreRetrievalError()), this, SLOT(abortInspireMeProcess()));
     connect( mMpQueryManager, SIGNAL(inspireMeItemsRetrievalError()), this, SLOT(queryLocalMusicStore()), Qt::QueuedConnection);
 
     TX_EXIT
@@ -253,16 +250,6 @@
 }
  
 /*!
- Setup the menu.
- */
-void MpDetailsView::setupMenu()
-{
-    TX_ENTRY
-
-    TX_EXIT
-}
-
-/*!
  Slot to handle back command from softkey.
  */
 void MpDetailsView::back()
@@ -287,7 +274,7 @@
 /*!
  Slot to handle network error.
  */
-void MpDetailsView::abortInspireMeProcess()
+void MpDetailsView::abortInspireMeProcess( )
 {
     TX_ENTRY
     mInspireMeProgressBar->hide();    
--- a/mpviewplugins/mpdetailsviewplugin/src/mpquerymanager.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpdetailsviewplugin/src/mpquerymanager.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -16,7 +16,6 @@
 */
 
 #include "mpquerymanager.h"
-#include <QDebug>
 #include <QObject>
 #include <QNetworkAccessManager>
 #include <QNetworkDiskCache>
@@ -25,58 +24,31 @@
 #include <QNetworkSession>
 #include <QDomElement>
 #include <QList>
-#include <QFile>
 #include <QUrl>
 #include <QSslError>
-#include <QDir>
-#include <QCoreApplication>
 #include <XQSysInfo>
-
-#include <thumbnailmanager_qt.h>
-#include <thumbnaildata.h>
-#include <thumbnailobjectsource.h>
+#include <QSignalMapper>
+#include <QSettings>
 
 #include "mptrace.h"
 
-const int KUndefined = -1;
 const int KRecommendationCount = 2;
 
 MpQueryManager::MpQueryManager()
     : mManager(0),
       mAlbumArtDownloader(0),
-      mThumbnailManager(0),
       mDefaultRecommendationAlbumArt("qtg_large_album_art"),
       mRequestType(NoRequest),
-      mRecommendationCount(0)
-                               
+      mRecommendationCount(0)                               
 {
     TX_ENTRY
-
-    QString privatePathQt( QCoreApplication::applicationDirPath() );
-    TX_LOG_ARGS( "Private path: " << privatePathQt );
-    QDir dir( privatePathQt );
-    QString newDir = "detailsview";
-    bool res = dir.mkdir( newDir );
-    TX_LOG_ARGS( "New dir creation result: " << res);
+    mManager = new QNetworkAccessManager( this );      
+    // A second intance is necessary to reduce complexity.
+    // Otherwise, we would have to shoot async events when we want to receive inspire me items' album art
+    // and that may not always work.
+    mAlbumArtDownloader = new QNetworkAccessManager( this ); 
 
-    // TODO: Instead of writing the album art to a file, 
-	// then using Thumbnail Manager to convert it, etc. 
-	// have you considered just loading it directly into QPixmap? 
-	// QPixmap provides a loadFromData() that can load from QByteArray. 
-	// This would not only make the availability of the album art immediate, 
-	// but also save a lot of cleanup in file system, thumbnail manager, etc.    
-    privatePathQt = privatePathQt + "/detailsview";
-    QString albumArt1( privatePathQt + "/albumOne.png" );
-    QString albumArt2( privatePathQt + "/albumTwo.png" );
-    mRecommendationAlbumArtsName << albumArt1 << albumArt2;
-    TX_LOG_ARGS( "recommendation album art names: " << mRecommendationAlbumArtsName );
-
-    mManager = new QNetworkAccessManager( this );      
-    mAlbumArtDownloader = new QNetworkAccessManager( this );    // TODO: check if we can only use mManager
-    mThumbnailManager = new ThumbnailManager( this );
-    mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForQuality );
-    mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailSmall );
-
+    mDownloadSignalMapper = new QSignalMapper(this);
     TX_EXIT
 }
 
@@ -90,9 +62,7 @@
     if ( mAlbumArtDownloader ) {
        mAlbumArtDownloader->deleteLater();
     }
-    if( mThumbnailManager ) {
-        mThumbnailManager->deleteLater();
-    }
+    delete mDownloadSignalMapper;
     TX_EXIT
 }
 
@@ -115,21 +85,6 @@
     TX_EXIT
 }
 
-
-void MpQueryManager::queryLocalMusicStore(QString artist,QString album,QString title)
-{
-    TX_ENTRY
-    mArtist=artist;
-    mAlbum=album;
-    mTitle=title;
-    // TODO: country information handling, MCC
-    QString queryURI("http://api.music.ovi.com/1.0/ru/?");
-    constructRequest( queryURI );
-    TX_LOG_ARGS( "queryURI : " << queryURI );
-    retrieveInformation( queryURI );
-    mRequestType = LocalStoreRequest;    
-    TX_EXIT    
-}
     
 void MpQueryManager::queryInspireMeItems(QString artist,QString album,QString title)
 {
@@ -140,7 +95,6 @@
     // start querying inspire me items
     QString queryRecommendation("http://api.music.ovi.com/1.0/" + mMusicStore + "/releases/recommend/?");
     constructRequest( queryRecommendation );
-	// TODO: Store the token to a cenrep key	
     // TODO: Tokens change per new ovi api release. 
 	//       Need to figure out a way to get them updated on the fly
     queryRecommendation.append("&Token=03574704-e3d1-4466-9691-e0b34c7abfff");
@@ -161,13 +115,6 @@
     mRecommendationArtists.clear();
     mRecommendationAlbumArtsLink.clear();
     mRecommendationAlbumArtsMap.clear();
-    for ( int i = 0; i < mRecommendationAlbumArtsName.count(); ++i ) {
-       QFile file( mRecommendationAlbumArtsName.at( i ) );
-       TX_LOG_ARGS( "File " << file.fileName() << " exists: " << file.exists() );
-       if ( file.exists() && file.remove() ) {
-            TX_LOG_ARGS( "File " << file.fileName() << " removed");
-       }
-    }
     TX_EXIT    
 }
 
@@ -284,7 +231,6 @@
 void MpQueryManager::retrieveInformationNetworkError( QNetworkReply::NetworkError error )
 {
     TX_ENTRY_ARGS( "Network error for retrieving Information" << error);    
-    // TODO: agree on error handling
 
 	Q_UNUSED(error)
 
@@ -298,7 +244,6 @@
  */
 void MpQueryManager::retrieveInformationSslErrors( const QList<QSslError> &/*error*/ )
 {
-    // TODO: agree on error handling
     TX_ENTRY_ARGS( "SSL error for retrieving Information" );
     disconnect( mManager, SIGNAL( finished( QNetworkReply * ) ), this, SLOT( retrieveInformationFinished( QNetworkReply * ) ) );     
     signalError();    
@@ -308,91 +253,47 @@
 /*!
  Slot to call when downloading finished
  */
-void MpQueryManager::albumArtDownloaded( QNetworkReply* reply )
+void MpQueryManager::albumArtDownloaded( int index )
 {
-    TX_ENTRY_ARGS( "mDownloadedAlbumArts = " << mDownloadedAlbumArts );
-    TX_ENTRY_ARGS( "QNetworkReply obj " << reply);
+    TX_ENTRY_ARGS( "mDownloadedAlbumArts = " << mDownloadedAlbumArts << "index = " << index);
     
+    QNetworkReply* reply = qobject_cast<QNetworkReply*> ( qobject_cast<QSignalMapper*>( sender() )->mapping( index ) );
     // It seems we get several finished signals for the same reply obj
     // do nothing if we get a second signal
     if( mReplys.indexOf(reply) == -1 ) {
         TX_LOG_ARGS("Warning: QNetworkReply AA request may have been processed in previous call: " << reply );
         return;
     }
-        
+       
     if ( reply->error() == QNetworkReply::NoError ) {
-        
-        QString fileName = mRecommendationAlbumArtsName.at( mDownloadedAlbumArts );
-        QByteArray imageData = reply->readAll();
-        bool ret = writeImageToFile( imageData, fileName );
+        QPixmap albumart;
+        bool result = albumart.loadFromData( reply->readAll() );
+        if ( result ) {
+            mRecommendationAlbumArtsMap.insert( mRecommendationAlbumArtsLink.at( index ), HbIcon( QIcon( albumart ) ) );
 
-        // If file writing went OK, emit a signal with the real filename
-        // If it failed, use empty filename (since file was removed in any case)
-        if ( ret ) {
-            // TODO: If album album arts come in different order than they have been asked,
-            // then inspire me items will use swapped album arts. Correct
-            setAlbumArtUri( mRecommendationAlbumArtsLink.at( mDownloadedAlbumArts), 
-                            mRecommendationAlbumArtsName.at( mDownloadedAlbumArts ) );
+        } else {
+            mRecommendationAlbumArtsMap.insert( mRecommendationAlbumArtsLink.at( index ), mDefaultRecommendationAlbumArt );        
         }
-        else {
-            setAlbumArtUri(mRecommendationAlbumArtsLink.at( mDownloadedAlbumArts), "");
-        }
+
         ++mDownloadedAlbumArts;
         mReplys.removeAll(reply); // remove it so that we wont process it again
         reply->deleteLater(); // make sure reply is deleted, as we longer care about it
     }
     else {
         TX_LOG_ARGS( "Error: Downloading album art failed! Will keep using the default AA" );
+        mRecommendationAlbumArtsMap.insert( mRecommendationAlbumArtsLink.at( index ), mDefaultRecommendationAlbumArt );  
     }
+    mDownloadSignalMapper->removeMappings( reply );
     
     if( mDownloadedAlbumArts == mRecommendationCount) {
         // no need to be informed anymore
-        mAlbumArtDownloader->disconnect(this);
+        mDownloadSignalMapper->disconnect(this);
+        emit inspireMeItemAlbumArtReady();    
     }
     
     TX_EXIT
 }
 
-/*!
- Write the image data to a file with the given filename.
- If writing operation fails for any reason (e.g. OOD),
- returns false, otherwise true.
- */
-bool MpQueryManager::writeImageToFile(const QByteArray &aImageData, const QString &aImageFileName )
-{
-    bool ret( false );
-    TX_ENTRY_ARGS( "imagefile: " << aImageFileName );
-    if ( aImageFileName.isEmpty() ) {
-        TX_LOG_ARGS( "Only store two album arts" );
-    }
-    else {
-        QFile file( aImageFileName );
-        if ( !file.open( QIODevice::ReadWrite ) ) {
-            TX_LOG_ARGS( "Unable to open file" );
-        }
-        else {
-            qint64 writtenBytes = file.write( aImageData );
-            // Verify file write status
-            if ( writtenBytes < aImageData.size() ) {
-                // If write succeeded only partially, or completely failed,
-                // remove the file from filesystem to remove risk of corruption
-                TX_LOG_ARGS( "Wrote only " << writtenBytes << " bytes, aborting operation!" );
-                file.close();
-                QFile::remove( mRecommendationAlbumArtsName.at( mDownloadedAlbumArts ) );
-            }
-            else {
-                // If write fully succeeded, flush contents
-                TX_LOG_ARGS( "Wrote all the bytes (" << writtenBytes << "), flushing and closing!");
-                file.flush();
-                file.close();
-                ret = true;
-            }
-        }
-    }
-    TX_LOG_ARGS( "Returning with value: " << ret );
-    TX_EXIT
-    return ret;
-}
 
 /*!
  Get Atom response from Ovi server based on query
@@ -428,7 +329,6 @@
                 while ( !link.isNull() ) {
                     if ( link.attribute( "title" ) == "albumart100" ) {
                         mRecommendationAlbumArtsLink.append( link.attribute( "href" ) );
-                        // TODO: This may get called twice for one inspire me item. Investigate why
                         mRecommendationAlbumArtsMap.insert( link.attribute( "href" ), mDefaultRecommendationAlbumArt );                      
                         break;
                     }
@@ -457,12 +357,15 @@
             if ( mRecommendationAlbumArtsLink.at( i ).contains( "http", Qt::CaseInsensitive ) ) {
                 reply = mAlbumArtDownloader->get( QNetworkRequest( QUrl( mRecommendationAlbumArtsLink.at(i) ) ) );
                 mReplys.append( reply );
+                connect( reply, SIGNAL( finished() ), mDownloadSignalMapper, SLOT( map() ) );
+                mDownloadSignalMapper->setMapping( reply, i );
+
                 connect( reply, SIGNAL( error( QNetworkReply::NetworkError ) ), this, SLOT( retrieveInformationNetworkError( QNetworkReply::NetworkError ) ) );
                 connect( reply, SIGNAL( sslErrors( QList<QSslError> ) ), this, SLOT( retrieveInformationSslErrors( QList<QSslError> ) ) );
             }
         }
        // we have queried for album arts for inspire me items. Now, time to wait for a response        
-       connect( mAlbumArtDownloader, SIGNAL( finished( QNetworkReply * ) ), this, SLOT( albumArtDownloaded( QNetworkReply * ) ) );
+        connect( mDownloadSignalMapper, SIGNAL( mapped( int ) ), this, SLOT( albumArtDownloaded( int ) ) );
 
     }
     else if ( rootElement.attribute( "type" ) == "storeList" ) {
@@ -470,10 +373,15 @@
         QDomElement entry = rootElement.firstChildElement( "workspace" );
         QString previousMusicStore = mMusicStore;
         mMusicStore = entry.attribute( "countryCode" );
-        if(!mMusicStore.isEmpty()) {
-            bool musicStoreUpdated = (previousMusicStore != mMusicStore);
-        	TX_LOG_ARGS("Music Store" << mMusicStore );
-            emit localMusicStoreRetrieved(musicStoreUpdated);
+        if( !mMusicStore.isEmpty() ) {
+            bool musicStoreUpdated = ( previousMusicStore != mMusicStore );
+            TX_LOG_ARGS("Music Store" << mMusicStore );
+            emit localMusicStoreRetrieved( musicStoreUpdated );
+            if( musicStoreUpdated ) {
+                QSettings settings;
+                TX_LOG_ARGS( "Storing music store value: " << mMusicStore );
+                settings.setValue( "LocalMusicStore", QVariant( mMusicStore ) );
+            }    
         }
         else {
             emit localMusicStoreRetrievalError();   
@@ -485,28 +393,14 @@
     TX_EXIT
 }
 
-void MpQueryManager::clearThumbnails()
-{
-    TX_ENTRY
-    for(int i = 0; i < mThumbnailRequests.count(); ++i ) {
-        mThumbnailManager->cancelRequest(mThumbnailRequests.at(i));
-    }
-    mThumbnailRequests.clear();    
-    for(int i = 0; i < mRecommendationAlbumArtsName.count(); ++i) {
-        mThumbnailManager->deleteThumbnails(mRecommendationAlbumArtsName.at(i)); // async, returns immidiately
-    }
-    TX_EXIT        
-}
 
 void MpQueryManager::reset()
 {
     TX_ENTRY
     mManager->disconnect(this);
     mAlbumArtDownloader->disconnect(this);
-    mThumbnailManager->disconnect(this);
     clearNetworkReplies();
     clearRecommendations();
-    clearThumbnails();
     mRecommendationAlbumArtsMap.clear();
     TX_EXIT
 }
@@ -521,8 +415,8 @@
     QStringList keys;
     keys << "artist" << "albumtitle" << "tracktitle" << "orderby";
     
-    // TODO: need to clarify which crition to use for sort, currently hard code to "relevancy"
-    // order can be relevancy, alltimedownloads, streetreleasedate, sortname, recentdownloads
+    // "relevancy" is the selected sort order
+    // sort order types can be relevancy, alltimedownloads, streetreleasedate, sortname, recentdownloads
     QStringList values;
     values << mArtist << mAlbum << mTitle << QString("relevancy");
     TX_LOG_ARGS( "Artist: " << mArtist ); 
@@ -558,71 +452,14 @@
     return str.left( str.length() - 1 );
 }
 
-/*!
- Sets recommendation album art
-*/
-void MpQueryManager::setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName )
+bool MpQueryManager::isLocalMusicStore()
 {
-    // TODO: rename this function. Doing too many things
-    TX_ENTRY_ARGS( "albumArtUri = " << albumArtUri )
-    TX_LOG_ARGS( "albumArtName = " << albumArtName )
-    if ( !albumArtUri.isEmpty() && !albumArtName.isEmpty() ) {
-        // TODO: this is no good to pass the address of the albumArtUri. It is an item in the list, which can cleaned
-        int id = mThumbnailManager->getThumbnail( albumArtName, reinterpret_cast<void *>( const_cast<QString *>( &albumArtUri ) ) );
-        if ( id == KUndefined ) {
-            // Request failed. Set default album art
-            mRecommendationAlbumArtsMap.insert( albumArtUri, mDefaultRecommendationAlbumArt );
-        }
-        else {
-            // Async request went throu
-            TX_LOG_ARGS("Request to thumbnail manager made. Id: " << id)
-            mThumbnailRequests.append(id);
-            mThumbnailManager->disconnect( this ); // to prevent multiple same connections with thumbnailmanager
-            QObject::connect( mThumbnailManager, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ),
-            this, SLOT( thumbnailReady( QPixmap , void * , int , int  ) ) );
-        }
-    }
-    else {
-        // No album art uri. Set default album art.
-        mRecommendationAlbumArtsMap.insert( albumArtUri, mDefaultRecommendationAlbumArt );
+    if( mMusicStore.isEmpty() ) {
+        QSettings settings;
+        QVariant settingsvariant = settings.value( "LocalMusicStore", "" );
+        mMusicStore = settingsvariant.toString(); 
+        TX_LOG_ARGS( "Got local music store from settings:" << mMusicStore );
     }
-    TX_EXIT
-}
-
-/*!
- Slot to handle the recommendation album art 
-*/
-void MpQueryManager::thumbnailReady(
-        const QPixmap pixmap,
-        void *data,
-        int id,
-        int error  )
-{
-    TX_ENTRY
-
-    if( mThumbnailRequests.indexOf(id) == -1 ) {
-        TX_LOG_ARGS("Warning: some old thumbnail request from previous song. Ignoring")
-        return;
-    }
-    
-    // TODO: Using data from array, which can be reset. There must be a safer way    
-    QString uri = *( reinterpret_cast<QString *>( data ) );
-    TX_LOG_ARGS( "Uri: " << uri );
-    
-    if ( error == 0 ) {
-        TX_LOG_ARGS( "album art link: " << uri );
-        mRecommendationAlbumArtsMap.insert( uri, HbIcon(QIcon(pixmap)) );
-    }
-    else {
-        mRecommendationAlbumArtsMap.insert( uri, mDefaultRecommendationAlbumArt );        
-    }
-
-    emit inspireMeItemAlbumArtReady();    
-    TX_EXIT
-}
-
-bool MpQueryManager::isLocalMusicStore() const
-{
     TX_LOG_ARGS( "isLocalMusicStore = " << !mMusicStore.isEmpty() )
     return !mMusicStore.isEmpty();
 }
--- a/mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/src/mpmediawallview.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -26,6 +26,8 @@
 #include <hbtoolbutton.h>
 #include <hblistview.h>
 #include <hbstyleloader.h>
+#include <hbmessagebox.h>
+
 
 #include <hgmediawall.h>
 
@@ -148,7 +150,7 @@
         
         mEngine = MpEngineFactory::createIsolatedEngine( MpEngine::MediaBrowsing );
         mCollectionData = mEngine->collectionData();
-        mModel = new MpCollectionDataModel( mCollectionData, this );
+        mModel = new MpCollectionDataModel( mCollectionData, mPlaybackData, this );
         
         connect( mCollectionData, SIGNAL( contextChanged( TCollectionContext ) ), 
                  this, SLOT( contextOpened( TCollectionContext ) ) );
@@ -170,7 +172,9 @@
     
     mTrackList = new MpTrackListWidget( this );
     mTrackList->setGraphicsEffect( new MpReflectionEffect(mTrackList) );
-    mTrackList->list()->setModel( new MpCollectionTBoneListDataModel(mCollectionData, mPlaybackData, mTrackList ) );
+    MpCollectionTBoneListDataModel *model = new MpCollectionTBoneListDataModel(mCollectionData, mPlaybackData, mTrackList );
+    model->enablePlaybackIndicatorEnable(true);
+    mTrackList->list()->setModel( model );
     mTrackList->hide();
     
     connect(mAlbumCover,SIGNAL(clicked()),this, SLOT(hideTracksList()));
@@ -392,10 +396,19 @@
  */
 void MpMediaWallView::listItemActivated( const QModelIndex &index )
 {
-    int albumIndex = mMediaWallWidget->currentIndex().row();
-    //We are playing on the shared engine, but we pass the collection data that
-    //points to albums on media wall, this is used to construct the playlist.
-    MpEngineFactory::sharedEngine()->playAlbumSongs( albumIndex, index.row(), mCollectionData );
+    if (!mCollectionData->hasAlbumSongProperty(index.row(), MpMpxCollectionData::Corrupted)) {
+        int albumIndex = mMediaWallWidget->currentIndex().row();
+        //We are playing on the shared engine, but we pass the collection data that
+        //points to albums on media wall, this is used to construct the playlist.
+        MpEngineFactory::sharedEngine()->playAlbumSongs( albumIndex, index.row(), mCollectionData );
+    }
+    else{
+        //pop up corrupted note
+        HbMessageBox *messageBox = new HbMessageBox( hbTrId( "txt_mus_info_file_is_corrupt" ), HbMessageBox::MessageTypeInformation );
+        messageBox->setAttribute( Qt::WA_DeleteOnClose );
+        messageBox->setIcon( HbIcon( QString("qtg_small_fail") ) ); 
+        messageBox->show();   
+    }
 }
 
 /*!
--- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiondatamodel.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiondatamodel.h	Tue Aug 24 03:36:14 2010 -0500
@@ -23,6 +23,7 @@
 
 class MpMpxCollectionData;
 class MpCollectionAlbumArtManager;
+class MpPlaybackData;
 
 
 class MpCollectionDataModel : public QAbstractListModel
@@ -31,7 +32,7 @@
 
 public:
 
-    explicit MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent=0 );
+    explicit MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData = 0, QObject *parent=0 );
     virtual ~MpCollectionDataModel();
 
     int rowCount(const QModelIndex &parent=QModelIndex()) const;
--- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiontbonelistdatamodel.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpcollectiontbonelistdatamodel.h	Tue Aug 24 03:36:14 2010 -0500
@@ -36,6 +36,11 @@
 
     int rowCount(const QModelIndex &parent=QModelIndex()) const;
     QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
+    void enablePlaybackIndicatorEnable(bool enable);
+    
+public slots:
+
+    void fileCorrupted(int songId);
 
 
 };
--- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpmpxcollectiondata.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpmpxcollectiondata.h	Tue Aug 24 03:36:14 2010 -0500
@@ -39,6 +39,11 @@
         Rating,
         AlbumArtUri
     };
+    
+    enum DataProperty {
+           Corrupted,
+           DrmExpired
+    };
 
     // Stub functions
     explicit MpMpxCollectionData( QObject *parent=0 );
@@ -53,6 +58,7 @@
     void setContext( TCollectionContext context );
     int itemIndex( int itemUniqueId );    
     bool setCurrentAlbum( int index );
+    bool hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const;
 
     const CMPXMedia& containerMedia();
 
--- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpcollectiondatamodel.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpcollectiondatamodel.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -19,15 +19,17 @@
 
 #include "stub/inc/mpcollectiondatamodel.h"
 #include "stub/inc/mpmpxcollectiondata.h"
+#include "stub/inc/mpplaybackdata.h"
 
 
 /*!
  Stub function
  */
-MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent )
+MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData, QObject *parent )
     : QAbstractListModel(parent)
 {
     Q_UNUSED(data);
+    Q_UNUSED(playbackData);
 }
 
 /*!
--- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpcollectiontbonelistdatamodel.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpcollectiontbonelistdatamodel.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -57,3 +57,18 @@
     return QVariant();;
 }
 
+/*!
+ Stub function
+ */
+void MpCollectionTBoneListDataModel::enablePlaybackIndicatorEnable(bool enable)
+{
+    Q_UNUSED(enable);
+}
+
+/*!
+ Stub function
+ */
+void MpCollectionTBoneListDataModel::fileCorrupted(int songId)
+{
+    Q_UNUSED(songId);
+}
--- a/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpmpxcollectiondata.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/src/mpmpxcollectiondata.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -97,6 +97,14 @@
 /*!
  Stub function.
 */
+bool MpMpxCollectionData::hasAlbumSongProperty( int index, MpMpxCollectionData:: DataProperty type ) const
+{
+
+}
+
+/*!
+ Stub function.
+*/
 const CMPXMedia& MpMpxCollectionData::containerMedia()
 {
     return *mContainerMedia;
--- a/mpviewplugins/mpplaybackviewplugin/inc/mpequalizerwidget.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/inc/mpequalizerwidget.h	Tue Aug 24 03:36:14 2010 -0500
@@ -51,7 +51,7 @@
     
     MpEngine           *mMpEngine;         // Own
     HbRadioButtonList  *mPresetsList;  //owned
-    int                mOriginalPreset;
+    int                mOriginalPresetIndex;
 
     Q_DISABLE_COPY(MpEqualizerWidget)
     
--- a/mpviewplugins/mpplaybackviewplugin/inc/mpplaybackview.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/inc/mpplaybackview.h	Tue Aug 24 03:36:14 2010 -0500
@@ -80,6 +80,7 @@
     void endForward();
     
     void connectButtons();
+    void showCorruptedNote();
 
 private:
 
--- a/mpviewplugins/mpplaybackviewplugin/resources/playbackwidget.docml	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/resources/playbackwidget.docml	Tue Aug 24 03:36:14 2010 -0500
@@ -1,42 +1,51 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 
-<hbdocument version="0.9">
-    
+<hbdocument version="1.2">
     <widget name="playbackWidgetContainer" type="HbWidget">
         
-        <widget name="albumText" type="HbLabel">
-            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-            <fontspec name="fontSpec" role="Secondary"/>            
+        <widget name="albumArt" type="MpAlbumCoverWidget">
+            <sizehint height="var(hb-param-screen-width)" type="FIXED" width="var(hb-param-screen-width)"/>
+            <sizepolicy horizontalPolicy="Fixed"  verticalPolicy="Fixed" />
         </widget>
         
         <widget name="artistRow" type="HbWidget">
-        	<widget name="realAudio" type="HbLabel">
-        		<sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-				<sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
-            	<icon iconName="qtg_large_realplayer" name="icon"/>
-            </widget> 
-        	<widget name="artistText" type="HbLabel">
-        		<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-            	<fontspec name="fontSpec" role="Secondary"/>
-            </widget>
-        	<widget name="repeatIcon" type="HbLabel">
-				<sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-				<sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
-          		<icon iconName="qtg_small_repeat" name="icon"/>
-            </widget>
-        	
-        	<layout type="anchor">       
-	            <anchoritem dst="realAudio" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="LEFT"/>
-	            <anchoritem dst="realAudio" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="" srcEdge="TOP"/>
-	            
-	            <anchoritem dst="artistText" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="realAudio" srcEdge="RIGHT"/>
-	            <anchoritem dst="artistText" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="repeatIcon" srcEdge="LEFT"/>
-	            <anchoritem dst="artistText" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="" srcEdge="TOP"/>
-	            
-	            <anchoritem dst="repeatIcon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
-	            <anchoritem dst="repeatIcon" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="" srcEdge="TOP"/>
-      		 </layout>
+            <sizehint type="FIXED" width="expr(var(hb-param-screen-width) -2*var(hb-param-margin-gene-screen))"/>
+            <sizepolicy horizontalPolicy="Fixed" />
+            
+                <widget name="realAudio" type="HbLabel">
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
+                    <bool name="visible" value="FALSE"/>
+                    <!-- resource name is correct, but does not show up -->
+                    <icon iconName="qtg_large_realplayer" name="icon"/>
+                </widget> 
+
+                <widget name="artistText" type="HbLabel">
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                    <fontspec name="fontSpec" role="Secondary"/>
+                    <sizehint type="FIXED" width="expr(var(hb-param-screen-width)-2*(var(hb-param-margin-gene-screen)+var(hb-param-graphic-size-primary-small)+var(hb-param-margin-gene-middle-horizontal)))"/>
+                    <sizepolicy horizontalPolicy="Fixed" />
+                </widget>
+
+                <widget name="repeatIcon" type="HbLabel">
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
+                    <icon iconName="qtg_small_repeat" name="icon"/>
+                </widget>
+
+            <layout type="anchor">       
+                <anchoritem dst="realAudio" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
+                <anchoritem dst="realAudio" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
+                
+                <anchoritem dst="artistText" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="realAudio" srcEdge="RIGHT"/>
+                <anchoritem dst="artistText" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="repeatIcon" srcEdge="LEFT"/>
+                <anchoritem dst="artistText" dstEdge="CENTERV" spacing="0" src="" srcEdge="CENTERV"/>
+                
+                <anchoritem dst="repeatIcon" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="repeatIcon" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
+            </layout>
+           
         </widget>
         
         <widget name="songText" type="HbLabel">
@@ -44,38 +53,31 @@
             <fontspec name="fontSpec" role="Primary"/>             
         </widget>
         
-        <widget name="albumArt" type="MpAlbumCoverWidget"/>
+        <widget name="albumText" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <fontspec name="fontSpec" role="Secondary"/>            
+        </widget>
         
         <widget name="progressBar" type="HbProgressSlider">
             <fontspec name="fontSpec" role="PrimarySmall"/>
+            <contentsmargins  top="1.0un"/>
         </widget>
 
-  		<widget name="textContainer" type="HbWidget"/>
-  		
-        <bool name="visible" value="TRUE"/>
-        
-    </widget>
-
-    <widget name="albumArt">
-        <sizehint height="var(hb-param-screen-width)" type="MAXIMUM" width="var(hb-param-screen-width)"/>
-        <sizehint height="var(hb-param-screen-width)" type="PREFERRED" width="var(hb-param-screen-width)"/>
-        <sizehint height="var(hb-param-screen-width)" type="FIXED" width="var(hb-param-screen-width)"/>
-        <sizehint height="var(hb-param-screen-width)" type="MINIMUM" width="var(hb-param-screen-width)"/>
-        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-    </widget>
+        <widget name="textContainer" type="HbWidget">
+            <layout type="linear" orientation="Vertical"  spacing="var(hb-param-margin-gene-middle-vertical)" >
+            <contentsmargins bottom="var(hb-param-margin-gene-screen)" left="var(hb-param-margin-gene-screen)" right="var(hb-param-margin-gene-screen)" top="0.0un"/>
+            <linearitem itemname="artistRow"/>
+            <linearitem itemname="songText"/>
+            <linearitem itemname="albumText"/>
+            <linearitem itemname="progressBar"/>
+           </layout>
+        </widget>
     
-    <layout type="linear" orientation="Vertical"  spacing="var(hb-param-margin-gene-middle-vertical)" widget="textContainer">
-    	<contentsmargins bottom="var(hb-param-margin-gene-screen)" left="var(hb-param-margin-gene-screen)" right="var(hb-param-margin-gene-screen)" top="0.0un"/>
-    	<linearitem itemname="artistRow"/>
-        <linearitem itemname="songText"/>
-        <linearitem itemname="albumText"/>
-    	<linearitem itemname="progressBar"/>
-    </layout>
+        <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)"  type="linear" >
+            <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>   
+            <linearitem itemname="albumArt"/>                        
+            <linearitem itemname="textContainer"/>
+        </layout>
     
-    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)"  type="linear" widget="playbackWidgetContainer">
-        <contentsmargins bottom="0.0un" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="0.0un"/>   
-        <linearitem itemname="albumArt"/>                        
-        <linearitem itemname="textContainer"/>
-    </layout>
-    
+    </widget>
 </hbdocument>
\ No newline at end of file
--- a/mpviewplugins/mpplaybackviewplugin/src/mpequalizerwidget.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/src/mpequalizerwidget.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -39,7 +39,7 @@
 MpEqualizerWidget::MpEqualizerWidget() :
     mMpEngine(0),
     mPresetsList(0),
-    mOriginalPreset(KEqualizerPresetNone)
+    mOriginalPresetIndex(0)
 {
     TX_ENTRY
     
@@ -82,7 +82,7 @@
     setFrameType(HbPopup::Strong);
     setHeadingWidget(new HbLabel(hbTrId("txt_mus_title_select_preset")));
 
-    mOriginalPreset = mMpEngine->activePreset();
+    mOriginalPresetIndex = mMpEngine->activePreset();
     QStringList listItems;
     QStringList presetNames = mMpEngine->presetNames();
     for ( int i=0; i<presetNames.count(); i++ ) {
@@ -98,15 +98,8 @@
     }
     listItems.prepend(hbTrId("txt_mus_list_off"));
     TX_LOG_ARGS( "PresetNames=" << listItems);
-    int presetSelected;
-    if (mOriginalPreset == KEqualizerPresetNone) {
-        presetSelected = 0;     //First list item corresponds to "OFF"
-    }
-    else {
-        presetSelected = mOriginalPreset;
-    }
-
-    mPresetsList = new HbRadioButtonList(listItems, presetSelected, HbRadioButtonList::NoPreview, this);
+    
+    mPresetsList = new HbRadioButtonList(listItems, mOriginalPresetIndex, HbRadioButtonList::NoPreview, this);
     setContentWidget( mPresetsList );  //mPresetsList now owned by HbDialog
 
     connect( mPresetsList, 
@@ -154,14 +147,14 @@
     
     if (mMpEngine && mPresetsList) {
         // Return to the original Preset
-        if (mOriginalPreset != mMpEngine->activePreset()) {
-            if (mOriginalPreset == KEqualizerPresetNone) {
+        if (mOriginalPresetIndex != mMpEngine->activePreset()) {
+            if (mOriginalPresetIndex == 0) {
                 mMpEngine->disableEqualizer();
                 mPresetsList->setSelected( 0 );     //First list item corresponds to "OFF"
             }
             else {
-                mMpEngine->applyPreset( mOriginalPreset );
-                mPresetsList->setSelected( mOriginalPreset );
+                mMpEngine->applyPreset( mOriginalPresetIndex );
+                mPresetsList->setSelected( mOriginalPresetIndex );
             }            
         }
     }
@@ -179,7 +172,7 @@
     
     //Update original preset
     if (mMpEngine) {
-        mOriginalPreset = mMpEngine->activePreset();
+        mOriginalPresetIndex = mMpEngine->activePreset();
     }
     
     TX_EXIT
--- a/mpviewplugins/mpplaybackviewplugin/src/mpplaybackview.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/src/mpplaybackview.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -24,6 +24,7 @@
 #include <hbtoolbutton.h>
 #include <hbaction.h>
 #include <hbicon.h>
+#include <hbmessagebox.h>
 
 #include "mpplaybackview.h"
 #include "mpplaybackwidget.h"
@@ -102,6 +103,7 @@
     connect( mSoftKeyBack, SIGNAL( triggered() ), this, SLOT( back() ) );
 
     mMpEngine = MpEngineFactory::sharedEngine();
+    connect( mMpEngine, SIGNAL( corruptedStop() ), this, SLOT(showCorruptedNote() ));
     mPlaybackData = mMpEngine->playbackData();
     connect( mPlaybackData, SIGNAL( playbackStateChanged() ),
              this, SLOT( playbackStateChanged() ) );
@@ -563,6 +565,19 @@
 }
 
 /*!
+ Slot to be called to show corrupted message box.
+ */
+void MpPlaybackView::showCorruptedNote()
+{
+    mMpEngine->stop();
+    HbMessageBox *messageBox = new HbMessageBox( hbTrId( "txt_mus_info_unable_to_play_selection" ), HbMessageBox::MessageTypeWarning );
+    messageBox->setAttribute( Qt::WA_DeleteOnClose );
+    messageBox->setIcon( HbIcon( QString("qtg_small_fail") ) ); 
+    connect (messageBox, SIGNAL( aboutToClose() ), this, SLOT( back() ) );
+    messageBox->show();
+}
+
+/*!
  Slot to be called to activate equalizer dialog.
  */
 void MpPlaybackView::showEqualizerDialog()
--- a/mpviewplugins/mpplaybackviewplugin/src/mpplaybackwidget.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/src/mpplaybackwidget.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -84,7 +84,6 @@
         mAlbumArt->setDefaultIcon( HbIcon( "qtg_large_album_art" ) );
         tmpWidgetPtr = mDocumentLoader->findWidget(QString("realAudio"));
         mRealAudioIndicator = qobject_cast<HbLabel*>(tmpWidgetPtr);
-        mRealAudioIndicator->hide();
         tmpWidgetPtr = mDocumentLoader->findWidget(QString("repeatIcon"));
         mRepeatIndicator = qobject_cast<HbLabel*>(tmpWidgetPtr);
                 
@@ -142,9 +141,25 @@
 void MpPlaybackWidget::playbackInfoChanged( )
 {
     TX_ENTRY
+    //Title
     mSongTitle->setPlainText( mPlaybackData->title() );
-    mArtistName->setPlainText( mPlaybackData->artist() );
-    mAlbumName->setPlainText( mPlaybackData->album() );
+    // Artist
+    QString data = mPlaybackData->artist();
+    if ( !data.isEmpty() ) {
+        mArtistName->setPlainText( data );
+    }
+    else {
+        mArtistName->setPlainText( hbTrId( "txt_mus_other_unknown3" ) );
+    }
+    // Album
+    data = mPlaybackData->album();
+    if ( !data.isEmpty() ) {
+        mAlbumName->setPlainText( data );
+    }
+    else {
+        mAlbumName->setPlainText( hbTrId( "txt_mus_other_unknown4" ) );
+    }
+    // RealAudioIcon
     mRealAudioIndicator->setVisible( mPlaybackData->realAudio() );
     emit signalPlaybackInfoChanged();
     TX_EXIT
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/src/unittest_mpequalizerwidget.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/src/unittest_mpequalizerwidget.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -122,7 +122,7 @@
 void TestMpEqualizerWidget::testPrepareDialog()
 {
     mTest->prepareDialog();
-    QVERIFY(mTest->mOriginalPreset == -1 );    
+    QVERIFY(mTest->mOriginalPresetIndex == 0 );    
     QVERIFY(mTest->timeout() == HbDialog::NoTimeout);
     QVERIFY(mTest->dismissPolicy() == HbDialog::NoDismiss);
     QVERIFY(mTest->frameType() == HbPopup::Strong);
@@ -165,25 +165,25 @@
     
     //When Original Preset == -1 "Off"
     mTest->mMpEngine->mActivePreset = 4;
-    mTest->mOriginalPreset = -1;
+    mTest->mOriginalPresetIndex = 0;
     mTest->cancelSelected(true);
     QVERIFY(mTest->mMpEngine->mDisableEquqlizerCount == 1);
-    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPreset);
+    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPresetIndex);
     
     //When Original Preset != -1 "Any other different than Off"
     mTest->mMpEngine->mActivePreset = 4;
-    mTest->mOriginalPreset = 2;
+    mTest->mOriginalPresetIndex = 2;
     mTest->cancelSelected(true);
     QVERIFY(mTest->mMpEngine->mApplyPresetCount == 1);
-    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPreset);
+    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPresetIndex);
         
     //Cancel, when Current preset selected == Original Preset
     mTest->mMpEngine->mActivePreset = 3;
-    mTest->mOriginalPreset = 3;
+    mTest->mOriginalPresetIndex = 3;
     mTest->cancelSelected(true);
     QVERIFY(mTest->mMpEngine->mApplyPresetCount == 1);
     QVERIFY(mTest->mMpEngine->mDisableEquqlizerCount == 1);
-    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPreset);
+    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPresetIndex);
 }
 
 /*!
@@ -192,9 +192,9 @@
 void TestMpEqualizerWidget::testOkSelected()
 {
     mTest->mMpEngine->mActivePreset = 2;
-    mTest->mOriginalPreset = -1;
+    mTest->mOriginalPresetIndex = -1;
     mTest->okSelected(true);
-    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPreset);   
+    QCOMPARE(mTest->mMpEngine->mActivePreset, mTest->mOriginalPresetIndex);   
 }
 
 /*!
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpengine.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpequalizerwidget/stub/src/mpengine.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -21,7 +21,7 @@
 
 
 MpEngine::MpEngine()
-    : mActivePreset(-1),
+    : mActivePreset(0),
       mApplyPresetCount(0),
       mDisableEquqlizerCount(0)
 {
@@ -53,7 +53,7 @@
 void MpEngine::disableEqualizer()
 {
     mDisableEquqlizerCount++;
-    mActivePreset = -1;
+    mActivePreset = 0;
 }
 
 /*!
--- a/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpviewbase.h	Fri Aug 06 16:51:36 2010 -0500
+++ b/mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpviewbase.h	Tue Aug 24 03:36:14 2010 -0500
@@ -30,7 +30,6 @@
 
     void setViewMode(MpCommon::MpViewMode viewMode) { mViewMode = viewMode; }
     MpCommon::MpViewMode viewMode() { return mViewMode; }
-    virtual void setDefaultView() { }
 
 signals:
 
--- a/tsrc/mpfetchertestapp/mpfetchertestapp.pro	Fri Aug 06 16:51:36 2010 -0500
+++ b/tsrc/mpfetchertestapp/mpfetchertestapp.pro	Tue Aug 24 03:36:14 2010 -0500
@@ -17,7 +17,10 @@
 TARGET = mpfetchertestapp
 
 CONFIG += hb
-LIBS += -lxqservice -lxqserviceutil
+LIBS += -lxqservice \
+        -lxqserviceutil \
+        -lapgrfx \
+        -lcone
 
 HEADERS += inc/mpfetchertestappview.h 
 
--- a/utilities/mpnowplayingbanner/src/mpnowplayingwidget_p.cpp	Fri Aug 06 16:51:36 2010 -0500
+++ b/utilities/mpnowplayingbanner/src/mpnowplayingwidget_p.cpp	Tue Aug 24 03:36:14 2010 -0500
@@ -301,7 +301,13 @@
     mPrimaryText->setPlainText( mPlaybackData->title() );
     mPrimaryText->setProperty( "state", mPrimaryText->property("state").toString() );
     
-    mSecondaryText->setPlainText( mPlaybackData->artist() );
+    QString data = mPlaybackData->artist();
+    if ( !data.isEmpty() ) {
+        mSecondaryText->setPlainText( data );
+    }
+    else {
+        mSecondaryText->setPlainText( hbTrId( "txt_mus_other_unknown" ) );
+    }
     mSecondaryText->setProperty( "state", mSecondaryText->property("state").toString() );
 }