From 3b206948e1d1d463c53629fb57cdee954e860a0a Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 3 Apr 2015 12:27:05 -0400 Subject: [PATCH] gui: Implement on_track_removed() in the Tab class Signed-off-by: Anna Schumaker --- gui/tabs.cpp | 22 +++++++--------------- include/gui/tabs.h | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/gui/tabs.cpp b/gui/tabs.cpp index 5c90e1b5..ebfbf51c 100644 --- a/gui/tabs.cpp +++ b/gui/tabs.cpp @@ -80,6 +80,13 @@ void Tab :: on_track_added(unsigned int row) tab_runtime_changed(); } +void Tab :: on_track_removed(unsigned int row) +{ + tab_model->on_row_deleted(row); + tab_set_size(); + tab_runtime_changed(); +} + /** * @@ -231,13 +238,6 @@ void Tab :: tab_ban_selected() void Tab :: on_post_init() {} -void Tab :: on_track_deleted(unsigned int row) -{ - tab_model->on_row_deleted(row); - tab_set_size(); - tab_runtime_changed(); -} - void Tab :: on_track_changed(unsigned int row) { tab_model->on_row_changed(row); @@ -417,13 +417,6 @@ static Tab *cur_tab() return NULL; } -static void on_track_deleted(Queue *pq, unsigned int row) -{ - Tab *tab = find_tab(pq); - if (tab) - tab->on_track_deleted(row); -} - static void on_track_changed(Queue *pq, unsigned int row) { Tab *tab = find_tab(pq); @@ -487,7 +480,6 @@ static void init_menu_item(const std::string &pq, unsigned int n) void init_tabs() { struct Callbacks *cb = get_callbacks(); - cb->on_queue_track_del = on_track_deleted; cb->on_queue_track_changed = on_track_changed; /* Notebook signals */ diff --git a/include/gui/tabs.h b/include/gui/tabs.h index e601ddb7..023ce348 100644 --- a/include/gui/tabs.h +++ b/include/gui/tabs.h @@ -54,6 +54,7 @@ public: * QNotifier implementation */ void on_track_added(unsigned int); + void on_track_removed(unsigned int); /** * More helper functions @@ -76,7 +77,6 @@ public: * internal callback functions that can be overridden if necessary */ virtual void on_post_init(); - virtual void on_track_deleted(unsigned int); virtual void on_track_changed(unsigned int); virtual bool on_key_press_event(const std::string &); virtual void on_show_rc_menu();