screen_artist: simplify the GO_PARENT_DIRECTORY handler
authorMax Kellermann <max@musicpd.org>
Wed, 17 Oct 2018 10:32:51 +0000 (12:32 +0200)
committerMax Kellermann <max@musicpd.org>
Wed, 17 Oct 2018 10:32:51 +0000 (12:32 +0200)
src/screen_artist.cxx

index 38da791..ea0ae5a 100644 (file)
@@ -273,7 +273,7 @@ ArtistBrowserPage::OnCommand(struct mpdclient &c, Command cmd)
 
        case Command::GO_ROOT_DIRECTORY:
                if (GetCurrentPage() != &artist_list_page) {
 
        case Command::GO_ROOT_DIRECTORY:
                if (GetCurrentPage() != &artist_list_page) {
-                       OpenArtistList(c);
+                       SetCurrentPage(c, &artist_list_page);
                        return true;
                }
 
                        return true;
                }
 
@@ -281,11 +281,10 @@ ArtistBrowserPage::OnCommand(struct mpdclient &c, Command cmd)
 
        case Command::GO_PARENT_DIRECTORY:
                if (GetCurrentPage() == &album_list_page) {
 
        case Command::GO_PARENT_DIRECTORY:
                if (GetCurrentPage() == &album_list_page) {
-                       OpenArtistList(c);
+                       SetCurrentPage(c, &artist_list_page);
                        return true;
                } else if (GetCurrentPage() == &song_list_page) {
                        return true;
                } else if (GetCurrentPage() == &song_list_page) {
-                       OpenAlbumList(c, FindTag(song_list_page.GetFilter(),
-                                                artist_list_page.GetTag()));
+                       SetCurrentPage(c, &album_list_page);
                        return true;
                }
 
                        return true;
                }