summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f46b959)
raw | patch | inline | side by side (parent: f46b959)
author | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 21:55:40 +0000 (23:55 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 21:55:40 +0000 (23:55 +0200) |
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 3b50a12b852a14871ed13fc2087f21d42f492263..bd830bac23785ecf735d21c3bbd52da483f7c7c6 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
mpdclient_cmd_play(c, lw->selected);
return true;
case CMD_DELETE:
- {
- int i = lw->selected_end, start = lw->selected_start;
- for(; i >= start; --i)
- mpdclient_cmd_delete(c, i);
-
- i++;
- if(i >= (int)playlist_length(&c->playlist))
- i--;
- lw->selected = i;
- lw->selected_start = i;
- lw->selected_end = i;
- lw->range_selection = false;
+ if (lw->range_selection) {
+ mpdclient_cmd_delete_range(c, lw->selected_start,
+ lw->selected_end + 1);
+ } else {
+ mpdclient_cmd_delete(c, lw->selected);
+ }
- playlist_save_selection();
+ lw->selected = lw->selected_end = lw->selected_start;
+ lw->range_selection = false;
return true;
- }
+
case CMD_SAVE_PLAYLIST:
playlist_save(c, NULL, NULL);
return true;