mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainer.cpp
changeset 29 8192e5b5c935
parent 22 ecf06a08d4d9
child 51 560ce2306a17
equal deleted inserted replaced
25:3ec52facab4d 29:8192e5b5c935
    44 
    44 
    45     This signal is emitted when an item of the container with \a index is long pressed.
    45     This signal is emitted when an item of the container with \a index is long pressed.
    46  */
    46  */
    47 
    47 
    48 /*!
    48 /*!
       
    49     \fn void albumCentered( int index );
       
    50 
       
    51     This signal is emitted only when container contains hgmediawall T-Bone when album
       
    52     with \a index is centered following a scrolling action.
       
    53  */
       
    54 
       
    55 /*!
    49  Constructs the collection container.
    56  Constructs the collection container.
    50  */
    57  */
    51 MpCollectionContainer::MpCollectionContainer( HbDocumentLoader *loader, QGraphicsItem *parent )
    58 MpCollectionContainer::MpCollectionContainer( HbDocumentLoader *loader, QGraphicsItem *parent )
    52     : HbWidget(parent),
    59     : HbWidget(parent),
    53       mDocumentLoader(loader),
    60       mDocumentLoader(loader),
    54       mCollectionContext(ECollectionContextUnknown)
    61       mViewMode(MpCommon::DefaultView)
    55 {
    62 {
    56     TX_LOG
    63     TX_LOG
    57 }
    64 }
    58 
    65 
    59 /*!
    66 /*!
    64     TX_LOG
    71     TX_LOG
    65 }
    72 }
    66 
    73 
    67 /*!
    74 /*!
    68  Sets the data model for the container.
    75  Sets the data model for the container.
       
    76  Some of the containers are used for multiple contexts, i.e. Artist, Albums, Playlists. So,
       
    77  setDataModel() is called multiple times to the same container object. We only want to connect
       
    78  to dataReloaded() signal once or we'll receive multiple call backs.
    69  */
    79  */
    70 void MpCollectionContainer::setDataModel( MpCollectionDataModel *dataModel )
    80 void MpCollectionContainer::setDataModel( MpCollectionDataModel *dataModel )
    71 {
    81 {
    72     TX_ENTRY
    82     TX_ENTRY
    73     mDataModel = dataModel;
    83     mDataModel = dataModel;
    74     mCollectionData = mDataModel->collectionData();
    84     mCollectionData = mDataModel->collectionData();
    75     mCollectionContext = mCollectionData->context();
    85     mCollectionContext = mCollectionData->context();
       
    86     connect( dataModel, SIGNAL(dataReloaded()), this, SLOT(dataReloaded()), Qt::UniqueConnection );
    76 
    87 
    77     setupContainer();
    88     setupContainer();
    78     TX_EXIT
    89     TX_EXIT
    79 }
    90 }
    80 
    91