From cdb91bb5301b219b7055598e945af76a0829c059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 4 Oct 2024 01:03:06 +0200 Subject: [PATCH] remove unused addTracksAddFile() overload --- src/library/dao/trackdao.cpp | 6 ++++-- src/library/dao/trackdao.h | 9 +-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 6c2037acd52..7efa8637f9b 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -30,6 +30,7 @@ #include "util/db/sqlite.h" #include "util/db/sqlstringformatter.h" #include "util/db/sqltransaction.h" +#include "util/fileaccess.h" #include "util/fileinfo.h" #include "util/logger.h" #include "util/math.h" @@ -813,8 +814,9 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) { } TrackPointer TrackDAO::addTracksAddFile( - const mixxx::FileAccess& fileAccess, + const QString& filePath, bool unremove) { + const auto fileAccess = mixxx::FileAccess(mixxx::FileInfo(filePath)); // Check that track is a supported extension. // TODO(uklotzde): The following check can be skipped if // the track is already in the library. A refactoring is @@ -826,7 +828,7 @@ TrackPointer TrackDAO::addTracksAddFile( return nullptr; } - GlobalTrackCacheResolver cacheResolver(fileAccess); + auto cacheResolver = GlobalTrackCacheResolver(fileAccess); TrackPointer pTrack = cacheResolver.getTrack(); switch (cacheResolver.getLookupResult()) { case GlobalTrackCacheLookupResult::Hit: { diff --git a/src/library/dao/trackdao.h b/src/library/dao/trackdao.h index c10c4829694..48e520ca9c6 100644 --- a/src/library/dao/trackdao.h +++ b/src/library/dao/trackdao.h @@ -145,16 +145,9 @@ class TrackDAO : public QObject, public virtual DAO, public virtual GlobalTrackC TrackId addTracksAddTrack( const TrackPointer& pTrack, bool unremove); - TrackPointer addTracksAddFile( - const mixxx::FileAccess& fileAccess, - bool unremove); TrackPointer addTracksAddFile( const QString& filePath, - bool unremove) { - return addTracksAddFile( - mixxx::FileAccess(mixxx::FileInfo(filePath)), - unremove); - } + bool unremove); void addTracksFinish(bool rollback = false); bool updateTrack(const Track& track) const;