diff options
author | Max Kellermann <max@duempel.org> | 2014-02-01 01:11:50 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-04 00:57:43 +0100 |
commit | 29072797ca5a397b2878e458db22cb5dcc7dfe4d (patch) | |
tree | 442384db532c0d5d5affa5efa2c415efffe76c0e /src/db/DatabasePlaylist.cxx | |
parent | db69ceade64c1e1a9c3d7a7c634f8b8b05ce73b9 (diff) | |
download | mpd-29072797ca5a397b2878e458db22cb5dcc7dfe4d.tar.gz mpd-29072797ca5a397b2878e458db22cb5dcc7dfe4d.tar.xz mpd-29072797ca5a397b2878e458db22cb5dcc7dfe4d.zip |
db/DatabasePlaylist: pass Database reference around
Reduce global variable usage, move to frontend code.
Diffstat (limited to 'src/db/DatabasePlaylist.cxx')
-rw-r--r-- | src/db/DatabasePlaylist.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/db/DatabasePlaylist.cxx b/src/db/DatabasePlaylist.cxx index 64b365d2a..814901227 100644 --- a/src/db/DatabasePlaylist.cxx +++ b/src/db/DatabasePlaylist.cxx @@ -21,7 +21,6 @@ #include "DatabasePlaylist.hxx" #include "Selection.hxx" #include "PlaylistFile.hxx" -#include "DatabaseGlue.hxx" #include "DatabasePlugin.hxx" #include "DetachedSong.hxx" #include "Mapper.hxx" @@ -37,17 +36,14 @@ AddSong(const char *playlist_path_utf8, } bool -search_add_to_playlist(const char *uri, const char *playlist_path_utf8, +search_add_to_playlist(const Database &db, + const char *uri, const char *playlist_path_utf8, const SongFilter *filter, Error &error) { - const Database *db = GetDatabase(error); - if (db == nullptr) - return false; - const DatabaseSelection selection(uri, true, filter); using namespace std::placeholders; const auto f = std::bind(AddSong, playlist_path_utf8, _1, _2); - return db->Visit(selection, f, error); + return db.Visit(selection, f, error); } |