mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp
changeset 25 3ec52facab4d
parent 20 82baf59ce8dd
child 29 8192e5b5c935
--- a/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp	Mon May 03 12:29:20 2010 +0300
+++ b/mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerfactory.cpp	Fri May 14 15:49:53 2010 +0300
@@ -21,6 +21,7 @@
 #include "mpcollectionview.h"
 #include "mpcollectioncontainer.h"
 #include "mpcollectioncontainerallsongs.h"
+#include "mpcollectioncontainerartists.h"
 #include "mpcollectioncontaineralbums.h"
 #include "mpcollectioncontainerplaylists.h"
 #include "mpcollectioncontainergenres.h"
@@ -75,6 +76,16 @@
         connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
         connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
         break;
+    case ECollectionContextArtists:
+            if ( ( mCurrentContext != ECollectionContextArtistAlbums ) && ( mCurrentContext != ECollectionContextAlbumSongs) )
+                {
+                deleteCurrentContainer();
+                mCurrentContainer = new MpCollectionContainerArtists(mDocumentLoader);
+                mCurrentContainer->initialize();
+                connect( mCurrentContainer, SIGNAL(itemActivated(int)), mView, SLOT(openIndex(int)) );
+                connect( mCurrentContainer, SIGNAL(itemLongPressed(int, QPointF)), mView, SLOT(openContextMenu(int, QPointF)) );
+            }
+            break;
     case ECollectionContextAlbums:
         if ( mCurrentContext != ECollectionContextAlbumSongs ) {
             deleteCurrentContainer();
@@ -103,6 +114,8 @@
         }
         break;
     case ECollectionContextAlbumSongs:
+    case ECollectionContextArtistAlbums:
+    case ECollectionContextArtistSongs:
     case ECollectionContextPlaylistSongs:
     case ECollectionContextGenreSongs:
         // For this contexts, reuse the same container.
@@ -123,6 +136,11 @@
     case ECollectionContextAllSongs:
         delete static_cast<MpCollectionContainerAllSongs *>(mCurrentContainer);
         break;
+    case ECollectionContextArtists:
+    case ECollectionContextArtistAlbums:
+    case ECollectionContextArtistSongs:
+        delete static_cast<MpCollectionContainerArtists *>(mCurrentContainer);
+        break;
     case ECollectionContextAlbums:
     case ECollectionContextAlbumSongs:
         delete static_cast<MpCollectionContainerAlbums *>(mCurrentContainer);