diff options
-rw-r--r-- | deadbeef.h | 6 | ||||
-rw-r--r-- | plugins.c | 18 | ||||
-rw-r--r-- | plugins/gtkui/plcommon.c | 5 | ||||
-rw-r--r-- | plugins/shellexec/shellexec.c | 6 |
4 files changed, 27 insertions, 8 deletions
@@ -1016,13 +1016,19 @@ enum { /* Can handle multiple tracks */ DB_ACTION_MULTIPLE_TRACKS = 1 << 2, + /* DEPRECATED in API 1.5 */ + DB_ACTION_ALLOW_MULTIPLE_TRACKS = 1 << 2, + /* DEPRECATED in API 1.5, ignored in callback2 */ + /* Action can (and prefer) traverse multiple tracks by itself */ DB_ACTION_CAN_MULTIPLE_TRACKS = 1 << 3, /* Action is inactive */ DB_ACTION_DISABLED = 1 << 4, /* DEPRECATED in API 1.5, ignored in callback2 */ + /* since 1.2 */ + /* Action for the playlist (tab) */ DB_ACTION_PLAYLIST = 1 << 5, /* add item to menu(s), if contains slash symbol(s) */ @@ -1275,9 +1275,21 @@ plug_is_local_file (const char *fname) { return 1; } - for (; *fname; fname++) { - if (!strncmp (fname, "://", 3)) { - return 0; + const char *f = fname; + for (; *f; f++) { + if (!strncmp (f, "://", 3)) { + DB_vfs_t **plug = plug_get_vfs_list (); + for (int i = 0; plug[i]; i++) { + if (plug[i]->get_schemes && plug[i]->is_streaming && plug[i]->is_streaming()) { + const char **sch = plug[i]->get_schemes (); + for (int k = 0; sch[k]; k++) { + if (!strncmp (sch[k], fname, strlen (sch[k]))) { + return 0; + } + } + } + } + break; } } diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c index b2d75035..2e72155c 100644 --- a/plugins/gtkui/plcommon.c +++ b/plugins/gtkui/plcommon.c @@ -624,7 +624,7 @@ list_context_menu (DdbListview *listview, DdbListviewIter it, int idx) { int count = 0; for (action = actions; action; action = action->next) { - if ((action->flags & DB_ACTION_COMMON) || !(action->flags & DB_ACTION_ADD_MENU) || !(action->flags & (DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_SINGLE_TRACK))) + if ((action->flags & DB_ACTION_COMMON) || !((action->callback2 && (action->flags & DB_ACTION_ADD_MENU)) || action->callback) || !(action->flags & (DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_SINGLE_TRACK))) continue; // create submenus (separated with '/') @@ -701,8 +701,7 @@ list_context_menu (DdbListview *listview, DdbListviewIter it, int idx) { G_CALLBACK (actionitem_activate), action); if ((selected_count > 1 && !(action->flags & DB_ACTION_MULTIPLE_TRACKS)) || - (action->flags & DB_ACTION_DISABLED)) - { + (action->flags & DB_ACTION_DISABLED)) { gtk_widget_set_sensitive (GTK_WIDGET (actionitem), FALSE); } } diff --git a/plugins/shellexec/shellexec.c b/plugins/shellexec/shellexec.c index 329b9d9e..56ceb970 100644 --- a/plugins/shellexec/shellexec.c +++ b/plugins/shellexec/shellexec.c @@ -191,10 +191,12 @@ shx_get_plugin_actions (DB_playItem_t *it) for (action = actions; action; action = (Shx_action_t *)action->parent.next) { if ((!(action->shx_flags & SHX_ACTION_LOCAL_ONLY) && is_local) || - (!(action->shx_flags & SHX_ACTION_REMOTE_ONLY) && !is_local)) + (!(action->shx_flags & SHX_ACTION_REMOTE_ONLY) && !is_local)) { action->parent.flags |= DB_ACTION_DISABLED; - else + } + else { action->parent.flags &= ~DB_ACTION_DISABLED; + } } return (DB_plugin_action_t *)actions; } |