screen_find: make the ListRenderer mandatory
authorMax Kellermann <max@musicpd.org>
Sat, 17 Mar 2018 07:47:14 +0000 (08:47 +0100)
committerMax Kellermann <max@musicpd.org>
Sat, 17 Mar 2018 07:47:14 +0000 (08:47 +0100)
src/AlbumListPage.cxx
src/ArtistListPage.cxx
src/screen_browser.cxx
src/screen_find.cxx
src/screen_find.hxx
src/screen_queue.cxx

index 7005427..4247b29 100644 (file)
@@ -248,7 +248,7 @@ AlbumListPage::OnCommand(struct mpdclient &c, command_t cmd)
        case CMD_LIST_JUMP:
                screen_jump(screen, &lw,
                            AlbumListCallback, &album_list,
-                           this);
+                           *this);
                SetDirty();
                return true;
 
index 3844678..b34c80d 100644 (file)
@@ -199,7 +199,7 @@ ArtistListPage::OnCommand(struct mpdclient &c, command_t cmd)
        case CMD_LIST_JUMP:
                screen_jump(screen, &lw,
                            screen_artist_lw_callback, &artist_list,
-                           this);
+                           *this);
                SetDirty();
                return true;
 
index a683a8e..2920ad0 100644 (file)
@@ -387,7 +387,7 @@ FileListPage::OnCommand(struct mpdclient &c, command_t cmd)
        case CMD_LIST_JUMP:
                screen_jump(screen, &lw,
                            browser_lw_callback, filelist,
-                           this);
+                           *this);
                SetDirty();
                return true;
 
index ff3e3c9..7c092c0 100644 (file)
@@ -89,7 +89,7 @@ screen_find(ScreenManager &screen, ListWindow *lw, command_t findcmd,
 void
 screen_jump(ScreenManager &screen, ListWindow *lw,
            list_window_callback_fn_t callback_fn, void *callback_data,
-           const ListRenderer *renderer)
+           const ListRenderer &renderer)
 {
        constexpr size_t WRLN_MAX_LINE_SIZE = 1024;
        int key = 65;
@@ -125,10 +125,7 @@ screen_jump(ScreenManager &screen, ListWindow *lw,
                lw->Jump(callback_fn, callback_data, search_str);
 
                /* repaint the list_window */
-               if (renderer != nullptr)
-                       lw->Paint(*renderer);
-               else
-                       lw->Paint(callback_fn, callback_data);
+               lw->Paint(renderer);
                wrefresh(lw->w);
        }
 
index 872ac0e..6fe09d5 100644 (file)
@@ -46,6 +46,6 @@ screen_find(ScreenManager &screen, ListWindow *lw,
 void
 screen_jump(ScreenManager &screen, ListWindow *lw,
            list_window_callback_fn_t callback_fn, void *callback_data,
-           const ListRenderer *renderer);
+           const ListRenderer &renderer);
 
 #endif
index 89c86c7..4f4f8cb 100644 (file)
@@ -519,7 +519,7 @@ QueuePage::OnCommand(struct mpdclient &c, command_t cmd)
                return true;
        case CMD_LIST_JUMP:
                screen_jump(screen, &lw, screen_queue_lw_callback, &c.playlist,
-                           this);
+                           *this);
                SaveSelection();
                SetDirty();
                return true;