diff options
author | Max Kellermann <max@duempel.org> | 2014-01-19 19:57:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-19 23:16:09 +0100 |
commit | 64465c1318e227ca625ee2047ec8b6a8f0c2faff (patch) | |
tree | cebe7785a4c50b698e29597eb28c70bcca5864ce /src/SongUpdate.cxx | |
parent | a506adea41e21e071ac3e88d69824d6dd3a3c925 (diff) | |
download | mpd-64465c1318e227ca625ee2047ec8b6a8f0c2faff.tar.gz mpd-64465c1318e227ca625ee2047ec8b6a8f0c2faff.tar.xz mpd-64465c1318e227ca625ee2047ec8b6a8f0c2faff.zip |
Song: make the "parent" attribute mandatory
The Song class is only used for database songs now. A Song without a
Directory is not possible anymore.
Diffstat (limited to 'src/SongUpdate.cxx')
-rw-r--r-- | src/SongUpdate.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index dd01ea7d7..ee70085f3 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -40,19 +40,18 @@ #include <sys/stat.h> Song * -Song::LoadFile(const char *path_utf8, Directory *parent) +Song::LoadFile(const char *path_utf8, Directory &parent) { Song *song; bool ret; - assert((parent == nullptr) == PathTraitsUTF8::IsAbsolute(path_utf8)); assert(!uri_has_scheme(path_utf8)); assert(strchr(path_utf8, '\n') == nullptr); song = NewFile(path_utf8, parent); //in archive ? - if (parent != nullptr && parent->device == DEVICE_INARCHIVE) { + if (parent.device == DEVICE_INARCHIVE) { ret = song->UpdateFileInArchive(); } else { ret = song->UpdateFile(); |