diff options
author | waker <wakeroid@gmail.com> | 2012-05-07 22:52:06 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-05-07 22:52:06 +0200 |
commit | 7abd272cf5adaeeab3841419dbb17c611cf62d2e (patch) | |
tree | c8b1b73f0ec2100168d4bd4f8326e3244284eff6 /plugins | |
parent | 5104e0d882f02dbb06da0cba6094a89514696980 (diff) |
hotkeys: fixed custom actions support for common and playlist flags
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/hotkeys/hotkeys.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c index c7c1c1f3..9c317120 100644 --- a/plugins/hotkeys/hotkeys.c +++ b/plugins/hotkeys/hotkeys.c @@ -95,8 +95,23 @@ cmd_invoke_plugin_command (DB_plugin_action_t *action) { trace ("We're here to invoke action %s / %s\n", action->title, action->name); - DB_plugin_t **plugins = deadbeef->plug_get_list(); - int i; + // common action + if (action->flags & DB_ACTION_COMMON) + { + action->callback (action, NULL); + return; + } + + // playlist action + if (action->flags & DB_ACTION_PLAYLIST) + { + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + if (plt) { + action->callback (action, plt); + deadbeef->plt_unref (plt); + } + return; + } int selected_count = 0; DB_playItem_t *pit = deadbeef->pl_get_first (PL_MAIN); @@ -113,13 +128,6 @@ cmd_invoke_plugin_command (DB_plugin_action_t *action) pit = next; } - - if (action->flags & DB_ACTION_COMMON) - { - //Simply call common action - action->callback (action, NULL); - return; - } //Now we're checking if action is applicable: if (selected_count == 0) |