From 497d090814b689da453740af42f00c6a6ad3677a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Sep 2019 11:24:44 +0200 Subject: [PATCH] db/simple/Song: remove static method NewFile() --- src/SongUpdate.cxx | 5 ++--- src/db/plugins/simple/Song.cxx | 6 ------ src/db/plugins/simple/Song.hxx | 3 --- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 72714fa0f..733f0ef35 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -45,7 +45,7 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent) assert(!uri_has_scheme(path_utf8)); assert(strchr(path_utf8, '\n') == nullptr); - auto song = NewFile(path_utf8, parent); + auto song = std::make_unique(path_utf8, parent); if (!song->UpdateFile(storage)) return nullptr; @@ -98,8 +98,7 @@ Song::LoadFromArchive(ArchiveFile &archive, const char *name_utf8, assert(!uri_has_scheme(name_utf8)); assert(strchr(name_utf8, '\n') == nullptr); - auto song = NewFile(name_utf8, parent); - + auto song = std::make_unique(name_utf8, parent); if (!song->UpdateFileInArchive(archive)) return nullptr; diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx index f5b0b539e..e46398fa1 100644 --- a/src/db/plugins/simple/Song.cxx +++ b/src/db/plugins/simple/Song.cxx @@ -48,12 +48,6 @@ Song::NewFrom(DetachedSong &&other, Directory &parent) noexcept return song; } -SongPtr -Song::NewFile(const char *path, Directory &parent) noexcept -{ - return SongPtr(song_alloc(path, parent)); -} - std::string Song::GetURI() const noexcept { diff --git a/src/db/plugins/simple/Song.hxx b/src/db/plugins/simple/Song.hxx index 8df7d9496..deeae85ef 100644 --- a/src/db/plugins/simple/Song.hxx +++ b/src/db/plugins/simple/Song.hxx @@ -101,9 +101,6 @@ struct Song { static SongPtr NewFrom(DetachedSong &&other, Directory &parent) noexcept; - /** allocate a new song with a local file name */ - static SongPtr NewFile(const char *path_utf8, Directory &parent) noexcept; - /** * allocate a new song structure with a local file name and attempt to * load its metadata. If all decoder plugin fail to read its meta