summaryrefslogtreecommitdiff
path: root/plugins/gtkui/ddbtabstrip.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-05 19:46:55 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-05 19:46:55 +0100
commitd4132fccbcd079c56b8109ecc15b011e5d1bdee1 (patch)
tree5c53c9efc9745e42b7c48a525a39334ebed7aaf8 /plugins/gtkui/ddbtabstrip.c
parenta1d50122035b30e5735ca5db70593fe51028e628 (diff)
new action API code fixes
Diffstat (limited to 'plugins/gtkui/ddbtabstrip.c')
-rw-r--r--plugins/gtkui/ddbtabstrip.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c
index ed91107e..2c62e0e9 100644
--- a/plugins/gtkui/ddbtabstrip.c
+++ b/plugins/gtkui/ddbtabstrip.c
@@ -886,12 +886,20 @@ static void
on_actionitem_activate (GtkMenuItem *menuitem,
DB_plugin_action_t *action)
{
- ddb_playlist_t *plt = NULL;
- if (tab_clicked != -1) {
- plt = deadbeef->plt_get_for_idx (tab_clicked);
+ if (action->flags & DB_ACTION_USING_API_14) {
+ ddb_playlist_t *plt = NULL;
+ if (tab_clicked != -1) {
+ plt = deadbeef->plt_get_for_idx (tab_clicked);
+ }
+ typedef int (*action_callback_14_t)(struct DB_plugin_action_s *action, void *userdata);
+ ((action_callback_14_t)action->callback) (action, plt);
+ if (plt) {
+ deadbeef->plt_unref (plt);
+ }
+ }
+ else {
+ action->callback (action, DDB_ACTION_CTX_PLAYLIST);
}
- action->callback (action, NULL, DDB_ACTION_CTX_PLAYLIST);
- deadbeef->plt_unref (plt);
}
static GtkWidget*