mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp
changeset 36 a0afa279b8fe
parent 35 fdb31ab341af
child 55 f3930dda3342
equal deleted inserted replaced
35:fdb31ab341af 36:a0afa279b8fe
    72         deleteCurrentContainer();
    72         deleteCurrentContainer();
    73         mCurrentContainer = new MpCollectionContainerAllSongs(mDocumentLoader);
    73         mCurrentContainer = new MpCollectionContainerAllSongs(mDocumentLoader);
    74         mCurrentContainer->initialize();
    74         mCurrentContainer->initialize();
    75         connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
    75         connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
    76         connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
    76         connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
       
    77         connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
    77         break;
    78         break;
    78     case ECollectionContextArtists:
    79     case ECollectionContextArtists:
    79         if ( ( mCurrentContext != ECollectionContextArtistAlbums )
    80         if ( ( mCurrentContext != ECollectionContextArtistAlbums )
    80                && ( mCurrentContext != ECollectionContextArtistAlbumsTBone)
    81                && ( mCurrentContext != ECollectionContextArtistAlbumsTBone)
    81                && ( mCurrentContext != ECollectionContextArtistAllSongs) )
    82                && ( mCurrentContext != ECollectionContextArtistAllSongs) )
    85             mCurrentContainer->initialize();
    86             mCurrentContainer->initialize();
    86             connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
    87             connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
    87             connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
    88             connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
    88             connect( mCurrentContainer, SIGNAL(findAlbumSongs(int)), mView, SLOT(findAlbumSongs(int)) );
    89             connect( mCurrentContainer, SIGNAL(findAlbumSongs(int)), mView, SLOT(findAlbumSongs(int)) );
    89             connect( mCurrentContainer, SIGNAL(playAlbumSongs(int, int)), mView, SLOT(playAlbumSongs(int, int)) );
    90             connect( mCurrentContainer, SIGNAL(playAlbumSongs(int, int)), mView, SLOT(playAlbumSongs(int, int)) );
       
    91             connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
    90         }
    92         }
    91         break;
    93         break;
    92     case ECollectionContextAlbums:
    94     case ECollectionContextAlbums:
    93         if ( mCurrentContext != ECollectionContextAlbumsTBone ) {
    95         if ( mCurrentContext != ECollectionContextAlbumsTBone ) {
    94             deleteCurrentContainer();
    96             deleteCurrentContainer();
    96             mCurrentContainer->initialize();
    98             mCurrentContainer->initialize();
    97             connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
    99             connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
    98             connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
   100             connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
    99             connect( mCurrentContainer, SIGNAL(findAlbumSongs(int)), mView, SLOT(findAlbumSongs(int)) );
   101             connect( mCurrentContainer, SIGNAL(findAlbumSongs(int)), mView, SLOT(findAlbumSongs(int)) );
   100             connect( mCurrentContainer, SIGNAL(playAlbumSongs(int, int)), mView, SLOT(playAlbumSongs(int, int)) );
   102             connect( mCurrentContainer, SIGNAL(playAlbumSongs(int, int)), mView, SLOT(playAlbumSongs(int, int)) );
       
   103             connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
   101         }
   104         }
   102         break;
   105         break;
   103     case ECollectionContextPlaylists:
   106     case ECollectionContextPlaylists:
   104         if ( mCurrentContext != ECollectionContextPlaylistSongs ) {
   107         if ( mCurrentContext != ECollectionContextPlaylistSongs ) {
   105             deleteCurrentContainer();
   108             deleteCurrentContainer();
   106             mCurrentContainer = new MpCollectionContainerPlaylists(mDocumentLoader);
   109             mCurrentContainer = new MpCollectionContainerPlaylists(mDocumentLoader);
   107             mCurrentContainer->initialize();
   110             mCurrentContainer->initialize();
   108             connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
   111             connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
   109             connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
   112             connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
       
   113             connect( mCurrentContainer, SIGNAL(shuffleEnabled(bool)), mView, SLOT(setShuffleAction(bool)) );
   110         }
   114         }
   111         break;
   115         break;
   112     case ECollectionContextArtistAlbums:
   116     case ECollectionContextArtistAlbums:
   113     case ECollectionContextArtistAlbumsTBone:
   117     case ECollectionContextArtistAlbumsTBone:
   114     case ECollectionContextArtistAllSongs:
   118     case ECollectionContextArtistAllSongs: