mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp
changeset 29 8192e5b5c935
parent 22 ecf06a08d4d9
child 51 560ce2306a17
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp	Fri May 14 15:49:53 2010 +0300
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp	Thu May 27 12:49:57 2010 +0300
@@ -46,12 +46,19 @@
  */
 
 /*!
+    \fn void albumCentered( int index );
+
+    This signal is emitted only when container contains hgmediawall T-Bone when album
+    with \a index is centered following a scrolling action.
+ */
+
+/*!
  Constructs the collection container.
  */
 MpCollectionContainer::MpCollectionContainer( HbDocumentLoader *loader, QGraphicsItem *parent )
     : HbWidget(parent),
       mDocumentLoader(loader),
-      mCollectionContext(ECollectionContextUnknown)
+      mViewMode(MpCommon::DefaultView)
 {
     TX_LOG
 }
@@ -66,6 +73,9 @@
 
 /*!
  Sets the data model for the container.
+ Some of the containers are used for multiple contexts, i.e. Artist, Albums, Playlists. So,
+ setDataModel() is called multiple times to the same container object. We only want to connect
+ to dataReloaded() signal once or we'll receive multiple call backs.
  */
 void MpCollectionContainer::setDataModel( MpCollectionDataModel *dataModel )
 {
@@ -73,6 +83,7 @@
     mDataModel = dataModel;
     mCollectionData = mDataModel->collectionData();
     mCollectionContext = mCollectionData->context();
+    connect( dataModel, SIGNAL(dataReloaded()), this, SLOT(dataReloaded()), Qt::UniqueConnection );
 
     setupContainer();
     TX_EXIT