From b7171a2b97f7671125abe6ebb8bfffd31ff3e14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 4 Jan 2021 18:46:27 +0100 Subject: LIBRARYTABLE_LOCATION to LIBRARYTABLE_LOCATION_ID because the column holds only a reference to the track locations table. Use the enum COLUMN_TRACKLOCATIONSTABLE_LOCATION instead of COLUMN_LIBRARYTABLE_NATIVELOCATION becase it points only to the id column. Delete also enums for non existing Playlist table columns. --- src/library/basetrackcache.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/library/basetrackcache.cpp') diff --git a/src/library/basetrackcache.cpp b/src/library/basetrackcache.cpp index 91aef93448..24c325fe8e 100644 --- a/src/library/basetrackcache.cpp +++ b/src/library/basetrackcache.cpp @@ -273,13 +273,12 @@ bool BaseTrackCache::updateIndexWithQuery(const QString& queryString) { record.resize(numColumns); for (int i = 0; i < numColumns; ++i) { - if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_NATIVELOCATION) == i) { + if (fieldIndex(ColumnCache::COLUMN_TRACKLOCATIONSTABLE_LOCATION) == i) { // Database stores all locations with Qt separators: "/" // Here we want to cache the display string with native separators. QString location = query.value(i).toString(); record[i] = QDir::toNativeSeparators(location); - } - else { + } else { record[i] = query.value(i); } } @@ -378,7 +377,7 @@ void BaseTrackCache::getTrackValueForColumn(TrackPointer pTrack, trackValue.setValue(pTrack->getType()); } else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_TRACKNUMBER) == column) { trackValue.setValue(pTrack->getTrackNumber()); - } else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_NATIVELOCATION) == column) { + } else if (fieldIndex(ColumnCache::COLUMN_TRACKLOCATIONSTABLE_LOCATION) == column) { trackValue.setValue(QDir::toNativeSeparators(pTrack->getLocation())); } else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COMMENT) == column) { trackValue.setValue(pTrack->getComment()); @@ -407,7 +406,7 @@ void BaseTrackCache::getTrackValueForColumn(TrackPointer pTrack, } else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART_LOCATION) == column) { trackValue.setValue(pTrack->getCoverInfo().coverLocation); } else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART_HASH) == column || - fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART) == column) { + fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART) == column) { // For sorting, we give COLUMN_LIBRARYTABLE_COVERART the same value as // the cover hash. trackValue.setValue(pTrack->getCoverHash()); -- cgit v1.2.3