diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-09-29 19:53:07 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-09-29 19:53:07 +0200 |
commit | 81e8c8ab6c6fe60e844e76c02315e6238bb3f97b (patch) | |
tree | 0427dd0716acd02258574e8ed26ab71337358030 /plugins/gtkui/actionhandlers.c | |
parent | 5fa0da2d9b0edf78097a0d29b1bde3c260a36af4 (diff) |
gtkui: get rid of all pl_save_all calls in favor of pl_save_current
Diffstat (limited to 'plugins/gtkui/actionhandlers.c')
-rw-r--r-- | plugins/gtkui/actionhandlers.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c index 9b47c2cc..158a5286 100644 --- a/plugins/gtkui/actionhandlers.c +++ b/plugins/gtkui/actionhandlers.c @@ -449,14 +449,14 @@ action_remove_from_playlist_handler (DB_plugin_action_t *act, int ctx) { deadbeef->pl_item_unref (it); } } + deadbeef->plt_save_config (plt); deadbeef->plt_unref (plt); - deadbeef->pl_save_all (); deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } } else if (ctx == DDB_ACTION_CTX_PLAYLIST) { deadbeef->pl_clear (); - deadbeef->pl_save_all (); + deadbeef->pl_save_current (); deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } else if (ctx == DDB_ACTION_CTX_NOWPLAYING) { @@ -469,17 +469,14 @@ action_remove_from_playlist_handler (DB_plugin_action_t *act, int ctx) { int idx = deadbeef->plt_get_item_idx (plt, it, PL_MAIN); if (idx != -1) { deadbeef->plt_remove_item (plt, it); - success = 1; + deadbeef->pl_save_current (); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } deadbeef->plt_unref (plt); } deadbeef->pl_item_unref (it); } deadbeef->pl_unlock (); - if (success) { - deadbeef->pl_save_all (); - deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); - } } return 0; } @@ -518,7 +515,7 @@ action_delete_from_disk_handler_cb (void *data) { it = next; } - deadbeef->pl_save_all (); + deadbeef->pl_save_current (); } else if (ctx == DDB_ACTION_CTX_PLAYLIST) { DB_playItem_t *it = deadbeef->plt_get_first (plt, PL_MAIN); @@ -533,7 +530,7 @@ action_delete_from_disk_handler_cb (void *data) { it = next; } - deadbeef->pl_save_all (); + deadbeef->pl_save_current (); } else if (ctx == DDB_ACTION_CTX_NOWPLAYING) { DB_playItem_t *it = deadbeef->streamer_get_playing_track (); @@ -881,7 +878,7 @@ action_sort_custom_handler (DB_plugin_action_t *act, int ctx) { int action_crop_selected_handler (DB_plugin_action_t *act, int ctx) { deadbeef->pl_crop_selected (); - deadbeef->pl_save_all (); + deadbeef->pl_save_current (); deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); return 0; } |