From 03b57df6308a7f84e0e597c3687e7adfc512c630 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 22 Oct 2013 00:38:10 +0200 Subject: Queue: ModifyAtOrder() does not increment version Leave that to the caller, allowing it to modify multiple items at a time. --- src/Playlist.cxx | 1 + src/Queue.cxx | 2 -- src/Queue.hxx | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Playlist.cxx b/src/Playlist.cxx index 296b52769..2f01d6be9 100644 --- a/src/Playlist.cxx +++ b/src/Playlist.cxx @@ -48,6 +48,7 @@ playlist::TagModified(Song &&song) current_song.ReplaceTag(std::move(*song.tag)); queue.ModifyAtOrder(current); + queue.IncrementVersion(); idle_add(IDLE_PLAYLIST); } diff --git a/src/Queue.cxx b/src/Queue.cxx index 73628d02e..ea93e8157 100644 --- a/src/Queue.cxx +++ b/src/Queue.cxx @@ -83,8 +83,6 @@ queue::ModifyAtOrder(unsigned _order) unsigned position = order[_order]; items[position].version = version; - - IncrementVersion(); } void diff --git a/src/Queue.hxx b/src/Queue.hxx index 0088e080f..e3a66f3a8 100644 --- a/src/Queue.hxx +++ b/src/Queue.hxx @@ -241,7 +241,8 @@ struct queue { void IncrementVersion(); /** - * Marks the specified song as "modified" and increments the version + * Marks the specified song as "modified". Call + * IncrementVersion() after all modifications have been made. * number. */ void ModifyAtOrder(unsigned order); -- cgit v1.2.3