aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistUpdate.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-01 00:45:58 +0100
committerMax Kellermann <max@duempel.org>2014-02-01 00:45:58 +0100
commit8cf4fb53aa102380a8e734590aa6e82920e9632c (patch)
tree3bd1353dd2310cdb9472a284900e1ad0d0e08a3c /src/PlaylistUpdate.cxx
parent1769ae54e4d1cf33e7528147f1ddf2f031228bd9 (diff)
downloadmpd-8cf4fb53aa102380a8e734590aa6e82920e9632c.tar.gz
mpd-8cf4fb53aa102380a8e734590aa6e82920e9632c.tar.xz
mpd-8cf4fb53aa102380a8e734590aa6e82920e9632c.zip
Playlist: pass Database to DatabaseModified()
Don't use global variable.
Diffstat (limited to '')
-rw-r--r--src/PlaylistUpdate.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/PlaylistUpdate.cxx b/src/PlaylistUpdate.cxx
index 114305960..89132ca7b 100644
--- a/src/PlaylistUpdate.cxx
+++ b/src/PlaylistUpdate.cxx
@@ -19,7 +19,6 @@
#include "config.h"
#include "Playlist.hxx"
-#include "db/DatabaseGlue.hxx"
#include "db/DatabasePlugin.hxx"
#include "db/LightSong.hxx"
#include "DetachedSong.hxx"
@@ -56,17 +55,12 @@ UpdatePlaylistSong(const Database &db, DetachedSong &song)
}
void
-playlist::DatabaseModified()
+playlist::DatabaseModified(const Database &db)
{
- const Database *db = GetDatabase();
- if (db == nullptr)
- /* how can this ever happen? */
- return;
-
bool modified = false;
for (unsigned i = 0, n = queue.GetLength(); i != n; ++i) {
- if (UpdatePlaylistSong(*db, queue.Get(i))) {
+ if (UpdatePlaylistSong(db, queue.Get(i))) {
queue.ModifyAtPosition(i);
modified = true;
}