diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-03 19:39:25 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-03 19:39:25 +0100 |
commit | fd71c5952690f419b919eb3bc5facc9d332a98b9 (patch) | |
tree | 307bf5b9f314eef67af22f1275774a51cef979f3 /plugins/gtkui/plcommon.c | |
parent | 553d1c27fec6e5ef1743f97e2e7c612ec8678ab8 (diff) |
changed action API to be backwards compatible with 0.5 on source level
Diffstat (limited to 'plugins/gtkui/plcommon.c')
-rw-r--r-- | plugins/gtkui/plcommon.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c index 08f7e3fa..299384d0 100644 --- a/plugins/gtkui/plcommon.c +++ b/plugins/gtkui/plcommon.c @@ -467,37 +467,11 @@ void actionitem_activate (GtkMenuItem *menuitem, DB_plugin_action_t *action) { - if (action->flags & DB_ACTION_USING_API_14) { - typedef int (*action_callback_14_t)(struct DB_plugin_action_s *action, void *userdata); - // Plugin can handle all tracks by itself - if (action->flags & DB_ACTION_CAN_MULTIPLE_TRACKS__DEPRECATED) - { - ((action_callback_14_t)action->callback) (action, NULL); - return; - } - - // For single-track actions just invoke it with first selected track - if (!(action->flags & DB_ACTION_MULTIPLE_TRACKS)) - { - DB_playItem_t *it = deadbeef->pl_get_for_idx_and_iter (clicked_idx, PL_MAIN); - ((action_callback_14_t)action->callback) (action, it); - deadbeef->pl_item_unref (it); - return; - } - - //We end up here if plugin won't traverse tracks and we have to do it ourselves - DB_playItem_t *it = deadbeef->pl_get_first (PL_MAIN); - while (it) { - if (deadbeef->pl_is_selected (it)) { - ((action_callback_14_t)action->callback) (action, it); - } - DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN); - deadbeef->pl_item_unref (it); - it = next; - } + if (action->callback) { + gtkui_exec_action_14 (action, clicked_idx); } else { - action->callback (action, DDB_ACTION_CTX_SELECTION); + action->callback2 (action, DDB_ACTION_CTX_SELECTION); } } |