summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/gtkui/actionhandlers.c17
-rw-r--r--plugins/gtkui/fileman.c10
-rw-r--r--plugins/gtkui/mainplaylist.c7
-rw-r--r--plugins/gtkui/plcommon.c2
4 files changed, 18 insertions, 18 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;
}
diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c
index 3da9b265..4ed4c827 100644
--- a/plugins/gtkui/fileman.c
+++ b/plugins/gtkui/fileman.c
@@ -74,8 +74,8 @@ gtkpl_add_files (GSList *lst) {
g_slist_foreach(lst, gtkpl_addfile_cb, NULL);
g_slist_free (lst);
deadbeef->pl_add_files_end ();
+ deadbeef->plt_save_config (plt);
deadbeef->plt_unref (plt);
- deadbeef->pl_save_all ();
deadbeef->conf_save ();
}
@@ -83,7 +83,7 @@ static void
add_dirs_worker (void *data) {
GSList *lst = (GSList *)data;
gtkpl_add_dirs (lst);
- deadbeef->pl_save_all ();
+ deadbeef->pl_save_current ();
deadbeef->conf_save ();
}
@@ -109,9 +109,9 @@ static void
open_files_worker (void *data) {
GSList *lst = (GSList *)data;
gtkpl_add_files (lst);
- deadbeef->pl_save_all ();
- deadbeef->conf_save ();
+ deadbeef->pl_save_current ();
deadbeef->pl_set_cursor (PL_MAIN, 0);
+ deadbeef->conf_save ();
deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0);
deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 1, 0);
}
@@ -239,8 +239,8 @@ gtkpl_add_fm_dropped_files (DB_playItem_t *drop_before, char *ptr, int length) {
free (ptr);
deadbeef->pl_add_files_end ();
+ deadbeef->plt_save_config (plt);
deadbeef->plt_unref (plt);
- deadbeef->pl_save_all ();
g_idle_add (set_dnd_cursor_idle, first);
}
diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c
index 617e81cc..cfc81a83 100644
--- a/plugins/gtkui/mainplaylist.c
+++ b/plugins/gtkui/mainplaylist.c
@@ -116,9 +116,12 @@ main_drag_n_drop (DdbListviewIter before, DdbPlaylistHandle from_playlist, uint3
else {
deadbeef->plt_move_items (plt, PL_MAIN, (ddb_playlist_t *)from_playlist, (DB_playItem_t *)before, indices, length);
}
+ if (!copy && from_playlist != plt) {
+ deadbeef->plt_save_config (from_playlist);
+ }
+ deadbeef->plt_save_config (plt);
deadbeef->plt_unref (plt);
deadbeef->pl_unlock ();
- deadbeef->pl_save_all ();
}
void main_external_drag_n_drop (DdbListviewIter before, char *mem, int length) {
@@ -189,7 +192,7 @@ void main_draw_group_title (DdbListview *listview, cairo_t *drawable, DdbListvie
void
main_delete_selected (void) {
deadbeef->pl_delete_selected ();
- deadbeef->pl_save_all ();
+ deadbeef->pl_save_current();
main_refresh ();
search_refresh ();
}
diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c
index dcfbcf8d..1b111e26 100644
--- a/plugins/gtkui/plcommon.c
+++ b/plugins/gtkui/plcommon.c
@@ -338,7 +338,7 @@ on_remove2_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
int cursor = deadbeef->pl_delete_selected ();
- deadbeef->pl_save_all ();
+ deadbeef->pl_save_current ();
deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0);
}